Unmanaged Hosting Server Installation & Initial Configuration for Dummies

Unmanaged hosting often comes with very competitive price compared to managed hosting environment, however, the drawback of which, is the steep learning curve for server noobs that unfortunately includes me. It’s meant for technically proficient ones after all.

This simple tutorial will walk you through the steps needed to set up a working web server that’s ready to serve websites from a bare bone Linux distro (Ubuntu, in this case). It serves to be a survival guide of unmanaged hosting for novice Linux server administrators while at the same time documents my findings and learned tips for myself.

We will take Ubuntu 9.04 (Jaunty) for example. Though all things are done at a Mosso 256 MB Cloud Server, 99% of them should work without a problem at other unmanaged hosting providers as long as the Linux distribution is identical. After this tutorial, you will have a working VPS or dedicated hosting server with update to date softwares and beginner security, in addition to necessary software packages to run and manage a LAMP web server: FTP, Apache 2, PHP 5.2.6 and MySQL.

Here we go. Suppose you have made the decision to go with one of the Linux distros of which I’d suggest Ubuntu and installed a plain version of it from the hosting control panel, now:

  1. You will be given a bare IP address, of course, when you have finished installing the Linux distro from the contrl panel provided by your hosting company. Download PuTTY and set it up to connect to your hosting server of that IP as the root via SSH. The root password should also have been revealed or emailed to you.
  2. Change the root password to a new one.
  3. Customize the default SSH listening port of 22 to a custom one.
  4. Build up necessary iptables firewall rules.
  5. Customize shell environment and make the prompt ls command listings a little more colorful so it’s more readable.
  6. Enable vi code highlighting (enabled by default in Ubuntu) and change the dark blue color for comments to a lighter blue.
  7. Update the software source lists in Ubuntu by:
    aptitude updateAnd set the proper locales:
    locale-gen en_US.UTF-8
  8. Upgrade the current distro to its latest:
    aptitude safe-upgradeFollowed by:
    aptitude full-upgrade
  9. Install the essential tools and packages for development, the build tools:
    aptitude install build-essential
  10. Install MySQL:
    aptitude install mysql-server mysql-clientThe installation will prompt you twice for the root password.
  11. Install Apache:
    aptitude install apache2 apache2.2-common apache2-mpm-prefork apache2-utils libexpat1 ssl-certChange server name in the Apache configuration:
    vi /etc/apache2/apache2.confAnd add the following directive at the end of the file:
    ServerName kingChange ‘king’ to whatever you’ll name your own server. For beginner SSH users, nano would be a better choice for its intuitive editing capabilities. After restarting Apache web server gracefully by not interrupting connected clients:
    apache2ctl gracefulYou should be able to view the demo web page at http://(your server IP address).
  12. Install PHP5:
    aptitude install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-imagick php5-mcrypt php5-memcache php5-mhash php5-mysql php5-pspell php5-snmp php5-sqlite php5-xmlrpc php5-xsl
  13. Turn off server signature:
    nano /etc/apache2/conf.d/securityAnd change:
    ServerTokens FullTo:
    ServerTokens Prod
  14. Change the hostname of your server. Open and edit /etc/hostname:
    vi /etc/hostnameTo a top level domain you have registered for your website. And add it in /etc/hosts:
    vi /etc/hostsIn this way:
    127.0.0.1 example.com
  15. Reboot by:
    shutdown -r now
  16. Install the mail module for your hosting server, Postfix, so the php function mail() works:
    aptitude install postfix telnet mailxJust choose ‘Internet Site’.
  17. Install FTP daemon service so you can FTP stuff to your server as any user.
  18. Install rsync so that you can easily synchronize and backup files between 2 remote hosting servers:
    aptitude install rsync

5 thoughts on “Unmanaged Hosting Server Installation & Initial Configuration for Dummies

  1. When you buy web hosting it can be easier to let the web host handle everything associated with this.

  2. That is a actually helpful blog site. Many thanks for sharing! I have put your RSS feed into my blog.

  3. You know, I would like it if there had been more blogs such as this one, I truly love this content published here

  4. Very informative post. Certainly a lot of useful information. Very happy I found your blog. Will note it and check back for more information.

  5. I personally simply want to express that We have realized your blog post very good! You have got much knowledge as well as details here that has helped us carry out our college essay!

Comments are closed.