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: vitual host does not go to document root.....
Author
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 18:39    Post subject: vitual host does not go to document root..... Reply with quote

Here is my Apache config file.... Can anyone tell me why Virtual Hosts all go to my main Document Root and not the Document Root I have then set for in the Virtual Host container?


# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

<VirtualHost 192.168.0.61:80>
ServerName support.umdf.org
ServerAlias umdf.org *.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

<VirtualHost 192.168.0.62:80>
ServerName www.carolinesonmymind.com
ServerAlias carolinesonmymind.com *.carolinesonmymind.com carolinesonmymind.org *.carolinesonmymind.org
DocumentRoot "C:\Apache Software Foundation\Apache2.2\htdocs\carolinesonmymind"
</VirtualHost>

<VirtualHost 192.168.0.63:80>
ServerName podcast.umdf.org
ServerAlias *.podcast.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

<VirtualHost 192.168.0.64:80>
ServerName connect.umdf.org
ServerAlias *.connect.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

...

# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName servss01.umdf.org:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"

...

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf


Moderators Note: Removed all non-pertinent config info
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 22 Feb '10 19:02    Post subject: Reply with quote

ok ... fist off, do you really have 4 NICs in the server to give you the 4 IPs of

192.168.0.61
192.168.0.62
192.168.0.63
192.168.0.64
Back to top
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 19:06    Post subject: Reply with quote

no, i can run the all off the main ip of .61 if that would be better.... it doesn't solve my problem though.....
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 22 Feb '10 19:22    Post subject: Reply with quote

well ... listening to IPs that do not exist cannot help so yes, just the one or * works as well.

I also notice that config/podcast/support.umdf.org all point to the same docroot. There is nothing wrong with that but from what I see they will all get the same thing, unless you use DirectoryIndex in each to tell Apache to grab something other than the main index.html/php file or are doing similar with the php script. But that is not stopping anything.

The problem can be traced down to the ol'
"Main Host Goes Away" in one of the vhosts docs

Try

Listen 80

Move the Vhosts down near the bottom of the file and change the IPs to just * in each one of them.


make the first vhost simply

<VirtualHost *:80>
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

then throw the rest below it
Back to top
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 19:45    Post subject: Reply with quote

This is my new config and when i go to www.carolinesonmymind.com it still takes me to the default document root..... Sad

Admin note
Config removed, see forum rules.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 22 Feb '10 20:16    Post subject: Reply with quote

did you retsart apache?

And please do not post your entire config per forum rules.
main servername/docroot and vhosts will do in most cases
Back to top
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 20:41    Post subject: Reply with quote

sorry..... and yes, i did restart..... i just did again and still nothing.....
Back to top
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 21:45    Post subject: Reply with quote

I saw my config was deleted.... Here is the part I modified....\

# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

<VirtualHost *:80>
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName support.umdf.org
ServerAlias support.umdf.org *.support.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerName www.carolinesonmymind.com
ServerAlias www.carolinesonmymind.com *.www.carolinesonmymind.com www.carolinesonmymind.org *.www.carolinesonmymind.org
DocumentRoot "C:\Apache Software Foundation\Apache2.2\htdocs\carolinesonmymind"
</VirtualHost>

<VirtualHost *:80>
ServerName podcast.umdf.org
ServerAlias podcast.umdf.org *.podcast.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs/umdf_podcast"
</VirtualHost>

<VirtualHost *:80>
ServerName connect.umdf.org
ServerAlias connect.umdf.org *.connect.umdf.org
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs/umdf_connect"
</VirtualHost>
Back to top
precopia



Joined: 19 Feb 2010
Posts: 6
Location: Pittsburgh

PostPosted: Mon 22 Feb '10 23:41    Post subject: Reply with quote

FYI, A buddy had me add the following line and it worked after a restart!!!!
Back to top
jelyn



Joined: 08 Mar 2010
Posts: 1

PostPosted: Mon 08 Mar '10 6:02    Post subject: Reply with quote

precopia wrote:
FYI, A buddy had me add the following line and it worked after a restart!!!!

May I know which line had you added? Because I am having same issue as well Embarassed
Back to top


Reply to topic   Topic: vitual host does not go to document root..... View previous topic :: View next topic
Post new topic   Forum Index -> Apache