Zen Cart Logo
Forums / Installing on a Linux/Unix Server / Cannot view/edit site on local network

Cannot view/edit site on local network

Views: 1,291

Results 1 to 4 of 4
17 Feb 2012, 10:07 AM
#1
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Cannot view/edit site on local network

Hi,
We recently installed 4 zen cart stores on a dedicated LAMP server.

Two of them are rebuilds of existing sites we were previously hosting elsewhere (one on 1.5 and one on 1.39)

Prior to the domains being changed I was accessing them via the server's IP on our LAN. I had the servers in each store's includes/configure.php and MY_ADMIN/includes/configure.php files pointing to this IP address. As soon as we redirected the domain names to our server I changed the configure files so they were pointing to the web addresses.

Now I can see both sites... but only if I'm not accessing them on the network! Because the IP address of the server is the same as our router, if I type in the url I get diverted to the router's login page.

I can see the sites by typing in the server's name on the network, but no images are displayed... and the admin pages aren't accessible either. So I assume this is to do with the paths in the configure.php files which I had to change to the stores' web addresses - I can see the other two sites on the server with no problems as they're not yet live.

I know this is probably something to do with our router rather than Zen Cart itself, but just wondered if anyone else has had this problem and how it can be solved.

17 Feb 2012, 11:14 AM
#2
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Cannot view/edit site on local network

Solved! It's taken me half the morning to find this, posting the solution in case it helps somebody else out.

Find the "hosts" file (there's no extension) on the computer you want to access the sites - on Windows it's in C:\windows\system32\drivers\etc\hosts
on Linux it's etc/hosts

and add the following lines:

192.168.0.x https://www.mydomain1.com
192.168.0.x https://www.mydomain2.co.uk
192.168.0.x https://www.mydomain3.net

where 192.168.0.x is the internal IP address of your server.

You'll need to do this for every computer on your LAN that you want to view the sites.

See http://brisray.com/comp/cwserver2.htm for more information.

17 Feb 2012, 12:49 PM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Cannot view/edit site on local network

igi2011:

Solved! It's taken me half the morning to find this, posting the solution in case it helps somebody else out.

Firstly, let me congratulate you on finding a solution.

Now, if you don't mind me saying, there is a better way, that doesn't require you to modify the hosts file for every computer on the LAN. Set up your own local DNS It only needs to be authoritive for your LAN clients and it can also act as a caching server. This will not only avoid the need to edit the hosts files, but will also provide a measurable performance increase (and reduction in data usage) for most network related activities.

Local DNS servers are pretty much a one click installation these days.

Oh, I followed the link to the website that you gave, and need to state that a lot of the stuff on that page is either incorrect, outdated, or simply bad practice.

For example. the use of "*" wildcard for host entries. Very bad practice with known exploits.

There is talk of how to setup and run a server on dynamic IP address, with no mention that SSL is impossible with such a scenario.

Comments such as "Windows 2K just got glitchy over time" (shows not only how dated this page is, but implies that "glitches" are somehow "time" related and anyone that knows how a computer works will know how silly this concept is)

It also perpetuates 'common misinformation', such as
"It can take up to 72 hours for the IP address to be propagated throughout the Internet, but I usually find it's done in a couple of hours", which shows the author doesn't understand nameserver delegations or TTL settings.

Anyway I once again congratulate you on finding a workable solution (there are also other solutons, such as proxy servers and DMZ's) but these tend to be a little more difficult to configure.

Without knowing your business requirements I can't say what will be best for you, but if/where possible, I tend to steer people towards the use of a DMZ solution (better security), often in conjunction with the DNS and/or Proxy solutions.

Cheers
Rod

20 Feb 2012, 3:50 PM
#4
igi2011 avatar

igi2011

New Zenner

Join Date:
Oct 2011
Location:
Kent, UK
Posts:
50
Plugin Contributions:
0

Re: Cannot view/edit site on local network

Thanks for the helpful suggestion Rod - I'm very new to Linux but will certainly have a look at installing a local DNS.
Cheers
Lee