Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 Virtual hosts
Google
Post new topic Reply to topic
Author Message
daaamir
 
 


Joined: 19 Dec 2006
Posts: 10

PostPosted: Sat Dec 23, 2006 3:54 pm Reply with quoteBack to top

I'm having trouble with virtual hosting.
Eg. I want to point http://mos.ath.cx to c:/apache2triad/htdocs/folder1
and http://mos1.ath.cx to c:/apache2triad/htdocs/folder2
I've studied virtual hosts but i'm confused, so if anybody could show me example i would most appreciate it.
Thanks!
View user's profileSend private message
dale
 
 


Joined: 11 Jun 2006
Posts: 51
Location: las vegas, nv

PostPosted: Tue Dec 26, 2006 8:45 am Reply with quoteBack to top

This might help.

NameVirtualHost 192.168.0.1:80


<VirtualHost 192.168.0.1:80>
ServerAdmin support@ath.cx
DocumentRoot "c:/apache2triad/htdocs/folder1"
ServerName mos.ath.cx
</VirtualHost>

<VirtualHost 192.168.0.1:80>
ServerAdmin support@ath.cx
DocumentRoot "c:/apache2triad/htdocs/folder2"
ServerName mos1.ath.cx
</VirtualHost>

You will need to change the ip address to what your network card address is. The logs will be in the main apache logs, so if you want to separate the logs you should study on it. Also use quotes for the document root so that the apache reads the directive correctly.
View user's profileSend private message
daaamir
 
 


Joined: 19 Dec 2006
Posts: 10

PostPosted: Tue Dec 26, 2006 10:30 am Reply with quoteBack to top

OK, it's partially working, but, when only one virtual host is present and when i point that host to some other folder then htdocs it shows mw htdocs, here's my config:
Code:
<VirtualHost *>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/apache2triad/htdocs"
    ServerName mos.ath.cx
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost skriptsz.net>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/my sites/mysite1
    ServerName skriptsz.net
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

And when i put any address in browser it points me to htdocs, help please.

Problem solved...i was messing around with virtual hosts and i figured it out, apache instructions where very specific about that, with examples.
Anyway, thank You Dale, now i understand virtual hosting...
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT