You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Arnold <ca...@electrichendrix.com> on 2007/10/10 03:34:39 UTC

[users@httpd] Vhost not working

I am running apache 2.2.6 on sles10 sp1. We have like 3 vhost and one of those i can not, for the life of me, getting it working. The vhost should be accessible from demo.mytimewithgod.net but this will always send you to mytimewithgod.net. Here is the snipit from vhost file:
<VirtualHost *:80>
    ServerAdmin <user>@domain.tld
    ServerName demo.mytimewithgod.net
    DocumentRoot /srv/www/htdocs/demo

    # if not specified, the global error log is used
    ErrorLog /var/log/apache2/demo.mytimewithgod.net-error_log
    CustomLog /var/log/apache2/demo.mytimewithgod.net-access_log combined

    # don't loose time with IP address lookups
    HostnameLookups Off

    # needed for named virtual hosts
    UseCanonicalName Off

    # configures the footer on server-generated documents
    ServerSignature On


    # Optionally, include *.conf files from /etc/apache2/conf.d/
    #
    # For example, to allow execution of PHP scripts:
    #
    # Include /etc/apache2/conf.d/mod_php4.conf
    #
    # or, to include all configuration snippets added by packages:
    # Include /etc/apache2/conf.d/*.conf


    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the realname directory are treated as applications and
    # run by the server when requested rather than as documents sent to the client.
    # The same rules about trailing "/" apply to ScriptAlias directives as to
    # Alias.
    #
    ScriptAlias /cgi-bin/ "/srv/www/vhosts/dummy-host.example.com/cgi-bin/"

    # "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have one, and where ScriptAlias points to.
    #
    <Directory "/srv/www/vhosts/dummy-host.example.com/cgi-bin">
	AllowOverride None
	Options +ExecCGI -Includes
	Order allow,deny
	Allow from all
    </Directory>


    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #
    # To disable it, simply remove userdir from the list of modules in APACHE_MODULES
    # in /etc/sysconfig/apache2.
    #
    <IfModule mod_userdir.c>
	# Note that the name of the user directory ("public_html") cannot simply be
	# changed here, since it is a compile time setting. The apache package
	# would have to be rebuilt. You could work around by deleting
	# /usr/sbin/suexec, but then all scripts from the directories would be
	# executed with the UID of the webserver.
	UserDir public_html
	# The actual configuration of the directory is in
	# /etc/apache2/mod_userdir.conf.
	Include /etc/apache2/mod_userdir.conf
	# You can, however, change the ~ if you find it awkward, by mapping e.g.
	# http://www.example.com/users/karl-heinz/ --> /home/karl-heinz/public_html/
	#AliasMatch ^/users/([a-zA-Z0-9-_.]*)/?(.*) /home/$1/public_html/$2
    </IfModule>


    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/srv/www/htdocs/demo">
    
	#
	# Possible values for the Options directive are "None", "All",
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
	#
	# Note that "MultiViews" must be named *explicitly* --- "Options All"
	# doesn't give it to you.
	#
	# The Options directive is both complicated and important.  Please see
	# http://httpd.apache.org/docs-2.2/mod/core.html#options
	# for more information.
	#
	Options Indexes FollowSymLinks
    
	#
	# AllowOverride controls what directives may be placed in .htaccess files.
	# It can be "All", "None", or any combination of the keywords:
	#   Options FileInfo AuthConfig Limit
	#
	AllowOverride None
    
	#
	# Controls who can get stuff from this server.
	#
	Order allow,deny
	Allow from all
    
    </Directory>

</VirtualHost>

Why can i not get this one vhost working?




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Vhost not working

Posted by Chris Arnold <ca...@electrichendrix.com>.
On Tue, 9 Oct 2007, Chris Arnold wrote:

> <VirtualHost *:80>
>    ServerAdmin <user>@domain.tld
>    ServerName demo.mytimewithgod.net
>    DocumentRoot /srv/www/htdocs/demo
>
>    ScriptAlias /cgi-bin/ "/srv/www/vhosts/dummy-host.example.com/cgi-bin/"
>    <Directory "/srv/www/vhosts/dummy-host.example.com/cgi-bin">

>>I assume you just didn't correct these paths in your example to us, or at 
>>least they do exist...
These do not exist. We don't have any cgi-bin scripts as of yet.

>>try running /path/to/httpd -t
/usr/sbin/httpd2 -t
Syntax OK

>>if thats good you need to run vhost checks: /path/to/httpd -S
/usr/sbin/httpd2 -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server mytimewithgod.net (/etc/apache2/vhosts.d/main-vhost.conf :17)
         port 80 namevhost mytimewithgod.net (/etc/apache2/vhosts.d/main-vhost.c onf:17)
         port 80 namevhost teknerds.net (/etc/apache2/vhosts.d/main-vhost.conf:1 28)
         port 80 namevhost demo.mytimewithgod.net (/etc/apache2/vhosts.d/main-vh ost.conf:235)
         port 80 namevhost demo.mytimewithgod.net (/etc/apache2/vhosts.d/yast2_v hosts.conf:1)
         port 80 namevhost mytimewithgod.net (/etc/apache2/vhosts.d/yast2_vhosts .conf:107)
Syntax OK


-- 

Cheers
Res

Slackware -V- sloooUbuntoooou
http://lxer.com/module/newswire/view/93393/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Vhost not working

Posted by Res <re...@ausics.net>.
On Tue, 9 Oct 2007, Chris Arnold wrote:

> <VirtualHost *:80>
>    ServerAdmin <user>@domain.tld
>    ServerName demo.mytimewithgod.net
>    DocumentRoot /srv/www/htdocs/demo
>
>    ScriptAlias /cgi-bin/ "/srv/www/vhosts/dummy-host.example.com/cgi-bin/"
>    <Directory "/srv/www/vhosts/dummy-host.example.com/cgi-bin">

I assume you just didn't correct these paths in your example to us, or at 
least they do exist...


try running /path/to/httpd -t 
if thats good you need to run vhost checks: /path/to/httpd -S


-- 

Cheers
Res

Slackware -V- sloooUbuntoooou
http://lxer.com/module/newswire/view/93393/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Vhost not working

Posted by Joshua Slive <jo...@slive.ca>.
On 10/9/07, Chris Arnold <ca...@electrichendrix.com> wrote:
> I am running apache 2.2.6 on sles10 sp1. We have like 3 vhost and one of those i can not, for the life of me, getting it working. The vhost should be accessible from demo.mytimewithgod.net but this will always send you to mytimewithgod.net. Here is the snipit from vhost file:
>

Below is what your server is sending back when you request
demo.mytimewithgod.net.

The interesting thing to note is that this is a redirect created by
php. So it seems like the request is indeed reaching the appropriate
vhost, but you have some scripts on that vhost that are redirecting
requests to www.mytimewithgod.net. Fix those scripts and I bet your
problem goes away.

HTTP/1.1 301 Moved Permanently
Date: Wed, 10 Oct 2007 02:25:49 GMT
Server: Apache/2.2.6 (Linux/SUSE)
X-Powered-By: PHP/5.1.2
Set-Cookie: PHPSESSID=bvf4ll1cicih2aip5rr564s3v5; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Pingback: http://www.mytimewithgod.net/demo/xmlrpc.php
Location: http://www.mytimewithgod.net/
Vary: Accept-Encoding
Content-Length: 0
Content-Type: text/html; charset=UTF-8

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org