我已经从我的Web服务器上从Raring迁移到了Saucy,并使用它从2.2.x升级到2.4.x.
现在Apache似乎没有意识到启用网站的目录或其内容。 每台主机都提供了000-default.conf。 VirtualHost的一个例子是006-cjshayward :
<VirtualHost *:80> ServerName cjshayward.com ServerAdmin [email protected] DocumentRoot /home/jonathan/cjshayward/public_html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options ExecCGI Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/author.cjshayward.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost> <VirtualHost *:80> ServerName www.cjshayward.com ServerAlias author.cjshayward.com cjsh.name www.cjsh.name cjsh.info www.cjsh.info RewriteEngine on RewriteRule ^(.*)$ http://cjshayward.com$1 [R=301,L] </VirtualHost>
还有什么我需要做的注册为具有自己的父目录的VirtualHost?
Apache 2.2的apache2.conf有这个指令: Include sites-enabled/*
Apache 2.4的apache2.conf已经切换到使用这个指令: IncludeOptional sites-enabled/*.conf
最有可能的是, sites-enabled目录中的文件不会以.conf结尾
Shane提到您需要确保httpd.conf包含来自启用网站的文件夹中的文件。
此外,大多数基于Debian的发行版都将包含启用网站的文件夹中的所有文件,而最后一次检查Redhat的“等效”将只包含扩展名为.conf的文件。
无论哪种方式,这需要存在于你的httpd.conf中:
Include /etc/apache2/sites-enabled/*