PDA

View Full Version : Multiple Sites in Apache2



RyderOCZ
02-24-2006, 08:09 AM
Being very new to all things Linux, I am trying to wrap my head around the configuration of Apache to host multiple sites on 1 server.

I understand the layout and requirements of the various configuration files, for the most part, but I am having a hard time establishing exactly where those configuration files need to reside.

I have read this and understand it: http://httpd.apache.org/docs/2.0/vhosts/examples.html#purename
Where should that config file reside?

Do I only need that config file in say the sites-available folder with a symbolic link in the sites-enabled folder?
Is creating a config file for each site better?

Am I misinterpreting this and the above config needs to be somewhere else, then a separate config file for each website needs to be in the sites-available folder?

Thanks to all who can help :D

RyderOCZ
02-26-2006, 07:45 PM
Well, I figured it all out with some help from google, even though I didn't find anything out there that spelled out where the files had to reside or exactly what I needed to do. So hopefully this will help if someone needs it :)

In Apache2 the httpd.conf file has been replaced (sort of, you can still use it to be backwards compatible, but you have to use the "include" statement in the apache2.conf file)

With Apache2 you have the sites-available and sites-enabled folders inside the etc/apache2 folder. The sites-available has to have a config file for each site that you want to host on your server or one large file with all the sites defined, if you want it that way.

The sites-enabled folder needs a symbolic link to the appropriate config file in the sites-enabled folder, for every site that you want active. If you are using just 1 config file as I mentioned above, then you only need the 1 symbolic link, but every site in the config file will be active.

Its very easy to create the symbolic link. At the console prompt you just need to type "a2ensite" then a space, then the name of the config file in the sites-available folder that you want to enable and press enter. The link will be created automatically in the sites-enabled folder. :D:D:D