The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Pages: [1]   Go Down

Author Topic: ADD website domain name to httpd.conf  (Read 3855 times)

apacheman1

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
ADD website domain name to httpd.conf
« on: November 01, 2015, 02:18:41 AM »

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!
« Last Edit: November 01, 2015, 03:11:13 AM by apacheman1 »
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: ADD website domain name to httpd.conf
« Reply #1 on: November 01, 2015, 07:38:46 PM »

What version of Apache is it.
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 847
Re: ADD website domain name to httpd.conf
« Reply #2 on: November 01, 2015, 09:28:29 PM »

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>



Logged
Pages: [1]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13