cancel
Showing results for 
Search instead for 
Did you mean: 

Wordpress on local LAMP server problems with login

johnboy84
Newbie
Posts: 2
Registered: ‎17-04-2015

Wordpress on local LAMP server problems with login

Hi guys, my first post so any help would be greatly appreciated!!  Wink
Ive been having a bit of a nightmare trying to setup a simple wordpress site on a LAMP server I have setup on my local network.
I'm a bit new to all this so please correct me if I make any blundering errors.
So where to start  Undecided
I have installed virtualbox on my 2008 mac pro, created a virtual machine onto which I have installed ubuntu server, apache2, php, mysql etc all fine.
Set my network adapter in virtualbox to bridged adapter, so I get an individual ip for the virtual machine.
I have then created a database in mysql and given the correct permissions all ok (i think)
I've then downloaded the latest version of wordpress with wget command and installed to root directory and then moved to /var/www/html
From there Ive gone through the standard wordpress install and amended the wp-config.php file etc
All ok...so far
At this point in time Im just connecting to my wordpress site and admin page through the local ip address in firefox.and all is ok.
I then setup port forwarding in my plusnet thompson router for the ip of the server with (games and applications http-worldwideweb)
Now all is fine connecting from any computer on my network via the local ip but if I try to connect from a external connection, through my external Ip address, it will get to the wordpress login but it is not displaying the css properly and doesn't login to the admin page.
I have my domain from namecheap and have setup their dns client on another computer on my network to forward my external ip to an A-address with hostname @ (sry I prob not explaining this properly, my knowledge if poor, but it seems to work ok)
So... I then go back into my wordpress admin page locally and go to general settings and change the site URL and web URL to http://board-london.com as I thought maybe wordpress wasn't linking with the server correctly but as soon as I hit save I am logged out and now have the complete reverse in that I can now access the site at the above URL externally but when trying to connect locally I get the css problem where the login page doesn't look right or function at all Sad
SSH works fine btw
Sorry I know this is long winded so if you've gotten to the bottom of this post I commend you and really appreciate your time!!!
Any help would be great and if you need any more info please let me know.
Thanks
John.

3 REPLIES 3
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,887
Thanks: 4,979
Fixes: 316
Registered: ‎04-04-2007

Re: Wordpress on local LAMP server problems with login

Quote from: johnboy84
So... I then go back into my wordpress admin page locally and go to general settings and change the site URL and web URL to http://board-london.com as I thought maybe wordpress wasn't linking with the server correctly but as soon as I hit save I am logged out and now have the complete reverse in that I can now access the site at the above URL externally but when trying to connect locally I get the css problem where the login page doesn't look right or function at all Sad

Hi John,
Are you trying to connect locally using the domain name? It could be that your router doesn't do 'loopback' very gracefully.
You might want to try adding an entry to your hosts file that points the domain to the local IP of the Wordpress install, e.g.
127.0.0.1               board-london.com

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

johnboy84
Newbie
Posts: 2
Registered: ‎17-04-2015

Re: Wordpress on local LAMP server problems with login

Hi Bob,
Thanks for the reply!
Yes I'm trying to connect locally using the domain name and having bug about quite a bit and it does sound like its a router loopback issue or poss NAT tables?
Please excuse the ignorance but where/what is the host file?
I'm using the Technicolor TG582n FTTC supplied by Plusnet if that is of any interest.
Much appreciated!
John
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,887
Thanks: 4,979
Fixes: 316
Registered: ‎04-04-2007

Re: Wordpress on local LAMP server problems with login

Quote from: johnboy84
Please excuse the ignorance but where/what is the host file?

In MacOS you'll find it at /private/etc/hosts
Although, come to think of it, the the VM will probably have it's own hosts file. In Ubuntu the hosts file is located at /etc/hosts
Note that I've never personally attempted this set-up using a VM so I can't be confident that what I'm suggesting will work. It's low risk and easy enough to revert the change if it doesn't though.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵