我正在运行 CentOS 6.2,并且在 httpd.conf 中有以下内容:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.co.uk/public
ServerName example.co.uk
ErrorLog logs/example.co.uk-error_log
CustomLog logs/example.co.uk-access_log common
</VirtualHost>
#user1 directory
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/user1/public_html
ServerName user1.example.co.uk
ServerAlias www.example.co.uk
ErrorLog logs/error_log
CustomLog logs/user1-access_log common
</VirtualHost>
#user2 directory
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/user2/public_html
ServerName user2.example.co.uk
ServerAlias www.example.co.uk
ErrorLog logs/error_log
CustomLog logs/user2-access_log common
</VirtualHost>
#user3 directory
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/user3/public_html
ServerName user3.example.co.uk
ServerAlias www.example.co.uk
ErrorLog logs/user3-error_log
CustomLog logs/access_log common
</VirtualHost>
ServerName example.co.uk
这些目录确实存在,当我导航到时,我可以看到主虚拟主机( )和用户 2 http//exmaple.co.uk
,http://user2.exmaple.co.uk
但看不到用户 1 和用户 3。有人能发现任何错误吗?
更新 Apche 错误日志:
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_oci.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed May 08 15:45:42 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.14 configured -- resuming normal operations
[Wed May 08 15:48:02 2013] [notice] caught SIGTERM, shutting down
[Wed May 08 15:48:03 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed May 08 15:48:03 2013] [notice] Digest: generating secret for digest authentication ...
[Wed May 08 15:48:03 2013] [notice] Digest: done
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_oci.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed May 08 15:48:03 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.4.14 configured -- resuming normal operations
同样的错一遍又一遍,但 user2 子域工作正常?我已将 ServerAlia 保留在指向我的 www 文件夹的主域上。Stoll 坏了吗?:(
答案1
您在所有 vhost 上都使用了相同的 ServerAlias....这肯定是一个错误 - 我们将看看这是否与您的问题有关。
如果仍然不起作用,我们需要您的日志输出和您的浏览器显示的一些信息。