Jon Nyström
Jon Nyström

Reputation: 11

Apache2 Port Change Error

I had a working apache2 server. Running without issues. Then i moved.

My new ISP is blocking port 80 so I needed to change it. Something is going wrong and I have been trying for hours without luck.

Right know im just trying to reach localhost, 127.0.0.1. Trying to reach them with this setup returns "Unable to connect".

This is my 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>

This is my sites-enabled/000-default

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

I have run sudo service apache2 restart. I did a sudo service apache2 reload also. I have done sudo ufw allow 8080.

If i revert to port 80, all is good.

I have mod_security enabled if that has something to do with it.

Thankfull for help. Jon

Upvotes: 0

Views: 200

Answers (1)

Jon Nystr&#246;m
Jon Nystr&#246;m

Reputation: 11

Solved. I have a new router and this one need you to set up settings for a Virtual Server. Did that and everyting worked.

My ISP didnt even block port 80. Everything had to do with the router.

Upvotes: 0

Related Questions