我正在运行 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
这些目录确实存在,当我导航到但看不到 user1 和 user3 时,我能够看到主虚拟主机 ()http//exmaple.co.uk
和http://user2.exmaple.co.uk
user2 。谁能发现任何错误?
更新 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 文件夹的主服务器上。斯托坏了?:(
您在所有虚拟主机上使用相同的 ServerAlias...。这绝对是一个错误 - 我们会看看这是否与您的问题有关。
如果它仍然无法正常工作,我们需要您日志的输出以及浏览器显示的一些信息。