Akensai Web Development

Source Server with DreamHost PS

Posted: May 22nd, 2010

View the DreamHost Forum Discussion on this.

@Readers: Please post results in a comment here if you try this

By now most people know I am using Dreamhost Private Servers to run Team Fortress 2 game servers, so I decided it's time to share the secret to running a 32 slot TF2 server for $11 a month (bundled) or $15 a month (single).

First off, you pay for a Dreamhost PS per how much ram you need, after careful testing with some trial and error, I found out that on Linux a basic 32 slot TF2 server, when completely filled will only use about 250mb of ram, thus the minimum @ Dreamhost for a PS (300mb) is perfect for any basic server, now if your going to be running a ton of plugins, you may want to drag that resource allocation bar up to around 450mb just to be safe.

Anarchy99 currently has 3 servers running off of the Dreamhost PS shells, each one its own PS, and bundled they are anywhere from $8/mo to $15/mo each.

Lets get started then, shall we?

To start, your gonna need Dreamhost hosting, they are an excellent company to use, and I highly recommend them to anyone in the market for web hosting, at the moment you can get amazing hosting for $2/mo, same hosting I have for my personal things, in fact. Upon registration enter the email "les@dazik.com" as a referral email, earn me a good name!

Now that you have the hosting

You should have gotten a free domain upon registration (I told you they were awesome!), anyways go in your Dreamhost panel and scroll down to "Private Servers" on the left menu, then click "Enable DreamHost PS", go through the little setup and wait for the email that says its ready, once you get that go back in your panel and click "Manage Resources" to be sure its up, the first week of PS is free, thus they give you an absurd amount of ram to use for the first week (2300mb default), when that week is up, the slider is automatically moved to whatever you use, I out of habit just set it at 300 or 350 once I enable a new server (you can have as many PS's at a time as you want).

Add new user for the ps and subdomain

This first thing to do after your PS is ready is to create a new user for that server. On the left menu, click "Manage Users" and then click "Add a New User", setup the user any way you wish, just make sure it has "SHELL" ticked as its access, and the server on the dropbox set to your PS.

Example:

Click for Fullsize

Now that you have a user, set a sub domain to it.

In order to use your FTP to upload/edit files on the server you need to set a sub domain on the user, click the "Manage Domains" link in your DreamHost panel and click "Add New Domain / Sub Domain", fill out the information as I have it in my example image, make sure it is on the user you just made for the PS, and remember the "Web Directory" you set!

Example:

Click for Fullsize

Alright the hard parts done, now lets hop on putty!
Now you need to use an ssh tool, I use PuTTY, which you can find in the Downloads section of this site

Connect to your subdomain you just set and use the user we setup earlier, in the hostname, simply enter your sub. Once you click "Open" the connection will start, enter the username you made earlier, then it will ask you for your password, enter that as well.

Example:

Click for Fullsize

When done you will see a command prompt, type "ls" from there you should see a few folders, we want the one you made with the subdomain, so type "cd FOLDERNAMEHERE" to make it your current directory. From here, we install SRCDS (the engine that runs source servers), you can find the SRCDS tutorial on how to install here, for this tutorial I will also paste the instructions here.

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. For Team Fortress 2, use "tf".
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.

Now installing SRCDS is done! Lets make a auto-start script.

Without modifying or installing certain packages for nix, we cant use the screen script valve recommends in the install tutorial, for a stand-in I simply edited their use. Create a file either with command in shell or upload with FTP to your /srcds_1/orangebox directory, the file contents will be as follows:

screen -A -m -d -S server ./srcds_run -console -game tf +map ctf_2fort +maxplayers 32 -autoupdate -tickrate 100 +fps_max 500

Change this command line to your own needs, save as "start" and upload to the directory listed above.

Now in shell go to your orangebox directory

Commands

cd FOLDER (This represents the name you made in the subdomain, btw)
cd srcds_1
cd orangebox

After that type ls to make sure the file "start" is there, if so enter the command

chmod +x start

then proceed to run the script with

./start

Now that you have run the startup script, the server will start running.
NOTE: The best way to restart a server, or even stop it, is through the DreamHost control panel to restart your private server. (DH Only)

To find your server's IP, in shell type the command
/sbin/ifconfig | less
You will then see your server's IP listed next to "inet"

Congratulations, your successfully running a bare bones server off of a DreamHost PS!

If your server ever crashes, or doesn't show up on server list, you can restart it by going into ssh (putty), from the root of your user make FOLDER/srcds_1/orangebox your current directory (As I explained above) and then type ./start for the server to restart.

This method has no logging for the server errors other than what is logged in files, you cannot see the actual command window. Its a very primitive way to run a server, but its much cheaper and works sometimes just as well, keep in mind that DreamHost is located in LA, Cali. Thus any server you host, while on a gigabit line, is a west coast server.

Working FTP with your server

Connect to your subdomain as the ftp address, aka for our training server:
ftp.train.anarchy-99.net

User and password are same as the one for ssh (this is why we gave the user shell access!), from here have a ball. I will not explain how to install plugins and addons and all that, use google. The hard part is done, you can do the rest.

Conclusion

Thats really all you need for a basic server, recompiling kernels, plugins/addons, and other such things such as running a Control Panel for your server, you will have to figure out on your own, be prepared for some serious work in this adventure, if you so choose to go for it. Look out in the future for a basic Control Panel I am currently developing to run RCON in php for console, and to run scripts for restarting/editing server files. This panel will work on ANY web server running php 5. Again, not quite done with it, in the process of developing it for Anarchy 99.

Filed under: Tutorials 10 Comments

Lorem Ipsum – About

Posted: May 22nd, 2010

Well the site is basically finished, as I said before, this WILL be my blog (when and if i ever feel like wanting a blog), as well as my portfolio of work.
I've asked a few people to take a look and tell me if it looks okay, and everyone of them has told me that "it needs to be in english." or some variation of that simple statement. So, I decided to use this here post to explain what Lorem Ipsum is.

Lorem Ipsum is a placeholder, filler if you will. Web Designers and coders use it all the time to test what their creations will look like with content, thats all it is, no it doesnt mean anything, its mainly gibberish derived from Latin.

What is it?

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

As I said before, no it does not mean anything, only a few words of it are real and they generally have no meaning. I just wanted to get that in the clear, it sort of bothers me that nobody has any idea what Lorem Ipsum is, its been the standard for FIVE CENTURIES!

Where does it come from?

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

You can read all about it at Lipsum.com, thats where these quotes came from.

Filed under: General 5 Comments

Site Launch

Posted: May 21st, 2010

Well well, I needed my personal space so this will be used to monitor my current projects, my portfolio and generally my own blog.
So for now, lets have us some good ol' lorem ipsum! Whats a new site without it?

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi scelerisque, lectus sit amet scelerisque tempor, enim elit hendrerit urna, tempor facilisis odio sem sit amet arcu. Ut dictum augue ipsum, ac dapibus odio. Sed dapibus aliquet posuere. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer et diam nibh, ac suscipit magna. Cras et augue ut urna hendrerit varius. Donec vitae orci nec diam volutpat euismod sit amet ut mi. Nulla ornare turpis eros, a porta ligula. Sed rhoncus nulla ac dui rhoncus luctus. Aliquam a metus magna. Sed ac rutrum mauris. Praesent tincidunt eros id nunc rutrum sed vestibulum eros dictum. Sed accumsan malesuada dui, a sodales urna ullamcorper vitae.

Vivamus quam est, tincidunt sit amet consequat sed, interdum a quam. Nunc at erat eu metus imperdiet placerat eu bibendum arcu. Sed velit lorem, adipiscing condimentum molestie ut, fermentum iaculis ante. Nunc id mi nec arcu placerat posuere luctus a nunc. Nunc luctus orci in nibh bibendum in porta mauris feugiat. Nunc vel semper tortor. Quisque fermentum, dui nec volutpat laoreet, orci dolor molestie sem, vel malesuada neque libero nec erat. Nullam mollis sodales lacus, et dictum nibh tempor sed. Phasellus vel justo non dui venenatis scelerisque cursus non lectus. Curabitur sed pellentesque magna. Vivamus nec ultricies justo. Donec id purus ac turpis pulvinar dapibus id ut nunc. Fusce molestie sem eget sapien ullamcorper porta. Praesent arcu mi, cursus quis luctus at, tincidunt at mauris. Vivamus ultricies urna non lorem auctor commodo. In ac erat lorem, ut ultrices justo. Duis euismod ligula non diam pulvinar placerat. Duis viverra tortor sed dolor fringilla vulputate. Donec eu quam quam.

Donec in ligula pellentesque tortor tempus eleifend congue dignissim ipsum. Sed ac lacus ac ipsum semper lacinia. Morbi suscipit ultrices orci eget ultricies. Quisque massa dui, tristique ac luctus sit amet, ultricies eget nisi. Nam ullamcorper commodo aliquam. Aliquam mattis tincidunt felis at varius. Fusce et ipsum lectus. Curabitur dictum molestie faucibus. Nulla sed massa purus. Vivamus iaculis justo vitae neque ornare sed elementum dolor consectetur. Duis malesuada metus in turpis faucibus non viverra erat facilisis. Praesent tristique placerat orci, ullamcorper aliquam ipsum consectetur suscipit. Maecenas eget felis metus. Donec augue ante, auctor a hendrerit vel, elementum non risus. Suspendisse varius velit sed mauris gravida ac tempor sapien pellentesque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in lorem nisi, ac dapibus eros. In scelerisque, enim quis consequat porta, magna odio viverra massa, in sagittis dui sem ac ipsum. Proin ullamcorper consectetur dui, non lobortis lorem feugiat id.

Aenean mollis gravida massa in porta. Sed hendrerit mi sed ante eleifend aliquam. Donec a odio eget eros faucibus vestibulum quis vel turpis. Morbi porta mi ac sem condimentum quis dignissim tellus aliquam. Proin dolor lorem, euismod nec tempor non, fringilla non sapien. Nullam malesuada tincidunt felis ac consectetur. Curabitur aliquet congue enim, ut pellentesque nunc accumsan at. Mauris ullamcorper semper dignissim. Sed pharetra ullamcorper laoreet. Cras pulvinar commodo enim et gravida. Nulla ullamcorper sodales risus at ultrices. Aliquam lobortis magna non orci sollicitudin in tincidunt ligula fringilla. Donec convallis sem sagittis neque scelerisque tristique.

Donec fringilla aliquet nisi, sit amet ullamcorper tortor convallis sit amet. Ut non nunc a dui scelerisque porta. Proin imperdiet volutpat nulla, at laoreet ligula hendrerit vitae. Nulla ut sem ipsum. In pellentesque pharetra libero eu adipiscing. Mauris augue diam, varius ut porta mollis, condimentum at arcu. Nunc eu porta ipsum. Maecenas mauris lacus, interdum sed bibendum quis, rhoncus vel nunc. Maecenas et nunc nisi. Praesent vulputate neque et arcu fringilla imperdiet. Integer euismod mauris venenatis diam adipiscing facilisis. Suspendisse quis sollicitudin odio. Sed est libero, feugiat eu facilisis a, egestas non nulla. Nunc iaculis lorem a magna mattis venenatis. Ut euismod tempus libero sed faucibus. Quisque congue sollicitudin ipsum eu varius.

In bibendum sem ac arcu faucibus congue. Aenean condimentum interdum blandit. Curabitur ac velit sem. Curabitur lorem nulla, malesuada vitae volutpat nec, blandit eget turpis. Vestibulum dui risus, tristique tristique lobortis non, suscipit sed turpis. Proin congue ultrices dolor, ac adipiscing ipsum eleifend id. Nam interdum odio ac magna pellentesque tristique. In hac habitasse platea dictumst. Proin interdum rhoncus vulputate. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam arcu turpis, ultricies luctus volutpat quis, bibendum quis ligula. Phasellus ornare nunc at lacus mollis sed tempor lacus pharetra.

Vestibulum a ante ac nulla ultrices mattis. Phasellus ornare quam ac ante imperdiet gravida. Cras quis augue augue. Suspendisse lacinia justo in mauris adipiscing ut luctus dui imperdiet. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ut lorem ut orci vehicula placerat sit amet et odio. Aenean in massa a arcu tempor scelerisque non vitae mauris. In quam neque, sodales et posuere ut, mattis quis libero. Aliquam semper justo sit amet lacus placerat hendrerit. Duis aliquam semper fringilla.

Filed under: General No Comments