Since Cloud Hosting seems to be all the rage these days, and given the fact that I’ve basically outgrown my host (Thanks guys!), I decided to set up a Virtual Private Server (VPS). Rather than just having all the fun by myself, I decided to document the process on how to “Build your own cloud”.These guides assume you have basic vi knowledge.
If you’ve already done Part 0, it’s time to set up some GUI. Not everyone likes typing into terminals and copypasting obscure commands from guides. Luckily, ISPConfig, Webmin and cPanel let you bypass that and go for a Web UI. I sided with Webmin, if the blog’s title wasn’t clear. Now before you come yelling in my general direction how vulnerable Webmin is:
I know, I suffered from an attack the first time I set it up, and I will include… precautions… on how to avoid this if possible.
Step 0: Set up the Webmin Repo. It’s pretty self-explanatory, follow their guide and paste their Repo Config into /etc/yum.repos.d/webmin.repo, import their GPG key and yum install webmin.Webmin runs on port 10,000, so fire up a browser and point it to http://your-ip:10000 and you’ll be prompted for your root password.
Step 0.5: Depending on your server configuration, port 10,000 might be closed or open. In my case, it was open. If it isn’t, system-config-firewall-tui can help you out. You can navigate with Tab to switch fields, and Enter to select them, so click on Customize, then make sure SSH remains enabled (as well as any other ports you might want in the future, like port 80). Now go to forward, click on ‘Add’, and on Port, add 10000, on Protocol, TCP. Once you’re done, click on OK, then Ok again.
Step 1: The first thing you probably want to do once you log into Webmin is get rid of the hideous theme. My favorite one is Stress Free, and if you like it, tip the author. To install the theme, simply navigate to http://your-ip::10000/webmin/edit_themes.cgi (Or click on Webmin on the menu, then click on Webmin Configuration, and click the Themes icon), then click on Install, and choose your method of installing the theme. I used the “From FTP / HTTP” box and it worked. Don’t forget to select it by going to Change Theme, and clicking on Stress Free on the dropdown box, and saving.
Step 2: Secure the area. Go to Webmin Configuration again, and click on IP Control. I set it up so that I could only connect from localhost, and my current IP. If you’re wondering what happens if I change my IP, I can simply do an ssh tunnel
ssh user@server -L 10000:localhost:10000
With this, I can open my browser, and point it to http://localhost:10000 and the magics of ssh will load the server’s webmin as if it were running locally.
While at it, on Webmin Configuration, there’s an SSL Encryption icon, click on it and enable SSL Encryption. The defaults should probably work for you. You’ll have to use https://localhost:10000 (or https://your-ip:10000 if you don’t need to ssh tunnel your way in) once you enable that.
Step 3: Set up your modules. If by this point you don’t know what you want your server for, you’ve failed as an admin. To install new modules, just go to Webmin Configuration, click on Webmin Modules, and Install from standard www.webmin.com. There’s a button with … on it, click it and a popup will show up. Just type in the name of the module you want to install on the textbot before the … and click on Install Module.
Personally, I installed proftpd for FTP, apache to configure a web server, bind8 to configure name servers (so your-domain.com can point to your server), mysql as a database, and squid as a transparent proxy. More on this later though.
I’ll write about Webmin part 2 in a few hours, as I continue to tweak and install things on my server. In the mean time, Webmin’s official documentation is pretty easy to understand.