Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    2
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: Works great on host machine, but css/images don't load anywhere else...

    Quote Originally Posted by DrByte View Post
    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

 

 

Similar Threads

  1. v151 installed css fly out menu lokks great but is crowding center column text.
    By itcetera in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Jan 2013, 02:03 AM
  2. Orders don't show up, but Paypal works
    By fluffysam in forum Managing Customers and Orders
    Replies: 11
    Last Post: 20 Oct 2009, 12:42 AM
  3. Attributes - Works fine but TMO: Don't want to display weights of item
    By eliseintaipei in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 31 Jul 2008, 03:40 PM
  4. New Host - Frontend Down but Admin works
    By NamSingh in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 26 Feb 2007, 11:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR