Alex
Alex

Reputation: 6149

Apache2 not working after changing the default port

Apache2 is not working after changing the default port from 80 to 8099

I did the following:

In /etc/apache2/ports.conf, changed the port to:

Listen 8099

In /etc/apache2/sites-enabled/000-default.conf, did this:

<VirtualHost *:8099>

Then:

sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart

I tried to check the ports that are open using: sudo netstat -plunt, here is the outcome:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1179/mysqld     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1005/sshd       
tcp6       0      0 :::8099                 :::*                    LISTEN      6337/apache2    
tcp6       0      0 :::22                   :::*                    LISTEN      1005/sshd       
udp        0      0 0.0.0.0:14717           0.0.0.0:*                           641/dhclient    
udp        0      0 0.0.0.0:68              0.0.0.0:*                           641/dhclient    
udp6       0      0 :::48002                :::*                                641/dhclient  

anything I am missing here? Thanks

Upvotes: 1

Views: 1852

Answers (2)

srinivasan
srinivasan

Reputation: 31

Notice the bold portions:

<VirtualHost *:80>  
    #ServerName www.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/'Your folder acess'/public
    <Directory /var/www/'Your folder acess'/public>   
    AllowOverride All
    </Directory>   
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined  
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

Upvotes: 0

kay27
kay27

Reputation: 909

Seems it works but strangely for IPv6 only.

Here is a way to force it to use IPv4: https://unix.stackexchange.com/a/237610

Listen 0.0.0.0:8099

Upvotes: 1

Related Questions