Works great on host machine, but css/images don't load anywhere else...
Hi. I run a lamp ubuntu server. I just installed zen cart to play around with it and I come to realize that though everything works great when I view the page on http://localhost, it doesn't load images or stylesheets on any other machine on my network. (or from another computer on the web.)
I've looked all over for an answer to this and it's driving me crazy.
I can directly link to a stylesheet and can see the contents in my browser but the html/php files can't seem to include them. Any ideas? I tried chmod'ing everything to 777. No luck.
HALP!
Thanks ahead of time.
Re: Works great on host machine, but css/images don't load anywhere else...
First, what you're asking is not a Zen Cart-specific question. It's a general networking question suited for your IT person or whoever is responsible for running the servers and webservers in your organization.
The reason your images and stylesheets etc aren't loading is because you've called your domain "localhost".
If you study networking, you'll find that "localhost" always refers to "the computer I'm sitting at".
Thus, since your ubuntu server is storing the images and calling itself "localhost", it is producing URLs for images that look like "http://localhost/images/abcd.jpg" ... but, since someone running from their own computer doesn't have an "/images/abcd.jpg" on *their* "localhost", there is no image displayed.
To fix it, you need to give a name to your domain on your ubuntu server. That name needs to be accessible by everyone else who accesses your server. Then that name needs to point to the IP address of your ubuntu server, as reachable by everyone who needs to access it. For people inside your office/network, you can configure EACH separate computer to know the IP address of the custom name you give to your server. But, if you want people OUTSIDE your office (you said "on the web"), then you'll need to give it a real domain name that you register with a proper Internet registrar.
But, since the topic is really unrelated to Zen Cart specifically, it's best to take your questions about how to run a webserver to a forum where that's the main topic of discussion, such as webhostingtalk.com
Then there's the matter of properly securing that server so that hackers can't get into it. You can deal with that at webhostingtalk.com too, or at any of many other websites that deal with webserver security.
Once you've secured your server thoroughly and you've got it server accessible from all the different points you need to access it, if you need Zen Cart support, come on back for that.
The only part of the "solution" that affects Zen Cart is that when you finally choose and assign a domain name to your server and your website, you'll need to also change the 2 configure.php files in your Zen Cart files to no longer say "localhost", but the actual domain name.
Re: Works great on host machine, but css/images don't load anywhere else...
Quote:
Originally Posted by
DrByte
First, what you're asking is not a Zen Cart-specific question. It's a general networking question suited for your IT person or whoever is responsible for running the servers and webservers in your organization.
The reason your images and stylesheets etc aren't loading is because you've called your domain "localhost".
If you study networking, you'll find that "localhost" always refers to "the computer I'm sitting at".
Thus, since your ubuntu server is storing the images and calling itself "localhost", it is producing URLs for images that look like "http://localhost/images/abcd.jpg" ... but, since someone running from their own computer doesn't have an "/images/abcd.jpg" on *their* "localhost", there is no image displayed.
To fix it, you need to give a name to your domain on your ubuntu server. That name needs to be accessible by everyone else who accesses your server. Then that name needs to point to the IP address of your ubuntu server, as reachable by everyone who needs to access it. For people inside your office/network, you can configure EACH separate computer to know the IP address of the custom name you give to your server. But, if you want people OUTSIDE your office (you said "on the web"), then you'll need to give it a real domain name that you register with a proper Internet registrar.
But, since the topic is really unrelated to Zen Cart specifically, it's best to take your questions about how to run a webserver to a forum where that's the main topic of discussion, such as webhostingtalk.com
Then there's the matter of properly securing that server so that hackers can't get into it. You can deal with that at webhostingtalk.com too, or at any of many other websites that deal with webserver security.
Once you've secured your server thoroughly and you've got it server accessible from all the different points you need to access it, if you need Zen Cart support, come on back for that.
The only part of the "solution" that affects Zen Cart is that when you finally choose and assign a domain name to your server and your website, you'll need to also change the 2 configure.php files in your Zen Cart files to no longer say "localhost", but the actual domain name.
Thank you SOOOO much. I appreciate your input. Without even looking into it I can already tell that's what I did wrong. I'm new to linux and this is my first live lamp setup and I've already screwed it up it seems. I'm really excited to get to play with zen-cart as soon as I get this tiny kink worked out. Thanks again--
Cheers