huanix

chown -R huanix /

huanix header image 2

Setting up hosting for several websites at home using one IP

November 18th, 2006 · No Comments · Apache2, Server, Xubuntu

These general directions should give you a “big idea” on setting up multiple website hosting from a single IP. This whole endeavor costed about $50 .. i picked up a junked old Dell and put some spare hardware in it, and i paid to register a few domains. I thought I’d document my steps for my reference and your benefit.

  1. Put some hardware together; I don’t have specific reccommendations here, except that you should use a dedicated computer. It doesn’t have to be powerful, but you may need to upgrade if you begin serving a lot of traffic (not likely in my case).
  2. Secure a copy of Linux; I prefer Ubuntu lately, for my server I use a version called Xubuntu http://www.xubuntu.org . Until you become a “pro”, you’ll want to install a desktop version, not the Server Install. (It’s easier to add server software than it is to add a GUI)
  3. After installing Linux, you’ll also need to add server software. Apache is the defacto standard for servers. If you installed Ubuntu (Xubuntu), you can add Apache2 through the Synaptic Package Manager , to get Apache from the Apache Software Foundation (ASF) – http://www.apache.org . The folks at the ASF develops a lot of neat stuff, you’re looking for the HTTP Server .
  4. Register your domain(s) – http://www.aitdomains.com
  5. Estabilsh NameServer management – http://www.zoneedit.com
  6. Go back to the registrar to modify nameservers to point to your IP.
  7. Poke a hole in your Router/Firewall. You only need one small hole for Port 80 (called the HTTP port). This step will open up your server to respod to calls to your IP (and URL’s). This is where the idea of “acceptable risk” starts. When you open up port 80 people who access your server will have access to something called your “Document Root”, typically /var/www/. Now is when you become just a little more paranoid about your permissions and security.

Now you have to modify your VirtualHost settings in Apache2 to get the sites to respond properly. This is easier if you know in advance that the URL is actually being directed to your server – something I didn’t do in advance. Here are some tips:

    • In Apache2, you edit a file called Apache2.conf to get your server running properly. This file has a call to include the Virtual Hosts directory- it’s at the bottom of /etc/Apache2/Apache2.conf, and it looks like this:
          • # Include the virtual host configurations:
          • Include /etc/apache2/sites-enabled/[^.#]
              • The sites-enabled directory has a link called default-000 that leads to the ACTUAL Virtual Host file, /etc/Apache2/sites-available/default
              • The easiest thing to do is copy the entire entry, and make one paste for each Domain you want to host.
              • The only things you HAVE to change in each entry are “ServerName www.example.com” and “Document Root /var/www/example” – here, you will create a main folder to host each individual site.
              • This is THE page to describe Name Based VirtualHosting on Apache2: http://httpd.apache.org/docs/2.0/vhosts/examples.html
              • One key to remember is that you should put your hosts in order of your expected traffic. The top should be the site you expect to receive the most traffic.

            Tags:

            No Comments so far ↓

            There are no comments yet...Kick things off by filling out the form below.

            Leave a Comment