Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 12, 2012, 04:25 AM   #1
bwan37
macrumors newbie
 
Join Date: Oct 2012
Question about NameVirtualHost

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:
www.ben-wan.com point to /WebServer/benwan
www.irisecret.com point to /WebServer/irissecret

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

here's my actual config files....

#inside /private/etc/apache2/httpd.conf
ServerName 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 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 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.
bwan37 is offline   0 Reply With Quote
Old Oct 12, 2012, 05:13 AM   #2
assembled
macrumors regular
 
Join Date: Jan 2009
Location: London
you've given the default server the same host header

here's my actual config files....

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

try

#inside /private/etc/apache2/httpd.conf
ServerName webserver
DocumentRoot "/volumes/storage/WebServer"
assembled is offline   0 Reply With Quote
Old Oct 12, 2012, 07:57 AM   #3
bwan37
Thread Starter
macrumors newbie
 
Join Date: Oct 2012
I have changed 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>
bwan37 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:25 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC