logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: rather complex setup: root dir is IP > all domains Virtua
Author
shawngibson



Joined: 10 May 2007
Posts: 4

PostPosted: Thu 10 May '07 11:13    Post subject: rather complex setup: root dir is IP > all domains Virtua Reply with quote

Hi All,

With 2.0.59, I've a number of domains all resolved through one IP - they are each under htdocs/domain name - but the root itself (i.e. the IP which would be rooted at htdocs/) doesn't work...it also seems to be the cause of why my bundle (apache2triad) doesn't quite work for xmail now (a2t has proven itself very solid over the years under simpler setups).

Can anyone please let me know, maybe, why my code below in httpd.conf would disallow me access to 216.240.9.27 (and more importantly, 216.240.9.27/apache2triadcp, which is the admin console for the bundle) but DOES allow me acess to all the domains mentioned in the file below? I'm stumped:(

I can for some reason access localhost/apache2triad, but that doesn'thelp when I'm not at my server...which is most of the time.

#server config
ServerName shawngibson.com:80
ServerAdmin admin@shawngibson.com
#DirectoryIndex index.html index.php index.html.var index.cgiindex.pl index.htm index.php3 index.php4 index.shtml

NameVirtualHost 216.240.9.27

<VirtualHost 216.240.9.27>
DocumentRoot D:/Apache/htdocs/
ServerName 216.240.9.27
ErrorLog logs/216.240.9.27-error.log
CustomLog logs/216.240.9.27-access.log combined
# Other directives here
</VirtualHost>

<VirtualHost 216.240.9.27>
DocumentRoot D:/Apache/htdocs/shawngibson.com
ServerName shawngibson.com
ServerAlias www.shawngibson.com
ErrorLog logs/shawngibson.com-error.log
CustomLog logs/shawngibson.com-access.log combined
# Other directives here
</VirtualHost>

<VirtualHost 216.240.9.27>
DocumentRoot D:/Apache/htdocs/faceitphoto.ca
ServerName faceitphoto.ca
ServerAlias www.faceitphoto.ca
ErrorLog logs/faceitphoto.ca-error.log
CustomLog logs/faceitphoto.ca-access.log combined
# Other directives here
</VirtualHost>

<VirtualHost 216.240.9.27>
DocumentRoot D:/Apache/htdocs/mygallerysite.net
ServerName mygallerysite.net
ServerAlias www.mygallerysite.net
ErrorLog logs/mygallerysite.net-error.log
CustomLog logs/mygallerysite.net-access.log combined
# Other directives here
</VirtualHost>

<VirtualHost 216.240.9.27>
DocumentRoot D:/Apache/htdocs/counterchaos.com
ServerName counterchaos.com
ServerAlias www.counterchaos.com
ErrorLog logs/counterchaos.com-error.log
CustomLog logs/counterchaos.com-access.log combined
# Other directives here
</VirtualHost>


...thanks for any help,
Shawn
Back to top
shawngibson



Joined: 10 May 2007
Posts: 4

PostPosted: Thu 10 May '07 11:23    Post subject: oops Reply with quote

I am using Apache 2.2, sorry...not 2.0.

Shawn
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 10 May '07 20:11    Post subject: Reply with quote

You have mixed up name based vhosts and ip based vhosts. Apache work only with ip based or named based at one time, not both.
Back to top
shawngibson



Joined: 10 May 2007
Posts: 4

PostPosted: Fri 11 May '07 11:47    Post subject: Reply with quote

Thanks:) Since I only have one IP, and several domains (and one computer for use as a server), what would a best-practices approach involve to this, if I might ask? I'm a designer/photographer, been trying to struggle through the server-setup parts myself, so any advice would be appreciated.

Shawn
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Fri 11 May '07 13:36    Post subject: Reply with quote

An example setup would be

Code:

 NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>


Hope that helps! If not ask again!
Back to top
shawngibson



Joined: 10 May 2007
Posts: 4

PostPosted: Wed 16 May '07 21:49    Post subject: Reply with quote

That works perfectly, thank you so much! I even gained back my ability to access root-level (i.e., typically localhost) files externally (phpmyadmin etc.)...thanks again.

Shawn
Back to top


Reply to topic   Topic: rather complex setup: root dir is IP > all domains Virtua View previous topic :: View next topic
Post new topic   Forum Index -> Apache