我已经使用ppa:ondrej/php repository将PHP从5.5更新到了5.6版的数字海洋液滴(Ubuntu 14.04)。 我也更新mod_php使用5.6。 从那时起,我的虚拟主机停止了工作。 我到达服务器时显示的是“Apache2 Ubuntu默认页面” – /var/www/html/index.html 。
这是在apache2.conf :
# Include the virtual host configurations: IncludeOptional sites-enabled/*.conf
目录/etc/apache2/sites-enabled/ :
total 8 drwxr-xr-x 2 root root 4096 Nov 1 08:31 ./ drwxr-xr-x 8 root root 4096 Nov 1 08:20 ../ lrwxrwxrwx 1 root root 35 Nov 1 08:20 000-default.conf -> ../sites-available/000-default.conf lrwxrwxrwx 1 root root 33 Nov 1 08:31 somesite.com.conf -> ../sites-available/somesite.com.conf
configuration文件/etc/apache2/sites-enabled/somesite.com.conf :
<VirtualHost *:80> ServerName somesite.com ServerAdmin webmaster@localhost DocumentRoot /var/www/somesite/public <Directory /var/www/somesite/public/> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
我用“somesite”replace了真正的sitename。 这个configuration工作之前,我不明白为什么现在不应该现在…我已经更新了3个其他服务器上的PHP,它在其他地方工作。 恐怕我已经尝试了我的服务器pipe理知识的所有程度,不知道下一步该怎么做。
你能指出我如何debugging这种问题? 谢谢!
编辑
这是apache2ctl -S输出:
VirtualHost configuration: *:80 is a NameVirtualHost default server somesite.com (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost somesite.com (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost somesite.com (/etc/apache2/sites-enabled/somesite.com.conf:1) ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www" Main ErrorLog: "/var/log/apache2/error.log" Mutex default: dir="/var/lock/apache2" mechanism=fcntl Mutex mpm-accept: using_defaults Mutex watchdog-callback: using_defaults PidFile: "/var/run/apache2/apache2.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="www-data" id=33 not_used Group: name="www-data" id=33 not_used
也许这是造成这个问题的port 80 namevhost somesite.com条目的重复? 如何摆脱指向默认configuration的第一个事件,而不删除默认configuration? 我想保持它的安全和后备。
一些相关的主题可能是这些:
https://stackoverflow.com/questions/19723820/sites-showing-it-works-page-not-what-is-specified-in-vhost-configs
https://webmasters.stackexchange.com/questions/83633/have-disabled-apache-site-config-file-000-default-conf-but-it-still-seems-activ
apache2ctl -S将是你最好的select。 它应该告诉你正在你的系统上运行的网站。 服务器似乎有可能使用不同的path,而不是您所期望的。