Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bwan37

macrumors newbie
Original poster
Oct 12, 2012
5
0
Hi, I have my web server up and running with with TCP:80 all setup,
but now I have got another problem when dealing with virtualHost

here's my mission:
http://www.ben-wan.com point to /WebServer/benwan
http://www.irisecret.com point to /WebServer/irissecret

my problem.
http://www.ben-wan.com goes to /WebServer folder.

here's my actual config files....

#inside /private/etc/apache2/httpd.conf
ServerName http://www.ben-wan.com:80
DocumentRoot "/volumes/storage/WebServer"
Include /private/etc/apache2/extra/httpd-vhosts.conf

#inside /private/etc/apache2/extra/httpd-vhost.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName http://www.ben-wan.com
ServerAlias *.ben-wan.com
DocumentRoot "/WebServer/benwan"
ServerSignature Off
# ErrorLog "/WebServer/benwan/log/ben-wan.com-error_log"
# CustomLog "/WebServer/benwan/log/ben-wan.example.com-access_log" common
<Directory "/WebServer/benwan">
Options Indexes FollowSymLinks SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
<Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName http://www.irisecret.com
ServerAlias *.irisecret.com
DocumentRoot "/WebServer/irissecret"
ServerSignature Off
# ErrorLog "/WebServer/benwan/log/irissecret.com-error_log"
# CustomLog "/WebServer/benwan/log/irissecret.example.com-access_log" common
<Directory "/WebServer/irissecret">
Options Indexes FollowSymLinks SymLinksIfOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
<Directory>
</VirtualHost>

#inside /private/etc/host/hosts
127.0.0.1 ben-wan.com
127.0.0.1 irisecret.com

Can someone give me a hand in solving this problem.
Thanks a great deal.
 

assembled

macrumors regular
Jan 12, 2009
116
0
London
you've given the default server the same host header

here's my actual config files....

#inside /private/etc/apache2/httpd.conf
ServerName http://www.ben-wan.com:80
DocumentRoot "/volumes/storage/WebServer"

try

#inside /private/etc/apache2/httpd.conf
ServerName webserver
DocumentRoot "/volumes/storage/WebServer"
 

bwan37

macrumors newbie
Original poster
Oct 12, 2012
5
0
I have changed http://www.ben-wan.com to webserver
but may I know what this does?
cause I try typing http://webserver but it return "cannot find server webserver"

can I put in "ServerName 127.0.0.1:80" instead?

"btw, problem solved for this code..

<VirtualHost *:80>
....
<Directory "...">
...
<Directory> <---- Need to close this...
</VirtualHost>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.