VirtualHost Index issue

Alles, was den Apache betrifft, kann hier besprochen werden.

VirtualHost Index issue

Postby DaveMcNertney » 16. February 2011 04:19

I am trying to set up a Virtual Host on an XP box running Apache 2.2. I think I have it pretty close to correct, as if I browse (via FireFox 3.6) to my public IP Address:Port# (i.e., "http://xxx.xxx.xxx.xxx:10088"), or on the local network, go to "http://192.168.1.101:10088", I get the index.html page (located in the VirtualHost DocumentRoot directory below) displayed as it should be.
But if I browse to "http://SiteName.com", I get the contents of the Apache DocumentRoot directory (i.e, C:\Program Files\Zend\Apache2\htdocs). Using my browser, I can click, level by level, to get to the directory containing index.html, or get there directly by browsing to "http://SiteName.com/Data/Hakan/110209/Unnamed Site 2". I'd like to be able to get to index.html directly by browsing to "http://SiteName.com". What am I doing wrong?

Here's how I have the VirtualHost set up in httpd.conf:

Listen 192.168.1.101:10088
NameVirtualHost 192.168.1.101:10088
<VirtualHost 192.168.1.101:10088>
ServerName SiteName.com:10088
DocumentRoot "C:\Program Files\Zend\Apache2/htdocs/Data/Hakan/110209/Unnamed Site 2"
<Directory "C:\Program Files\Zend\Apache2/htdocs/Data/Hakan/110209/Unnamed Site 2">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
DaveMcNertney
 
Posts: 5
Joined: 16. February 2011 00:48

Re: VirtualHost Index issue

Postby Nobbie » 16. February 2011 10:55

DaveMcNertney wrote:But if I browse to "http://SiteName.com"


... the request yields to Port 80. You must specify the port here as well: http://SiteName.com:10088
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VirtualHost Index issue

Postby DaveMcNertney » 16. February 2011 18:32

Sorry, I probably should have used "*.com" instead of "SiteName.com". Until I figure out why browsing to my public IP Address reveals the contents of my default Apache DocumentRoot directory, I'd prefer not to provide the actual URL. I am using port 10088, though.

Again, my real question is: Why does going to "http://PublicIPAddress:Port#" take me directly to my index.html file (located in the VirtualHost DocumentRoot directory), while "http://ActualSiteName.com" returns the contents of the main Apache DocumentRoot directory?
DaveMcNertney
 
Posts: 5
Joined: 16. February 2011 00:48

Re: VirtualHost Index issue

Postby Nobbie » 16. February 2011 21:48

DaveMcNertney wrote:Again, my real question is: Why does going to "http://PublicIPAddress:Port#" take me directly to my index.html file (located in the VirtualHost DocumentRoot directory), while "http://ActualSiteName.com" returns the contents of the main Apache DocumentRoot directory?


Again the same answer - because "ActualSiteName.com" yields to Port 80 (instead of 10080). As I dont know your full configuration (only a very small snippet), this is the only idea I have for that.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: VirtualHost Index issue

Postby DaveMcNertney » 17. February 2011 01:08

OK, browsing to "http://ActualSiteName.com:10088", also takes me to the VirtualHost index.html - excellent! Now, how do I configure my system so that just using "http://ActualSiteName.com" by itself does this?
DaveMcNertney
 
Posts: 5
Joined: 16. February 2011 00:48

Re: VirtualHost Index issue

Postby DaveMcNertney » 17. February 2011 01:17

Oh, here's some more info re: my system:

I believe the only two changes to my httpd.conf file (from a fresh install) are:

Listen 192.168.1.101:80
and,
Include conf/httpd-vhosts.conf

httpd-vhosts.conf contains:

Listen 192.168.1.101:10088
NameVirtualHost 192.168.1.101:10088
<VirtualHost 192.168.1.101:10088>
ServerName ActualSiteName.com:10088
DocumentRoot "C:\Program Files\Zend\Apache2/htdocs/Data/Hakan/110209/Unnamed Site 2"
<Directory "C:\Program Files\Zend\Apache2/htdocs/Data/Hakan/110209/Unnamed Site 2">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
DaveMcNertney
 
Posts: 5
Joined: 16. February 2011 00:48

Re: VirtualHost Index issue

Postby DaveMcNertney » 17. February 2011 02:56

OK, now I get it - apparently VirtualHost HAS to use port 80, right? I changed all references to port 10088 to 80, and now I can connect directly to index.html in my VirtualHost DocumentRoot directory using just "http://ActualSiteName.com".

But is this really true? Is there really no way to use another port with VirtualHost (such as 10088), and still be able to access the index page with just "http://ActualSiteName.com"?
DaveMcNertney
 
Posts: 5
Joined: 16. February 2011 00:48

Re: VirtualHost Index issue

Postby Nobbie » 19. February 2011 10:11

DaveMcNertney wrote:But is this really true? Is there really no way to use another port with VirtualHost (such as 10088), and still be able to access the index page with just "http://ActualSiteName.com"?


Yes. Port 80 is the default port for HTTP connections, if you dont specify a different one.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 6 guests