Apache Listening to Port 8080 - connection refused

March 28, 2017 478 views
Apache Ubuntu 16.04

I fired up a droplet with LAMP on 16.04
I edited /etc/apache2/ports.conf and set it to Listen 8080
I edited /etc/apache2/sites-enabled/000-default.conf and set it to <VirtualHost *:8080>
I ran sudo ufw allow 8080
I restarted apache service

My website doesn't load - what am I missing?

2 Answers

@2acb1c1a10e4cc269204

Please post the output of this command:

tail -20 /var/log/apache2/error.log

That pulls the last 20 lines from the error.log and will display them. Simply copy and paste to a code block.

there's nothing in there - Apache is not even getting hit

  • @2acb1c1a10e4cc269204

    The default listening port for Apache would be port 80, not 8080, so unless you're appending the port to the end of your URL with the changes you've made, then your website won't show.

    When Apache is listening on port 80 (the default/standard HTTP port), you can use:

    http://yoursite.com
    

    If you change the port that Apache is listening on, then you have to append the port to the end of the URL, i.e.

    http://yoursite.com:8080
    

    The only time you really want to modify the port that Apache is listening on is when you're using it in a reverse proxy setup -- for example, when NGINX is running in front of Apache.

    NGINX would listen on port 80 and proxy requests to port 8080 (Apache).

    If you're not using NGINX, and there's no particular reason to use a different port, then Apache should be listening on port 80.

Have another answer? Share your knowledge.