How to connect LAMP server with Wordpress to the internet?

0

I have attempted to set up a LAMP server running Wordpress on a Raspberry Pi 3 (using Ubuntu Mate 16.04). Wordpress runs fine on the intranet (internally on the network) but I cannot seem to configure my setup so Wordpress can be accessed from the internet Word Press General Settings. This is my first time doing such a thing so please forgive me if I use wrong vocabulary, etc.

Everytime I attempt to access the web server from the internet I get "This site can't be reached" error message. I have an an ASUS router with built in DDNS. I have set up it and I have set up port-forwarding to the IP address of the Raspberry Pi; port I assigned is 3333.

Here is my snippet of my apache2.conf

<Directory />
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride All
   Require all granted
</Directory>

<Directory /usr/share>
   AllowOverride None
   Require all granted
</Directory>

<Directory /var/www/>
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride All
   Require all granted
</Directory>

Here is a snippet of my ports.conf

Listen 80
Listen 3333

<VirtualHost *:3333>
DocumentRoot /var/www/html
ServerName www.supernaturalmath.asuscomm.com

#Other directives here
</VirtualHost>

Here is a copy of my 000-default.conf

<VirtualHost *:3333>
    ServerName www.supernatural.asuscomm.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

I hope someone can help me out with this.

Thanks

user3026582

Posted 2016-04-30T20:59:18.507

Reputation: 1

Did you forward the port from your router to your Raspberry Pi 3's IP address? Are you testing it with the IP or a host name? – Julie Pelletier – 2016-04-30T21:30:36.447

Yes, I did forward the port from my router to my Pi's IP address; that is is how I can access my Pi from within the network. I'm also testing it with both the IP address and with 'supernaturalmath.asuscomm.com' but not the hostname. – user3026582 – 2016-04-30T22:39:53.837

IP forwarding in the router has no effect locally. Just to be sure, did you enable port forwarding on port 3333 in your router? Either it's not the case or your PI's firewall blocks the connection from the outside. – Julie Pelletier – 2016-04-30T23:59:54.173

Why would it do that if DDNS is built into the router?

I disabled the firewall temporarily and the server is not available.

Oh, let me check the firewall on the PI. – user3026582 – 2016-05-01T00:15:22.453

I did enable port forwarding on port 3333 on the router.

I also checked on the PI's firewall and it is disabled.

I ping supernaturalmath.asuscomm.com from my Android phone with the 4G connection and it there seems to be no losses. So I'm thinking it might be a configuration from the Apache or WordPress side. – user3026582 – 2016-05-01T00:22:13.440

It's possible, but pinging your router's IP tells us nothing about the functioning of the port forwarding towards your PI. – Julie Pelletier – 2016-05-01T01:29:58.627

One thing that might be interesting is trying to connect from your LAN using your public IP on port 3333 to see what happens. Most routers will redirect the connection internally and the test would therefore not be affected by filtering rules. – Julie Pelletier – 2016-05-01T01:32:14.483

I figured it out. It was how I port-forwarded the port on the router! I had the port range of 3333 but the local port was set to a different number. When I deleted this configuration and re-inputted it where the port range and local port are 3333 I saw my website on my Android phone using 4G.

Thanks Julie for your help and your time. Muah! – user3026582 – 2016-05-01T02:02:18.390

Answers

0

The first things to check in such cases are:

  • disabling the firewall to see if it's responsible for the issue
  • test the connection locally with the local port
  • verify the router's port forwarding configuration to make sure that the proper public and private ports are set

Julie Pelletier

Posted 2016-04-30T20:59:18.507

Reputation: 2 065