[Português]
 [Home]
 [Back]
 [Help]

Ricardo's Home Page
Install Apache Server


 Java
 Links
 Programs
 Info
 Guestbook
Apache server is currently the most widespread web server in the Internet.
The reason for that success must be related with the fact that:
1. It is free.
2. It is extremely fast.
3. It is extremely reliable.
4. It is highly expandable.

In fact, most of the developers of Apache are also their users, that contribute voluntarily with correction, and improvements ("Patches") to make it a stronger product every day.
Facing this facts, it's hard not to like Apache, and that's the reason I choose it.

Installing and Apache Server is not a difficult task.

1. Get the distribution.
Of course.
You can get it directly from the Apache Software Foundation.
From the main page follow the link to the "Apache Servers".
Now you must follow the Download link.
Choose the most appropriate version to you (probably apache_1_3_9_win32.exe).

2. Install it.
Once you have downloaded the file, you only have to run it.
It will ask you what type of installation you want.
I always choose Custom so that I can install all the sources. I like to take a look at the code every now and then.
If you don't have restrictions with your disk space, I suggest you do the same.
And please, do me a favor. Choose a different directory than the default "C:\Program Files".
I always choose "D:\bin\Apache". It's easier to write and I don't get my Apache mixed up with all the crap that end up in the "C:\Program Files" directory.

3. Prepare it to run.
After finishing all the installation steps, Apache Server is ready to run.
Nevertheless we are not starting it before some final touches.

If you have another web server in your machine.
Check if you have another web server installed and running in your machine.
If you have, a conflict may arrive if both servers try to use the same port.
The default port for the HTTP protocol, is port number 80. Apache is configured by default to use that port.
If you have, say Internet Information Server installed and you don't want it to be your default server any more you must use the "Start/Programs/Internet Information Server (comum)/Internet Service Manager" program to change the port it uses.
Double click the little PC in the line pointing to WWW Service and change the TCP Port to other number.
The port number 8080 would be a great choice as this is usually the secondary HTTP port.
Apache comes with all its documentation in HTML format ready to be served.
If you have your own pages to share you might want to point apache to your own pages instead of its own manual pages.
To point Apache to your own pages you must edit the "httpd.conf" file.
You will find it in the directory "conf" under the directory in witch you installed the Apache Server (in my case it would be "d:\bin\apache\conf\httpd.conf").
Change the directive DocumentRoot so that it points to the directory where you have your pages.
Please be sure to change DocumentRoot and NOT ServerRoot.
Ten lines or so after that you will find something like <Directory "d:/bin/Apache/htdocs">.
Change it to point to the directory where you have your own pages.
Now that you are editing the "httpd.conf" you can change ServerAdmin variable.
You can put your email there if you like.
If you were using Internet Information Server you may want to change the DirectoryIndex so that it looks like the following:
DirectoryIndex index.html index.htm default.htm Index.htm Default.htm

If you don't have any other web server in your machine.
You might want to add a new directory to keep the examples you get from this page.
Let's say you want to put your examples in the directory "d:\wwwroot".
You must add a line to the httpd.conf file like this.
Alias /www/ "d:/wwwroot/"
That way, any time you ask for an url like http://localhost/www/ or http://127.0.0.1/www/ the apache server will present you with whatever you put in the directory "d:\wwwroot" (and witch name is index.html of course).
Finally, we want our Apache Server ready whenever we turn on our machine.
To do that, open a command prompt, go to the directory where you installed Apache (in my case "d:\bin\Apache") and run the following command


D:\bin\Apache>apache -i

The result should be:


D:\bin\Apache>apache -i
Installing the Apache service to use d:/bin/apache/conf/httpd.conf
The Apache service has been installed successfully.

3. Test it.
We've done it.
Now let's start the server by entering the "NET START APACHE" in the command line:


D:\bin\Apache>NET START APACHE
The Apache service is starting.
The Apache service was started successfully.

Now you can launch your browser and write the following URL: http://127.0.0.1/

Depending on the configuration you choose, you will get the default main page of the Apache Web Server, or your own pages.
Now you can test your own directory http://127.0.0.1/www/

You will get an empty directory or whatever you did put in the "d:\wwwroot" directory.

Enjoy your Apache Web Server...

Note:
If you find some difficulties in this procedure, you can find an excellent FAQ (Frequently Asked Questions) in the Apache Software Foundation or you can ask me for help by e-mail (in the bottom of this page).
In any case, before you do any of that, please double check all the steps and be sure you are not missing anything.


Last update:
2000/01/25
This page hosted by
Get your own Free Homepage
Prepared by:
Ricardo Lindengrün

Click Here!