好。 这是一个很奇怪的错误:
我在/etc/apache2/sites-enabled/中用hello.php创build了一个名为“ hello ”的文件夹。 然后,我创build了一个别名告诉/hello会去/etc/apache2/sites-enabled/hello 。 这解决了。
然后我试图做一个VHost,这也起作用:
Alias /hello /etc/apache2/sites-enabled/hello <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/etc/apache2/sites-enabled/hello" ServerName comercial.YYYY.com ServerAlias ot.YYYY.com AddType application/x-httpd-php .php3 .php AddType application/x-httpd-php-source .phps <Directory /etc/apache2/sites-enabled/hello/> DirectoryIndex index.php </Directory> </VirtualHost>
但后来我读了sites-enabled/只是为了什么是内部sites-available所以我mv sites-*e/hello sites-available/hello并作出了a2ensite hello ,这就是当所有地狱打破了松散。
之前,PHP工作正常,“你好”的工作很漂亮 – 现在它就像没有PHP那里。 PHP的罚款,因为它是我有本地文件的副本。 没有错误显示..任何地方。 我尝试了/var/log/apache/并且没有任何与我正在使用spawns的目录相关。
此外,当移动文件(是的,我尝试了不同的位置),我注意到我的public_html有以下权限scheme:
drwxrwxr-x. 8 5500 www-data 4096 May 3 12:08 domain1_com drwxrwxrwx 2 root root 4096 May 2 17:25 _cgi-bin drwxr-xr-x 3 root root 4096 May 17 14:15 comercial_YYYY_com drwxrwxr-x. 6 5500 www-data 4096 May 3 11:47 domain2_com drwxrwxr-x. 6 5500 www-data 4096 May 2 17:25 domain3.pt drwxr-xr-x 7 5500 www-data 4096 May 3 17:55 orcamento_YYYY_com drwxrwxr-x. 6 5500 www-data 4096 May 13 18:48 domain4_pt drwxr-xr-x 3 5500 www-data 4096 May 17 11:40 to_domain5_com drwxrwxr-x. 8 5500 www-data 4096 May 13 18:03 YYYYY.com drwxrwxr-x. 19 5500 www-data 4096 May 3 11:20 domain5.com drwxrwxr-x. 6 5500 www-data 4096 May 2 17:25 domain6.pt
但是我没有安装SELinux。 我知道这是因为sestatus的答案是-bash: sestatus: command not found – 我在Debian Squeeze上 – 但是php不能在没有点权限(。)的文件夹上工作(SELinux thingy )。
而且,因为我似乎没有SELinux,我真的不知道如何或发生了什么。 (我知道,所有的域名都是来自另一台服务器的复制意大利面)
我在这里亏本 请在我的道路上点亮一些光线?
这是设置Apache的错误方法。 您的sites-available和sites-enabled目录仅用于虚拟主机configuration, 而不是您网站的内容文件。 这些应该存储在/var/www或您select的目录中。
你的AddType和DirectoryIndex指令应该被合并到/etc/apache2/apache2.conf主Apacheconfiguration中。
例:
/etc/apache2/sites-available/mydomain.com :
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/var/www/mydomain.com" ServerName mydomain.com <Directory /var/www/mydomain.com/> Options -Indexes Order allow,deny Allow from all </Directory> </VirtualHost>
这个文件然后被连接到/etc/apache2/sites-enabled/mydomain.com 。
您的网站数据然后存储在/var/www/mydomain.com 。