1

I setup a Wordpress server in a Raspberry Pi with nginx, MariaDB and ufw. I also setup the No-IP service. When I access the server from my local network (192.168.0.173) I get a fast response but when I try to access from the outside world the response is very slow (aarroyoc.noip.me). It loads, as I can see the title bar in the browser but it just keeps loading and loading.

I think Wordpress isn't the problem because when I access from local network the speed is fine. My router bandwith can't be a problem, I usually run game servers and I didn't experienced such problems.

I downloaded the frontpage using cURL and the response was fast, so the problem might be in the browser but I don't know what is making the web so slow.

Why do I get a fast response from local network browsers and cURL outside Internet but it's so slow on outside Internet browsers?

EDIT

Doing more tests I've found that PHPInfo is fast (http://aarroyoc.noip.me/phpinfo.php) from outside network but the Wordpress panel is slow (http://aarroyoc.noip.me/wp-admin/) only from the outside.

  • Have a look at this test - looks like the server is responding quite quickly and external resources are slowing it down. Not sure why it'd be fast inside the network and slow outside http://www.webpagetest.org/result/160613_3C_e7172af91c81953d60b2392fb6db275f/ – Tim Jun 13 '16 at 20:34

2 Answers2

4

That's because you set up your Wordpress server to redirect to your internal IP, 192.168.0.173. So when external clients try to reach your Wordpress server, they are being redirected to http://192.168.0.173/wp-login.php which will, of course, fail after a timeout. The same goes for your Wordpress homepage, there are a number of resources, like CSS and image files, that are being served from http://192.168.0.173 instead of http://aarroyoc.noip.me.

The reason why PHPInfo works, is because it's completely self-contained. Even the PHP logo is embedded into the HTML. Check the source to see what I mean.

Rouben
  • 1,272
  • 10
  • 15
  • No, the site is slow, because the browser is trying to download items from the site that reside on an IP address it can't contact. – Rouben Jun 13 '16 at 23:20
0

I don't know if this will help some people, because i got the same problem when i was setting up my wordpress and couldn't get around the problem. This was very annoying to me but i remember that i sucessfully configured without any problems once.

Whoever with researching and trying stuff to see what went wrong i've tried to configure the wp-config.php to use the database created with mysql/mariadb.

sudo mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
sudo nano /var/www/html/wp-config.php

 define( 'DB_NAME', 'wordpress' );

/** MySQL database username */ define( 'DB_USER', 'yourusername' );

/** MySQL database password */ define( 'DB_PASSWORD', 'yourpassword!' );

/** MySQL hostname */ define( 'DB_HOST', 'localhost' );

/** Database Charset to use in creating database tables. */ define( 'DB_CHARSET', 'utf8' );

/** The Database Collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );

and accessed https://api.wordpress.org/secret-key/1.1/salt/

Got my secrets key, deleted the lines and pasted the new ones.

And that got it working for me. Hope this helps someone.

Stuggi
  • 3,366
  • 4
  • 17
  • 34