Google
 

Friday, November 23rd, 2007

Ok you have a website? You host it somewhere else such as godaddy.com or a free hosting service such as yahoo right? How about doing it for yourself? Apache is the number one web server on the internet right now. Go daddy uses it and so does yahoo. Why not you?


 

The setup of apache is really easy for windows; basically it is a wizard just like any other program that you install. Apache is a small program, allowing it to be run on very little system resources. I once ran apache on a Pentium 2 with 64mb of ram (this was back when I had no idea what I was doing, I had an old computer to play around with and decided apache would be a fun project). Now if you are planning on running dynamic content such as any PHP or CGI script or a wiki you will need a considerable amount of processing power. Much more than my old Pentium 2 processor. My recommendation based on my general knowledge is get anything greater than a Pentium 4, preferably anything over 1.5 GHz and anything over 1GB of RAM.

You can find more information on the apache web server at http://httpd.apache.org/ . When I wrote this article the latest version of apache was 2.2.6 (this is only if you want to build it yourself, I like it when they do the hard work for me so the pre-built .msi file is only in 2.0.59, sorry). They haven’t changed the install wizard much so it should be pretty similar to what I have here. You can download the server from any of apache’s official sources listed at http://www.apache.org/dist/httpd/binaries/win32. The zipped file is only 9MB.

Step 1: Download the file apache 2.0.59-win32-x86-no ssl.msi:

Apache Screenshot 1

Step 2: Open the .msi and prepare to install

Apache Screenshot 2

Step 3: Accept the license agreement. This is an open source program so there is no real worry, unlike accepting agreements from Microsoft.

Apache Screenshot 3

Step 4: This part of the screen is just some informational background, if you know nothing about apache it would be interesting to read, if not just hit next.

Apache Screenshot 4

Step 5: This part is where all the real work is needed. The first box asks you for your network domain. This is where you put your .com address. Leave out the www in this part because you’ll put that part in the next step.

Step 6: Next it asks for the Server Name this is where you would add the www on to your server domain. Now if you wanted to use another prefix for your website you would do that here, such as if you wanted to host blog.superboatx.com instead of www.superboatx.com then you would do that here.

Step 7: Next you will need to put in an e-mail address that will be shown when the server shows a 404 error or any other error. Remember this e-mail address will at some point be made public so don’t use an e-mail address that you wouldn’t mind giving out to strangers. The next step is to use apache as a Service or choose to start it yourself. Choosing the first one will start apache once you start your computer and have apache listen on port 80. Now the second one will require you to start apache manually and have it listen on port 8080. If you are planning on using this machine only for a server then choose the first one. If you are just testing out the server project then choose the second one.

Apache Screenshot 5

Step 8: Choose the typical installation. Once it is finished you want to open your browser and surf to localhost. You should see a page from apache telling you to replace this page in order to host your own page.

Apache Screenshot 6

Apache Screenshot 10

Great now you’re finished! Now let’s talk some administration of Apache.

The first thing we have to talk about is changing your web pages. Your home directory is C:\Program Files\Apache Group\Apache2\htdocs. The documents here are what you see when you surf to localhost. Delete those files and replace them with your website. Remember to name your home page index.html.

Apache Screenshot 11

The next thing to talk about is the new icon in your system tray. If you double click on it you get an apache administration tool. Basically this is just to start and stop the server. You’ll need to use this tool when you make changes to the configuration files or if you want to shut down the server without shutting down the computer.

Apache Screenshot 9

Now in order to make any changes to how apache works you will need to edit the httpd conf file. Now a lot of this file is going to be confusing. One very important thing to remember Apache reads ever single line of this file except the ones that have a # sign in front of them. The first thing I want you to notice is the line “Listen 80” (or “Listen 8080” if you choose the second option in step 8). This line tells apache to listen for requests on port 80 now if you want to change this so apache listens on another port just change the number, save the file, and restart apache using the last the tool in the last step.

Apache Screenshot 12

The next line I want you to look at is the Document Root line. This line controls where Apache looks for your website files. We talked about this earlier; the default is C:\Program Files\Apache Group\Apache2\htdocs. Now you can change this if you feel it necessary just remember to save and restart apache.

Apache Screenshot 13

There you have it! Open up your computer to the internet and see if it works. Make sure you point your domain name to your IP address. Then surf on over to your domain name. Now if it’s not working the first thing you need to look at is your firewall. You will need to open up the port you choose earlier in the article.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google


  One Response to “Apache Setup for Windows”


> Leave a Reply