clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Accessing LAMP and WordPress remotely

Sat Feb 09, 2019 7:28 pm

Hello

I am new to networking but have set up a LAMP web server using the instructions on the projects section of the Pi website: https://projects.raspberrypi.org/en/pro ... ordpress/9
I have created a title page using WordPress. I can access this page perfectly on my local network.
I have then tried to connect to it remotely.
To do this I have:
- enabled remote access on my router and forwarded port 80 to the local IP address of my Pi that has the apache server loaded
- I have checked this port is open using a port checking tool like YouGetSignal.
- I have checked the ports.config file in /etc/apache2 and there is a line that says Listen 80
- I then try to connect to my web page using my phone (wifi switched off) and entering the public IP of my router into the browser address
line
- This just gives the following error: 'Your search - XX.XX.XX.XX:80 - did not match any documents'.
- I have tried it with and without the port number and with port number and path www/html/index.php

I would be very grateful if anyone can help me with this.
Thanks.

Andyroo

Re: Accessing LAMP and WordPress remotely

Sat Feb 09, 2019 7:57 pm

Do you have a httpd.conf file?

You should find this in /etc/apache2 or if it’s installed elsewhere by following http://www.commanigy.com/blog/2011/6/8/ ... f-location
and make sure you have:

Code: Select all

Listen *:80
in it.

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Sat Feb 09, 2019 8:23 pm

Thanks for your help. There is no httpd.conf in /etc/apache2 but there is a ports.conf which has Listen 80 in it. Do I need a httpd.conf as well.
Regards
C

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Sat Feb 09, 2019 8:44 pm

Created file httpd.conf with Listen *:80. No improvement. Using another browser I get "XX.XX.XX.XX didn't send any data".

fbe
Posts: 526
Joined: Thu Aug 17, 2017 9:08 pm

Re: Accessing LAMP and WordPress remotely

Sat Feb 09, 2019 10:23 pm

Is XX.XX.XX.XX the IP Address of your Raspberry Pi or the public IP Address of your router?

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 8:17 am

The public address of the router.

bls
Posts: 257
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 3:49 pm

Dumb question: Are you actually typing XX.XX.XX.XX:80 into the browser or http://XX.XX.XX.XX:80 ? If you're not using http:// try adding that. If that fails also, is there anything useful in the logs in /var/log/apache2/?

Andyroo

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 6:34 pm

One thought could be your ISP is blocking port 80.

Try forwarding another to externally to port 80 internally and then seeing if that works by http://x.x.x.x:<new port> from your phone.

One way to save mobile data costs by the way (or in my case test things as I get virtually no mobile coverage in the village) is to use a proxy server on the internet e.g. https://www.proxysite.com

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 7:53 pm

Hi bls - tried both - when adding http I get the "XX.XX.XX.XX didn't send any data" error.

Hi Andyroo - I'll try doing what you say. I have a Pi 'security camera running on a different port (not 80) and that works fine.

bls
Posts: 257
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 8:21 pm

Good point, Andyroo. Using an external port other than 80 also increases security through obfuscation.

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 9:13 pm

I tried using another port (I made the internal and external ports the same) and modified ports.conf to listen on that port. Still not able to access. I have also noticed that while on the local network I can see my shiny new Wordpress website I cannot interact with it eg responding to a post. I get "localhost refused to connect". I wonder if that is related to my original problem. Thanks for your help so far - if this should work and just isn't, maybe I should just reflash raspbian and start again.

Andyroo

Re: Accessing LAMP and WordPress remotely

Sun Feb 10, 2019 9:31 pm

bls wrote:
Sun Feb 10, 2019 8:21 pm
Good point, Andyroo. Using an external port other than 80 also increases security through obfuscation.
Any decent port scanner will pick up http or https support on any port :( It may only take a few seconds longer but most scans are automated to start with.

clintonlucas
Posts: 13
Joined: Sun Apr 27, 2014 11:15 am

Re: Accessing LAMP and WordPress remotely

Mon Feb 11, 2019 6:12 pm

In case it may help anyone else with similar problems I have found the solution . I could not access the apache server from an external computer because my router (Virgin Hub 3.0) has a setting allows external computers to access the hub settings. It does this on port 80 and was enabled. I guess all my attempts to access the apache server were simply being redirected to the router software. Maddening!! Thanks for trying to help.

Return to “Networking and servers”