2012-12-07 162 views
1

经过几天试图在我的本地主机上设置apache2虚拟主机,我严重失去耐心。你们能帮我吗?一切似乎都不错,但如果我想在我的浏览器访问local.droidbb.com我得到的Apache2虚拟主机不工作

无法加载页面的响应。载入网址时出现问题 http://local.droidbb.com/。无法连接到目的地。

这里是所有相关文件(至少我是这么认为的)。

etc/hosts中文件

#127.0.0.1 ingress localhost.localdomain localhost 
127.0.0.1 local.droidbb.com 
#127.0.1.1 debian.resnet.gre.ac.uk debian 
#127.0.1.1 debian.local.droidbb.com debian 

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

等/ apache2的/ ports.conf文件

# If you just change the port or add more ports here, you will likely also 
# have to change the VirtualHost statement in 
# /etc/apache2/sites-enabled/000-default 
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from 
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and 
# README.Debian.gz 

NameVirtualHost * 
Listen 80 

<IfModule mod_ssl.c> 
    # If you add NameVirtualHost *:443 here, you will also have to change 
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl 
    # to <VirtualHost *:443> 
    # Server Name Indication for SSL named virtual hosts is currently not 
    # supported by MSIE on Windows XP. 
    Listen 443 
</IfModule> 

<IfModule mod_gnutls.c> 
    Listen 443 
</IfModule> 

等/ apache2的/网站可用/ local.droidbb.com文件

<VirtualHost *> 

    ServerAdmin [email protected] 

    ServerName local.droidbb.com 



    DocumentRoot /var/www/local.droidbb.com/public_html/ 

    <Directory /> 

      Options FollowSymLinks Includes -Indexes 

      AllowOverride All 

      Order allow,deny 

      Allow from all 

    </Directory> 



    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 

    <Directory "/usr/lib/cgi-bin"> 

     AllowOverride None 

     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 

     Order allow,deny 

     Allow from all 

    </Directory> 



    ErrorLog ${APACHE_LOG_DIR}/error.log 



    # Possible values include: debug, info, notice, warn, error, crit, 

    # alert, emerg. 

    LogLevel warn 



    CustomLog ${APACHE_LOG_DIR}/access.log combined 

</VirtualHost> 

问题在哪里?哦,我应该提到我在virtualbox上运行Linux Debian x64。

+0

我又刚安装了新的机器,现在它作品。可能是apache的配置存在一些问题。这次我在debian安装过程中没有勾选'install web-server',而是使用apt-get install apache2来代替。 它现在完美运行! –

回答

0

apache是​​否运行良好?是在Apache的error.log中的东西?听起来像apache不能正常工作。 (可能的配置问题或其他任何东西)

+1

Apache运行没有问题。当我插入http:// localhost时,默认index.html被加载。 –

1

移动文件

/etc/apache2/sites-available/local.droidbb.com 

/etc/apache2/sites-enabled/local.droidbb.com 

一切可用的站点被禁用:)

+0

它符合a2ensite命令启用的站点。无论如何,这个问题已解决。通过擦除虚拟机并安装Debian Wheeze :) –