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: Virtual Host
Author
Genok



Joined: 09 Jan 2006
Posts: 21
Location: Russia

PostPosted: Sun 26 Feb '06 15:34    Post subject: Virtual Host Reply with quote

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

PostPosted: Sun 26 Feb '06 16:32    Post subject: Reply with quote

Did you read: http://httpd.apache.org/docs/2.2/vhosts/ ?

An exanple of Name-based hosts on more than one IP address, is at http://httpd.apache.org/docs/2.2/vhosts/examples.html#twoips

Steffen
Back to top
Genok



Joined: 09 Jan 2006
Posts: 21
Location: Russia

PostPosted: Sun 26 Feb '06 20:58    Post subject: Reply with quote

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

PostPosted: Sun 26 Feb '06 23:08    Post subject: Reply with quote

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

PostPosted: Mon 27 Feb '06 7:56    Post subject: Reply with quote

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

PostPosted: Mon 27 Feb '06 8:10    Post subject: Reply with quote

Fixed =)) I forgot to edit
Code:
<Directory />

block.
Back to top


Reply to topic   Topic: Virtual Host View previous topic :: View next topic
Post new topic   Forum Index -> Apache