Portál AbcLinuxu, 10. května 2025 08:09
# get the server name from the Host: header
UseCanonicalName Off
# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /www/hosts/%0/docs
VirtualScriptAlias /www/hosts/%0/cgi-bin
Forcing reload of web server: Apache2Syntax error on line 9 of /etc/apache2/httpd.conf:
Invalid command 'VirtualDocumentRoot', perhaps mis-spelled or defined by a module not included in the server configuration
mod_vhost_alias
. Někde musíte mít LoadModule mod_vhost_alias.so
nebo něco podobného.
<VirtualHost xxx.xxx.x.xx> UseCanonicalName Off ServerName www.xx.ws ServerAlias *.xx.ws DocumentRoot "/web/html/xx.ws/public_html" #VirtualDocumentRoot "/web/html/%-2.0.%-1.0/public_html" RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.xx\.ws$ [NC] RewriteCond %{HTTP_HOST} ^(.*\.)?([^\.]+)\.xx\.ws$ [NC] RewriteRule ^(.*)$ /_sub/%2$1 [L] # <Directory "/web/html/xx.ws/public_html"> Options None FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog /web/html/xx.ws/logs/error_log CustomLog /web/html/xx.ws/logs/access_log common </VirtualHost>
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.