0

我有一个工作的 apache2 服务器。运行没有问题。然后我搬家了。

我的新 ISP 阻止了端口 80,所以我需要更改它。出了点问题,我已经尝试了几个小时没有运气。

对,我只是想访问 localhost,127.0.0.1。尝试使用此设置联系他们会返回“无法连接”。

这是我的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 *:8080
Listen 8080


<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>

这是我的网站启用/000-默认

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        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>

我已经运行了 sudo service apache2 restart 。我也做了一个 sudo service apache2 reload 。我已经完成了 sudo ufw allow 8080。

如果我恢复到端口 80,一切都很好。

如果这与它有关,我启用了 mod_security。

感谢您的帮助。乔恩

4

1 回答 1

0

解决了。我有一个新路由器,这需要您设置虚拟服务器的设置。做到了,一切都奏效了。

我的 ISP 甚至没有阻止端口 80。一切都与路由器有关。

于 2013-07-05T13:56:49.137 回答