ADD website domain name to httpd.conf

Started by apacheman1, November 01, 2015, 02:18:41 AM

Previous topic - Next topic

apacheman1

Hi.
I have WAMP. Can you please let me know how to add in a website by domain name to the config file to have it fire over http//www.example.com?

Also is it possible to point to the root of the webdomain files instead of document root pointing only to var/www?
I would like the config file to point to c:/example folder and any subfolders.

Thank you so much!

Gregg


Gregg

Nevermind, it's 2.4.someting  :-[

If you only have one website on the server you can just change ServerName to your FQDN and point the DocumentRoot to wherever you want. Just remember to change the existing <Directory path/to/someplace> also.

If you want to keep the existing site and add a new one you use VirtualHosts. The first virtualhost should be a minimal config of the main host (in httpd.conf). If the DocumentRoot in httpd.conf is say c:\Apache\htdocs the, first VirtualHost would be;

<VirtualHost *:80>
DocumentRoot c:/Apache/htdocs
</VirtualHost>

Then you start adding any other sites you want;

<VirtualHost *:80>
ServerName www.example.com
DocumentRoot c:/somewhere/else
<Directory c:/somewhere/else>
Options whatever-options-you-want
AllowOverride whatever-overrides-you-want
Require all granted
</Directory>
</VirtualHost>