BigEric
Posts: 2
Joined: Wed Apr 03, 2019 6:06 pm

Accessing LAMP and WordPress Remotely (Second Thread)

Wed Apr 03, 2019 7:06 pm

Experiencing problems in accessing WordPress from the Internet.

Following on from a previous (solved) thread viewtopic.php?f=36&t=233297&sid=e3b6830 ... a1808c4cf6

Thought I’d use this to help others in early diagnostics and appeal for help too.

Have a Rasberry pi 3+ with Apache2, PHP and Wordpress.
All works fine on local network but cannot access remotely from the Internet.

Router is adjusted to route an obtuse port to Port 80 and using a dynamic DNS service to maintain external IP.

Wordpress was configured to accept inbound calls rather than localhost by editing (Leafpad)

Code: Select all

sudo leafpad /var/www/html/wp-content/themes/twentysixteen/functions.php
Adding the following

Code: Select all

update_option( 'siteurl', 'http://account.dns.org' );
update_option( 'home', 'http://account.dns.org' );
Access from the internet provides white screen of death.

With several moving parts, external DNS / ISP / Router / pi / Apache / PHP and Wordpress I did the following.

Copy /var/www/html/index.php to a safe name.

Edit /var/www/html/index.php to replace WordPress supplied PHP with this as a test home page.

Code: Select all

<?php echo "hello world"; ?>
<?php echo date('Y-m-d H:i:s'); ?>
<?php phpinfo(); ?>
Restart Apache using command

Code: Select all

sudo systemctl reload apache2
From a browser using URL http://account.dns.org:9999 and I get the PHP test page.

So that proves external DNS / ISP / Router / pi / Apache / PHP work as designed. QED

BUT still getting white screen of death after I replace index.php with WordPress version. Is there something else I need to change in WordPress config to allow / support access from external network?

Oddly, wp-admin logon page can be accessed from the internet http://account.dns.org:9999/wp-admin but after providing login credentials I get Page Not Found.

Andyroo
Posts: 4159
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Accessing LAMP and WordPress Remotely (Second Thread)

Thu Apr 04, 2019 12:18 am

Have you set up .htaccess wth rewrite rules?
Have you set up permanent-links in WP?
Do you have the rewrite module loaded and activated?
What does your default site definition look like and is it enabled (would expect so else the internal would be odd)...

Some details on the file can be found here https://blog.templatetoaster.com/wordpr ... ile-guide/ and the mod_rewrite is https://httpd.apache.org/docs/2.4/rewri ... pping.html

Do you have a link to how you set the site up?
Need Pi spray - these things are breeding in my house...

BigEric
Posts: 2
Joined: Wed Apr 03, 2019 6:06 pm

Re: Accessing LAMP and WordPress Remotely (Second Thread)

Fri Apr 12, 2019 3:56 pm

Thanks, checked all these and all config working as per normal.

To answer your question about WordPress installation process, I used this one:

https://projects.raspberrypi.org/en/pro ... -wordpress

Although I need to add a comment that you need to add the relevant PHP GD Library to the installation:

Code: Select all

sudo apt-get install php7.0-gd
Also checked the permissions and all OK. Not surprised that this was all good as all the WordPress functions worked fine when developing site on local LAN.

Permissions and memory check process documented here:

https://kinsta.com/blog/wordpress-white ... -of-death/

RESOLVED

White Screen of Death (WSOD) only occurs on access from Internet. Found this to diagnose the problem using View Source.

https://www.devside.net/wamp-server/web ... cs-missing

This shows that the CS style and Graphics / images have embedded URL set at the time when these are selected / loaded. So using local IP address in General / Settings for WordPress Address (URL) and Site Address (URL) that local URL is loaded in these CS Style sheets and Graphovs / Images. So cannot be located when site accessed from external internet.

NOTE : URL is not updated in CSS Style sheets or Graphics / Images if you change General / Settings for WordPress Address (URL) and Site Address (URL)

Have deleted images, updated General / Settings for WordPress Address (URL) and Site Address (URL) to show external URL and reloaded graphics / images and selected different profile to ensure CSS style sheets reloaded and now all works as expected.

Andyroo
Posts: 4159
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Accessing LAMP and WordPress Remotely (Second Thread)

Fri Apr 12, 2019 6:56 pm

One of the killers in WordPress is the embedding of URLs in the database rather than relative locations. The media folder is the worst for this as these get embedded in page source aswell :twisted:

Glad you find out what it was. Others may want to load a plug-in to do the rename in future if they are not SQL coders. This one worked fine with a couple of migrations I did last year https://en-gb.wordpress.org/plugins/search-and-replace/ though more and more of the migration tools are doing this as part of either the extract or restore phase :roll:
Need Pi spray - these things are breeding in my house...

alexmorco
Posts: 1
Joined: Thu May 09, 2019 1:15 pm

Re: Accessing LAMP and WordPress Remotely (Second Thread)

Thu May 09, 2019 1:33 pm

It happens due to a slow server response or heavy load time, You may check the root directory or there's another solution of choosing managed WordPress server that offers managed platform with auto backup and high security.

Return to “Networking and servers”