Search
Archives

You are currently browsing the Acidinc Blog blog archives for June, 2011.

Archive for June, 2011

Linux srcds installation tutorial

1) Getting started with HLDSUpdatetool

First of all download hldsupdatetool from the VALVe webserver. Make a dir called srcds_l, and save hldsupdatetool in that dir and run it. (Check this out when you have an uncompress error.)

Command(s):

mkdir srcds_l
cd srcds_l
wget http://www.steampowered.com/download/hldsupdatetool.bin
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin
./steam

The new version of HLDSUpdateTool will be downloaded now. You will be returned to the console after its done.

2) Downloading the files

We can start downloading the files. This can take a few hours depending on the connection the server uses.
Command(s):

./steam -command update -game “Counter-Strike Source” -dir .

If you want to install a Half-Life 2 Deathmatch server, use “hl2mp” for the game switch.
Go get yourself a cup of coffee.

3) Starting srcds

First edit (or create) srcds_l/cstrike/cfg/server.cfg like you want it to be. Now we are ready to run the srcds.
./srcds_run -console -game cstrike +map de_dust -maxplayers 16 -autoupdate
and press enter. (-game hl2mp if it’s a HL2DM server ofcourse)
Your srcds is now up and running.

Extra) Running srcds in background (re-attachable)

We will make a script that will run the srcds in the background in a “screen”
you will need to have screen installed for this. make a file called server.sh and put this in:
Command(s):

#!/bin/sh
echo “Starting Cs:Source Server”
sleep 1
screen -A -m -d -S css-server ./srcds_run -console -game cstrike +map de_dust +maxplayers 16 -autoupdate

Save the file, and chmod it to run
Command(s):

chmod +x server.sh

If you want to start your server, simply run server.sh . It will start your srcd server in the background, to open it type:
Command(s):

screen -x css-server

If you want to close it again press ctrl+a+d, and it will detach the screen and keep it running in the background.

Revision 2: No Login information required anymore.

Installing Proftpd on CentOS 5.4, 5.5 or 5.x

So I’ve been testing out webmin which is a free control panel for linux servers on one of my VPSs’ and I wanted to install an FTP server. Problem was this.. when I tried to run the proftpd module in webmin, it couldn’t find the proftpd rpm package to install on CentOS. So what did I do? Yes, google is the devil. I googled it. Found a website that explained how to do it but I can’t remember the website, I just remembered saving the command to install proftpd on CentOS. Hope this helps someone else out there

Do the following:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Then do the following:

yum install proftpd

and that should install proftpd so you can administer it via webmin 🙂

Good luck!

Changing the default SSH port on your VPS – CentOS 5

This is not in anyway a game changer when it comes to security. But, by simply changing your SSH port you can cut down on over 95% of automated brute force attempts. By default SSH utilizes the port 22; here’s how to change it:

Login into SSH and edit the sshd_config file which is located in /etc/ssh/.

    nano /etc/ssh/sshd_config

If you prefer to use vi, then simply change nano to vi.

Scroll down until you see the following line:

    #Port 22

Delete the # symbol and change the 22 to a different port to your liking. It should look like this:

    Port 5757

Save the file (CTRL-X), Y, and then enter. Finally, you just need to restart SSH

    service sshd reload

That’s it! Next time you SSH into your server, be sure to utilize the port 5757 instead of 22.

Test the Disk I/O of your VPS

There are a few commands that allow you to test the disk I/O speeds on your virtual machine. Please note that scores do vary and are not a completely accurate assessment of disk I/O.

hdparm -t /dev/sda1

Example output:

    [root@server~]# hdparm -t /dev/sda1
    /dev/sda1: Timing buffered disk reads: 1158 MB in 3.01 seconds = 385.34 MB/sec
    [root@server~]#

dd if=/dev/zero of=/tmp/test bs=64k count=16k conv=fdatasync

Example output:

    [root@server~]# dd if=/dev/zero of=/tmp/test bs=64k count=16k conv=fdatasync
    16384+0 records in
    16384+0 records out
    1073741824 bytes (1.1 GB) copied, 4.89845 seconds, 219 MB/s
    [root@server~]#

There is an ongoing thread posted on WebHostingTalk which will allow you to compare your score.