Monday, October 22, 2012

Installation Of Minecraft Server on Linux

What is Minecraft Server?

Minecraft servers allow players to play online games with other people. They may either be run on a hosted Minecraft server service, a dedicated server, a Virtual Private Server or a home machine.

Steps

1.Installing Java
To check if Java has been installed type the following into the terminal:
which java
If not you will need to install it, the following will install Java-JDK 1.6:

yum install java-1.6.0-openjdk

2.mkdir minecraft

3.cd minecraft

4.Time to get Minecraft:
  wget http://www.minecraft.net/download/minecraft_server.jar

5.Once it has finished downloading you will need to make sure Minecraft has the correct permissions:

chmod +x minecraft_server.jar

6.Launching Minecraft
Launching the Minecraft server on a Linux server is different from launching on a Windows based server because when you close the SSH terminal Minecraft will also close. To get around this we will need to install "screen" which will keep the Minecraft server running after the SSH terminal is closed. To install screen:

yum install screen

Now that screen is installed we will use it run the server:

screen

Starting up Minecraft now:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
(*1024 value can be changed depending on how much RAM your VPS has)
Ex. 512MB VPS - java -Xmx512M -Xms512M -jar minecraft_server.jar nogui
Ex. 2048MB VPS - java -Xmx2048M -Xms2048M -jar minecraft_server.jar nogui

Your Minecraft server is now up and running and you will be able to play with all your friends.

Wednesday, October 17, 2012

Apache::LimitIPConn Module Installation

Apache::LimitIPConn - Limit simultaneous connections by an IP address
This package allows a web server administrator to impose limits on the number of simultaneous connections that a single IP address can make to the Apache server.
The Apache::LimitByIPConn module lets you enforce limits on the number of simultaneous downloads allowed from a single IP address. You can also control which MIME types are affected by the limits.
The MaxConnPerIP variable dictates the maximum number of simultaneous connections that each IP address is allowed. Connections in excess ofthis limit will result in a 403 Forbidden response.
The NoIPLimit variable specifies a list of MIME types for which limit
checking is turned off. The OnlyIPLimit variable followed by a list of
MIME types restricts limit checking only to the types specified under
this variable. These MIME types match by prefix, so for example
PerlSetVar NoIPLimit "image"
Turns off limit checking for all MIME types starting with "image",
including "image/jpeg", "image/png", etc. Wildcard matching with ? and * is also supported.
NOTES
The limits defined by Apache::LimitIPConn apply to all IP addresses
connecting to your Apache server. Currently there is no way to set
different limits for different IP addresses.
Proxy clients are treated no differently from regular clients. Overly
restrictive limits will adversely affect the accessibility of your site
from large Internet Service Providers such as AOL that route millions of
users through a small pool of proxy clients.
This module requires Apache::Scoreboard and the configuration setting
"ExtendedStatus On" in the httpd.conf configuration file.

In order to install this module, you'll first need to download and install Apache::Scoreboard from CPAN.

 
Installation Steps 

cd /usr/local/src/

wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2


tar -xvf mod_limitipconn-0.24.tar.bz2


cd mod_limitipconn-0.24


make


make install


httpd -t


/etc/init.d/httpd restart


Add the below lines in httpd.conf


vi /usr/local/apache/conf/httpd.conf

============================================
# This command is always needed
ExtendedStatus On
# Only needed if the module is compiled as a DSO
LoadModule limitipconn_module lib/apache/mod_limitipconn.so

# Set a server-wide limit of 10 simultaneous downloads per IP,

# no matter what.
MaxConnPerIP 10

# This section affects all files under http://your.server/somewhere
MaxConnPerIP 3
# exempting images from the connection limit is often a good
# idea if your web page has lots of inline images, since these
# pages often generate a flurry of concurrent image requests
NoIPLimit image/*

# This section affects all files under /home/*/public_html
MaxConnPerIP 1
# In this case, all MIME types other than audio/mpeg and video*
# are exempt from the limit check
OnlyIPLimit audio/mpeg video
============================================
Check the syntax if everything is ok then restart the apache.
httpd -t
/etc/init.d/httpd restart
/etc/init.d/httpd status