Access wordpress from outside - Resolve local ip why?

1

1

I'm trying to set up wordpress on debian jessie.

I can access the site within my LAN but not from outside...

Port forwarding is set on my router from TCP 80 -> 192.168.1.150 (local ip wordpress server)

When i try to access it from outside, it's still trying to resolve my local ip (i see that on chrome which is saying "Waiting for 192.168.1.150...")

It works fine with apache2 default page. I have another web server and it works fine too.

  • Do i have to put something special in apache2 .conf file (maybe to preserve relative paths ?)

  • Do i have to change something in /etc/hosts ? I tried to add those lines

    127.0.0.1 mydomain.net 192.168.1.150 mydomain.net

But it's still the same...

Any help would be greatly appreciated !!

jaydee99

Posted 2017-02-13T17:08:46.440

Reputation: 55

If an external client, is getting redirected to 192.168.1.150, then your Apache configuration isn't setup to allow external clients to connect to it. – Ramhound – 2017-02-13T17:11:09.680

Then why is it working with apache2 default page ? – jaydee99 – 2017-02-13T17:12:26.533

Don't have enough information to speculate. Wordpress or Apache is not configured the correct way if it attempts to redirect your external client to an internal intranet ip address. – Ramhound – 2017-02-13T20:12:06.710

Answers

3

Wordpress will redirect you to the URL you have configured in:

Settings > General

My guess is you're getting to the wordpress engine, and it is redirecting you to the local IP. Just update "Wordpress Address (URL)" and "Site Address (URL)" to be your public IP address and you should be good.

Chris Satola

Posted 2017-02-13T17:08:46.440

Reputation: 61

Damn, you're good ! I spent 2 days trying to change /etc/hosts, trying to edit apache2 .conf files and modifying my router settings and it was as simple as that.

Works perfectly, now, thanx a lot ! – jaydee99 – 2017-02-14T11:24:40.553

No problem. Can you please mark my response as the answer? – Chris Satola – 2017-02-14T13:12:53.537