Results 11 to 20 of 44

Thread: HOWTO: Setup an Apache Web Server For Free ($0)

Threaded View

  1. #1
    Join Date
    Mar 2006
    Beans
    2,417

    HOWTO: Setup an Apache Web Server For Free ($0)

    So here's what I did to get an Apache Web Server running in my house. I setup a very basic but totally cost-free server. Note: This guide is not for setting up LAMP servers (Linux, Apache, MySQL, PHP/Perl/Python), as I didn't need to run a database or scripting for my small website, so all we're using here is Ubuntu Linux and Apache Server.

    1. Install the latest Ubuntu Server Edition on the computer you're setting up as a server. Make sure to not select anything in the software selection screen (where it asks if you want to install a LAMP server, an Email server, etc.), unless you know what you're doing.

    2. Now go to http://dyndns.com and make an account; I signed up for the Dynamic DNS service (because it's completely free) and made a hostname (my personal URL). Free hostnames cannot be top-level domains, such as yahoo.com, but you can make one like mydomain.dyndns.org

    You may already have a hostname; in that case, you might want to sign up for the Custom DNS service, or also if you want to buy your own top-level domain (for example mydomain.com instead of a lower level domain such as mydomain.dyndns.org). All the information you need to set up all the DynDNS stuff is at their website.

    3. Log into your server, and install Apache and the DynDNS client:
    Code:
    sudo apt-get install apache2 ddclient
    If you don't know what to put for certain dialogs, just go with defaults.

    Now you have to restart the ddclient:
    Code:
    sudo /etc/init.d/ddclient restart
    4. Open a web browser on another computer, type your router's IP address into the address bar (usually 192.168.1.1 or something similar - look in your router's manual if not sure). You might need to give it a password to log in (the most common default is admin).

    You will need to change a few settings, including port forwarding port 80 to the static IP address that you're going to give your server (use the alternate ports 8080 or 8090 if you know that your ISP blocks port 80 by default).

    You also have to make sure that the DHCP address range of the router does not conflict with the future static IP address you'll assign your server. That means that if your DHCP hands out IP addresses starting at 192.168.1.100 till 192.168.1.110, then you'll want your static IP address of your server to be somewhere above that, like 192.168.1.125

    If there is a DynDNS setting in your router (linksys has one, it calls it DDNS) then you should put your DynDNS account settings there.

    5. Now we'll set the server to have a static IP address (assuming you went with 192.168.1.125 and that your router's IP address is 192.168.1.1):
    Code:
    sudo nano /etc/network/interfaces
    and change
    Code:
    auto eth0
    iface eth0 inet dhcp
    to
    Code:
    auto eth0
    iface eth0 inet static
    address 192.168.1.125
    netmask 255.255.255.0
    gateway 192.168.1.1
    Then restart the network process:
    Code:
    sudo /etc/init.d/networking restart
    That's it! Now your server has a static IP address.

    6. If your ISP blocks port 80, then you have to change the default Apache config file:
    Code:
    sudo nano /etc/apache2/ports.conf
    Change the 80 to either 8080 or 8090, depending on which port you forward to your static IP address in your router settings. If you do this, you must restart Apache:
    Code:
    sudo /etc/init.d/apache2 restart
    7. If your ISP blocks port 80, and if you chose your alternate port to be 8080, then your URL has to change accordingly; hence a sample host name you would make in dyndns.com could be name.home.dyndns.org:8080 (notice how you have to put a colon and the appropriate port number after the default URL).

    In dyndns.com, you can use their "webhop" service (also free, just make another hostname) to redirect the host name you have (with the :8080) to a nicer looking one. For example, you could tell people your URL is name.dyndns.org but it redirects to the one with the :8080.

    You can also "cloak" your website so that when you redirect, say, name.dyndns.org to name.home.dyndns.org:8080, it still shows name.dyndns.org in the address bar; the only bad thing about this is that you'll be stuck with a DynDNS banner at the top of your website.

    8. Reboot, just to make sure everything is okay:
    Code:
    sudo reboot
    and try going to your URL in a web browser, it should load instantly. 8) Also try checking if your website shows up on a computer outside you local network, to see if it is actually visible on the World Wide Web, and not just your LAN. This can also be done by typing your URL in a proxy server, like this one: http://www.freeproxyserver.net/

    9. (optional) If you want to easily transfer files from your windows box to your ubuntu server, use this guide: (it worked for me) http://ubuntuforums.org/showthread.php?t=202605

    This is great for updating your website files in /var/www.

    Thanks to everyone who helped me with all of this, especially p_quarles, dfreer, and crashmaxx.
    Last edited by user1397; March 22nd, 2011 at 07:44 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •