Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

Virtual hosts
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Apache
View previous topic :: View next topic  
Author Message
daaamir



Joined: 19 Dec 2006
Posts: 10

Posted: Sat Dec 23, 2006 3:54 pm    Post subject: Virtual hosts  

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!
Back to top  
dale



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

Posted: Tue Dec 26, 2006 8:45 am    Post subject:  

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.
Back to top  
daaamir



Joined: 19 Dec 2006
Posts: 10

Posted: Tue Dec 26, 2006 10:30 am    Post subject:  

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...
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Apache
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group