mod_vhost_alias and DOCUMENT_ROOT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on my one server i've compiled (first tried from packages) httpd
2.2.11 (then tried 2.2.6). With following configuration:

ServerRoot "/usr/local/httpd-2.2.6"

Listen 8080

LoadModule php5_module modules/libphp5.so

User www-data
Group www-data

HostnameLookups On

Timeout 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Full
ServerSignature Off
#EnableSendfile Off
PidFile logs/httpd.pid
LockFile logs/accept.lock

StartServers          5
MinSpareServers       5
MaxSpareServers      25
MaxClients          250
MaxRequestsPerChild   0

DirectoryIndex index.html index.php

DefaultType text/plain

<FilesMatch "^\.ht">
   Order allow,deny
   Deny from all
   Satisfy All
</FilesMatch>

<Directory />
   Options FollowSymLinks
   AllowOverride All
   Order deny,allow
   Allow from all
</Directory>

ErrorLog "logs/error_log"
LogLevel debug
LogFormat "%V %h \"%u\" %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
TransferLog logs/other_vhosts_access.log

NameVirtualHost *:8080

AddType application/x-httpd-php .php .phtml .php3

<VirtualHost *:8080>
       ServerName domain.tld
       ServerAlias *.domain.tld

       VirtualDocumentRoot /var/www/domain.tld/home/%-3
#      DocumentRoot /tmp

       TransferLog logs/domain.tld_access.log
       ErrorLog logs/domain.tld_error.log
       LogLevel debug
</VirtualHost>

Everything woks ok (installed mod PHP). Excpet that variable
DOCUMENT_ROOT ($_SERVER['DOCUMENT_ROOT'] in php) points to /htdocs.
When use DocumentRoot variable DOCUMENT_ROOT
($_SERVER['DOCUMENT_ROOT'] in php)  points to /tmp, but pages are
loaded from correct location (depends on subdomain). What must be set
to variable DOCUMENT_ROOT ($_SERVER['DOCUMENT_ROOT'] in php) points to
right location (www.domain.tld -> /var/www/domain.tld/home/www,
xyz.domain.tld -> /var/www/domain.tld/home/xyz).

Using debian testing 64bit.

apachectl -l
Compiled in modules:
 core.c
 mod_authn_file.c
 mod_authz_host.c
 mod_authz_user.c
 mod_auth_basic.c
 mod_log_config.c
 mod_setenvif.c
 prefork.c
 http_core.c
 mod_mime.c
 mod_status.c
 mod_autoindex.c
 mod_cgi.c
 mod_vhost_alias.c
 mod_dir.c
 mod_alias.c
 mod_rewrite.c
 mod_so.c

apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:8080                 is a NameVirtualHost
        default server domain.tld (/usr/local/httpd-2.2.6/conf/httpd.conf:60)
        port 8080 namevhost domain.tld
(/usr/local/httpd-2.2.6/conf/httpd.conf:60)
Syntax OK


Thank you for help and advices.

-- 
Lampa

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux