Author |
|
Genok
Joined: 09 Jan 2006 Posts: 21 Location: Russia
|
Posted: Sun 26 Feb '06 15:34 Post subject: Virtual Host |
|
|
Hi. I have two ip's. One internal LAN - let it be 1.2.3.4 and external(for internet) - let it be 5.6.7.8. I need apache to work with this ips. The main httpd.conf is set for 1.2.3.4. I uncomment Code: | Include conf/extra/httpd-vhosts.conf | And now i need to edit httpd-vhosts.conf. The doc.root for 1.2.3.4 is x:\httpd\hosts\1.2.3.4\htdocs.
For 5.6.7.8 - x:\httpd\hosts\5.6.7.8\htdocs. What should i add to httpd-vhosts.conf to make apache work both with 1.2.3.4 and 5.6.7.8? |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
|
Back to top |
|
Genok
Joined: 09 Jan 2006 Posts: 21 Location: Russia
|
Posted: Sun 26 Feb '06 20:58 Post subject: |
|
|
So this Code: | Listen 80
# This is the "main" server running on 1.2.3.4
ServerName server.domain.com
DocumentRoot /www/mainserver | i should edit in the main httpd.conf
and this
Code: | NameVirtualHost 5.6.7.8
<VirtualHost 5.6.7.8>
DocumentRoot /www/example1
ServerName www.example.com
# Other directives here ...
</VirtualHost> | in httpd-vhosts.conf? Am I right? |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Sun 26 Feb '06 23:08 Post subject: |
|
|
Looks fine.
Do not forget to uncomment in httpd.conf:
Include conf/extra/httpd-vhosts.conf
Just try it, to see if it works.
Steffen |
|
Back to top |
|
Genok
Joined: 09 Jan 2006 Posts: 21 Location: Russia
|
Posted: Mon 27 Feb '06 7:56 Post subject: |
|
|
Main host works fine, but the access to virtual is 403 - Forbidden =(( Where am I wrong? |
|
Back to top |
|
Genok
Joined: 09 Jan 2006 Posts: 21 Location: Russia
|
Posted: Mon 27 Feb '06 8:10 Post subject: |
|
|
Fixed =)) I forgot to edit
block. |
|
Back to top |
|