虚拟主机apache2 Debian jessie

时间:2014-09-01 18:56:30

标签: apache2

我正在尝试在Debian jessie上使用Apache2设置多个虚拟网站进行开发。在我不得不进行全新安装之前,我已经设置好了它。基本上系统在升级后就崩溃了。

我可以访问“localhost”甚至“localhost / phpinfo.php”。所以这告诉我服务器“正确”安装。当我尝试访问“rosebusch.local”(虚拟主机的名称)时,我得到:

Forbidden

You don't have permission to access /index.html on this server.
Apache/2.4.10 (Debian) Server at rosebusch.local Port 80

/ home / jeff / public_html的权限是:

drwxrwxrwx 5 jeff www-data 4096 Aug 30 21:41 public_html

apache2ctl的输出如下:

VirtualHost configuratin:
*:80                   is a NameVirtualHost
     default server rosebusch.local (/etc/apache2/ports.conf:9)
     port 80 namevhost rosebusch.local (/etc/apache2/ports.conf:9)
             alias www.rosebusch.local
     port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default.conf:3)
     port 80 namevhost rosebusch.local (/etc/apache2/sites-enabled/rosebusch.conf:3)
             alias www.rosebusch.local
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

/ etc / hosts的内容:

127.0.0.1   localhost rosebusch.local
127.0.1.1   debian-jeff.busch.org   debian-jeff

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/etc/apache2/site-available/rosebusch.conf的内容:

<VirtualHost *:80>
    ServerAdmin webmaster@rosebusch.local
    ServerName rosebusch.local
    ServerAlias www.rosebusch.local
    DocumentRoot /home/jeff/public_html/rosebusch
    <Directory /home/jeff/public_html/rosebusch>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
       allow from all
    </Directory>
    ErrorLog /var/log/apache2/www.rosebusch.local-error_log
    CustomLog /var/log/apache2/www.rosebusch.local-access_log common
</VirtualHost>

我确实输入了a2ensite rosebusch.conf。我错过了什么?我通过修改一个文件在Windows 8上使用XAMP进行了所有设置(4个虚拟主机)。我不记得上次我在Debian上设置这个时遇到这么多麻烦。

由于 杰夫

1 个答案:

答案 0 :(得分:5)

<Directory /home/jeff/public_html/rosebusch>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all

   # New directive needed in Apache 2.4.3: 
   Require all granted
</Directory>

http://httpd.apache.org/docs/current/upgrading.html

Error message "Forbidden You don't have permission to access / on this server"