Question

Access Apache Site Externally

Good night,

I setup Ubuntu 20.04 server, and installed LAMP stack and Wordpress for a site.

I can access the site internally (from another PC,phone,etc…) at the servers IP on port 80. Externally, jjohns.ddns.net:8821, the site will not load. I am sure my port forwarding is correct as I host a few sites here at my house. I have several which work using IIS on Windows 10.

In this sites /etc/apache2/sites-available/jmcs.conf I have the following:

<VirtualHost *:80>
        #ServerName ##This is commented out at the moment, but I have tried using the domain name jjohns.ddns.net for both name/alias
        #ServerAlias
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/jmcs
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/jmcs/>
               AllowOverride All
        </Directory>
</VirtualHost>                

In the ports.conf


Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

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

UFW I am not too familiar with what may need to be opened, but I have it inactive at the moment. Status while active is:

Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
Apache                     ALLOW       Anywhere
22/tcp (v6)                ALLOW       Anywhere (v6)
Apache (v6)                ALLOW       Anywhere (v6)

On my Edge Router, using TCP, I forward from 8821 to port 80. I have tested going from 80 to 80 and it did not work. Also tired UDP, and both TCP/UDP for giggles.

Any assistance is much appreciated.

–Leavii


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @Leavii,

That’s great! I’m glad you were able to resolve the issue!

Let me know how the tests go. Additionally, try and increase your apache workers, they might be filling up as well. This setting can be increased in the main apache configuration file(not the one with your domain information in it).

Hi @Leavii,

Have you symlinked the conf file in the sites-enabled folder as well?

Additionally, once you enable the ServerName directive in your configuration file with a valid domain and restart apache, you should be able to reach that domain on port 80. I’m not sure why you are trying to reach it on port 8821.

Regards