This is my attempt at guiding new webmasters (like myself) through the setup process of setting up a simple web server for friends and family (and possibly, with a little bit of creativity on your side, a full-blown web host like those you usually pay for). I will provide commands to execute in the Linux terminal, the programs needed, and some programs that I would highly suggest.
As a prelude , I want to make sure that this tutorial is something that you feel that is right for you. The following are the steps that I personally took to get my “Hildreth Server” up and running (no longer active). Now, the Hildreth Server is just a very simple website with two pages: 1.) a main page with links to various locations of mine (including the actual files on my computer), and 2.) a home page that serves as an “About” page. This is essentially what I will be walking you through how to do. Here’s a screenshot of what I’m talking about:

So, let’s get started. It may initially appear to be daunting and hard, but stick with it… it’s not bad at all. Also, another caveat to consider is that this was done in Fedora 8 Linux, so your flavor of Linux may be just a little different but the principle is the same.
Equipment Needed:
- A High-Speed Internet Connection.
- A Modem or Router Capable of Port Forwarding.
- A Linksys router would probably be the best suited.
- A computer with:
- A Linux Operating System
- At least 256MB RAM (my suggestion, probably could do with less).
- A working internet connection.
Procedure:
1.) Install the software:
The following command will install the programs needed for HTTPD (PHP enabled) called Apache and PHP. These programs are the heart of the web server. Just type or copy/paste them into the terminal.
yum install php httpd system-config-httpd mod_ssl
chkconfig httpd on
service httpd restart
The configuration of the web server by default will be fine for most users, but if you’d like to make it your own, the files are located here:
/etc/php.ini
/etc/httpd/conf/*
/etc/httpd/conf.d/*
2.) Setup port forwarding in router:
This step is probably the most important. Basically, it will route all incoming web server requests to the correct computer by forwarding port 80 using both TCP and UDP protocols to the IP address of your computer (web server). I’m not going to explicitly list all instructions in this tutorial, but I will lead you to a great guide for the popular routers:
Linksys WRT54G Router
Netgear WGR614NA Router
D-Link WBR-2310 Router
Belkin F5D7230-4 Routers
All Other Routers (with some modems)
If you choose this link, you’ll have to first select your router model number from the list, and then choose “HTTP” from the list that follows.
3.) Setup firewall to allow HTTP (Port 80) traffic:
In Fedora 8 Linux, this port is blocked by default and needs to be opened. Goto System -> Administration -> Firewall. You will be asked for you password to run as a privileged user (root). Once you’re here, scroll down and find the HTTP entry and put a check mark next to it to allow HTTP traffic through (as show below).

4.) Test to see if port forwarding has worked:
This is an important step as well. Goto the “CanYouSeeMe” port checker by going to http://www.canyouseeme.org and in the “What Port” box, type in “80″, and click “Check”. You should see a message that states
“Success: I can see your service on <your ip address> on port (80)”.
If you don’t, go back and check that 1.) you have the HTTP service enabled and running in the background by going to System -> Administration -> Services and look for “httpd”, 2.) the correct ports are forwarded to the correct IP address of your computer and they are enabled, and finally, 3.) make sure your firewall has allowed HTTP traffic.
5.) Test the server (Apache) by visiting your external IP address:
Goto www.whatismyip.org and get your IP address. Then copy/paste it into your browser (Firefox) and see if you get the default Apache test page. If you see something similar to the following screenshot, then you’ve gotten your web server setup properly!

6.) Setup a dyndns.org account:
Your internet connection is probably setup with a dynamic IP address, meaning it’s going to change eventually. When it changes, there is no way to get to your web page without knowing what your IP address is (unless you’re really good a guessing IP addresses). So, a service that will track your IP address and give your website a domain name is very handy. This is where dyndns.org comes into play.
Goto http://www.dyndns.org and register for a new account. Once you have created an account and you’ve signed in, you’ll want to click on the “My Services” link on the left followed by the “Host Services” link. This is where you’re going to add services, so add one by clicking on “Add New Hostname”. You’ll see something similar to this:

This is the fun part because you get to choose what your web address (URL) is. I chose sendderek.dyndns.org because it’s easy for me to remember. Choose what you like in the “Hostname” field. The only other thing you need to change is the “IP Address” field by clicking on blue link that states “Use auto detected IP address xx.xx.xx.xxx“. That’s it for that part. For the next part, you’ll want to setup your router with dyndns.org (may not be supported on all routers).
The reason you want to get dyndns.org setup with your router is that when your IP address changes, your router will notify the dyndns.org service of the new IP address so that dyndns.org can change it. On a Linksys router, the option is under “Setup -> DDNS”. Choose the DynDNS.org service and then enter in your account information. Pretty simple.
7.) Setup the web pages:
Congratulations! If you’ve gotten this far, you officially have a self-hosted website! Now, to add some content and some fancy HTML pages! Maybe even a wordpress.org blog of your own or an e-commerce business selling stuff. If you’re going to be trying to sell some stuff though, I would recommend you purchase a domain name that people can associate with. Either way, the folder to put your content into is located on your file system at /var/www/html/. Just be sure to name the main page “index.html” and then add pages from there.
And if you don’t have any experience with HTML programming or website design, I would suggest grabbing a nice template from somewhere of your choosing. I highly suggest using Open Source Web Design for such a purpose. I used the template called “Deep” by Vacant for the Hildreth Server.
If you’re going to use a template, you’ll have to make it your own somehow with links that actually lead to places on your website. So, use an HTML editor to do just that. I used bluefish which is an excellent editor for several web development languages. Unfortunately, it’s not a “What You See Is What You Get” (WYSIWYG) editor. If you’re just starting, you’ll probably want something like that. I suggest NVU or Kompozer (both of which are very closely related) for just that. Personally, I like Kompozer better because it’s easier to install for Fedora 8.
Have fun with it! It’s your website… do what you want to do with it! You website address is whatever you created in your dyndns.org account, so visit it in Firefox (or your browser) to see what your site looks like.
8.) Optional: Setup a symbolic link to local directories:
On the Hildreth Server, I allow my family and friends direct download access to my pictures and music directories. In order to do this, I created a symbolic link in my /var/www/html/ directory by using this command in the terminal:
ln -s [source] [destination]
For example:
ln -s ~/pictures /var/www/html/pictures
9.) Optional: Install the AutoIndex script code:
I found AutoIndex (by Justin Hagstrom) when Google searching for a way to present my pictures directory in a more user friendly manner with thumbnails and a way to download an entire folder rather than just a picture at a time. This script does more than just thumbnails and folder downloads though. Explore it and find out what it’s capable of. Just install it into the directory that you want to share. Here’s the link:
http://autoindex.sourceforge.net/
10.) Optional: Setup a password for your directories:
I chose to use this step for personal reasons. You may or may not want to use a password to lock people out, but I suggest it. There are two files that control the password. One is called httpd.conf and the other is .htpasswd. The file httpd.conf has already been created and is located in the /etc/httpd/conf/ directory. The other file needs to be created by you and placed into the directory you want to protect. An easy way to do this is to type these commands into the terminal:
touch .htpasswd
Give it a password by using the htpasswd command where “guest” is the username you would like:
htpasswd -c .htpasswd guest
You can add more users as well by using the same code.
Then, you’ll need to setup the httpd.conf file. Open the httpd.conf file by using the command
sudo gedit /etc/httpd/conf/httpd.conf
and then add these lines to the bottom of the document after the last line (replacing the text in red with the directories and description according to your directory structure):
<Directory “/var/www/html/pictures“>
AllowOverride AuthConfig
AuthName “Are you privledged for pictures?“
AuthType Basic
AuthUserFile /var/www/html/pictures/.htpasswd
AuthGroupFile /dev/null
require valid-user
</Directory>
11.)
11.) Enjoy!
That’s it! You’re finished. Try it out on a computer outside of your network and see that it works! Also, if you like to tinker, there are some good guides about optimizing your new Apache server through this link and this other link.
I have also written a couple of other tutorials on how to take advantage of the new web server:
Sources: Fedora Forums (by firewing1)
Tags:
apache,
fedora 8,
free,
http,
life hack,
Linux,
self hosted,
tutorial,
web server