Named Virtual Hosts on Apache on OS X 10.5 -Apache 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
I am new to Os X adn Apache. I have httpd running and would like to establish virtual hosts on my laptop for testing/learning.

I have done the following for virtual hosts "main" and "alternate"

Added to /etc/hosts:

127.0.0.1    main.localhost
127.0.0.1    alternate.localhost

Original htdocs known as Documents was in /Library/WebServer/

I have added:
   for "main"  :  /Library/WebServer/main/Documents
   for "alternate" : /Library/WebServer/alternate/Documents

in /etc/apache2/extra/httpd-vhosts.conf I have this

NameVirtualHost *:80

<VirtualHost *:80>
  DocumentRoot  "Library/WebServer/main/Documents"
  ServerName    main.localhost
</VirtualHost>

<Virtualhost *:80>
  DocumentRoot "Library/WebServer/alternate/Documents"
  ServerName  "alternate.localhost"
</VirtualHost>

The line
"Include /private/etc/apache2/extra/httpd-vhosts.conf" has been uncommented.

In httpd.conf
  DocumentRoot "/Library/WebServer"

  <Directory "/Library/Webserver">
      . . . .
  </Directory>


Also I note that there are two httpd.conf files. One in /etc/httpd and the other in /etc/apache2/. I am not, at this point sure which is used, so I have edited them to be identical.


So, my question:
1.  Is /etc/hosts correct or should it be
     127.0.0.1  main etc.
2.  Is httpd-vhost.conf set up corectly?

TIA

Bob Hartung

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux