/* UberLinux - Procedures - Apache */
Welcome to storm.uberlinux.org
Linux Mandrake release 7.0 (Air)
Kernel 2.2.14-15mdksecure on an i586
|>Apache Web Server v1.3.9 www.apache.org
This procedure will outline the steps necessary for setting up a basic Apache web server. This example will use my host IP address of 184.108.40.206 and domain names of uberlinux.net, uberlinux.org, and yeepa.com. There are other ways to setup Apache in local networks and the like but I will not be covering that here.
The first step will be to add your domains in DNS to point to the server that will host the sites. In my case, I added my domains uberlinux.net, uberlinux.org, and yeepa.com to point to the IP 220.127.116.11 which is the address of this computer. I am not currently running DNS on this machine so the configurations were placed elsewhere. Now, every request that comes in for the aforementioned domains will be directed here. This is assuming that you have entered the correct nameserver(s) with your domain registrar.
The file that needs to be configured is httpd.conf. On my Mandrake 7.0 and Red Hat 8 boxes this file is located in the /etc/httpd/conf directory. On my Sun Solaris 8 servers it is located in the /etc/apache directory. Accessing the files is easy. Simply type cd /etc/httpd/conf to go to the directory and open the httpd.conf file to edit the configuration. You will need to know how to use text editors such as vi or emacs to do this from the command line.
For most sites, the default settings in Apache are more than adequate. A couple of directives of interest are ServerAdmin and DocumentRoot. The ServerAdmin directive specifies the email contact in case of a problem. I have mine defaulted to root and have created an alias for my user account to receive all root messages. The DocumentRoot directive specifies the directory in which your main web files are located. I have left this as is for my system. If someone goes to storm.uberlinux.org or my IP address they will see the default apache page. I have placed all of my domain web files in a root directory www/. If you do it this way you must create the directory as root. You must also set ownership privileges. Here is what I did in detail.
Now I can write to these files from my user account. The next step is to setup virtual hosts to point incoming requests for domains to the proper directory where the web site files will be stored. In this example, all files for site www.uberlinux.org will be placed in the /www/uberlinux directory and all files for site www.yeepa.com will be placed in the /www/yeepa directory. There are two main ways to handle this. IP-based virtual hosts and name-based virtual hosts. Prior to Apache release 1.3.13, named-based virtual hosting was not available. Some older clients are also not compatible with name-based virtual hosts. I have elected to go with name-based virtual hosting. The main reason for this is the fact that IP address' with IPv4 are becoming more of a commodity within larger networks. For example, our ISP has an IP-based virtual host web server and it uses well over 100 IP addresses for all of the sites it serves. With name-based virtual hosting all of the sites would use just one!
Setting up virtual hosts is very simple. Here is what I did in detail. All directives were added at the bottom of the httpd.conf file.
|After entering the configurations save and exit. The httpd daemon which runs Apache can be started by running apachectl. On this system the location is /usr/sbin/apachectl. Simply type the path and command /usr/sbin/apachectl start to begin the web server. That is all there is to it!|
Last login: Thu July 17 16:06:33 from uberlinux.org
Hello. Welcome to Storm!
home/ procedures/ stories/ archive/ links/ portfolio/ about/
Copyright © 2003-2006 uberlinux.org