Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2009
    Posts
    8
    Plugin Contributions
    0

    Default Apache Problem, Apache on our LAN not showing images/css

    Hi,

    I have an apache web server set up on my lan. It serves the public_html directory of one of it's users to the rest of the lan, and is not available outside of the lan. I have a Zen Cart installed on it. The Zen Cart works fine when it is accessed from the server itself, either via localhost or 192.168.x.x. from the other computers on the lan it seems that it is refusing to serve the images and css files, but the basic Zen Cart is more or less there. Running Ubuntu on all computers, second to latest version.

    Thanks for your help,

    Mark

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

    Default Re: Apache Problem, Apache on lan not working too well.

    In your configure.php files, you must use an HTTP_SERVER value which all the other computers on your LAN are able to understand.

    "localhost" is not valid, because it only applies to the computer you're using at the time.
    .

    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
    Jun 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    Dr. Byte,

    Thank you so much. I don't think I would have been able to figure that one out.


    Sincerely,

    Mark

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    I am using a similar set up at home on a Ubuntu 11.04 LAMP to develop my ZC sites.

    the includes/configure.php file looks something like this and works a treat:

    Code:
    /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/
    /***************       The 2 files should be kept separate and not used to overwrite each other.      ***********/
    
    // Define the webserver and path parameters
      // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
      // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
      define('HTTP_SERVER', 'http://192.168.x.x');
      define('HTTPS_SERVER', 'https://192.168.x.x');
    
      // Use secure webserver for checkout procedure?
      define('ENABLE_SSL', 'false');
    
    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
      // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
      define('DIR_WS_CATALOG', '/zen-cart-site/');
      define('DIR_WS_HTTPS_CATALOG', '/zen-cart-site/');
    
      define('DIR_WS_IMAGES', 'images/');
      define('DIR_WS_INCLUDES', 'includes/');
      define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
      define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
      define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
      define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
      define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
      define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');
    
      define('DIR_WS_PHPBB', '/');
    
    // * DIR_FS_* = Filesystem directories (local/physical)
      //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
      define('DIR_FS_CATALOG', '/var/www/dispensary/');
    
      define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
      define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
      define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
      define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
      define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
    
    // define our database connection
      define('DB_TYPE', 'mysql');
      define('DB_PREFIX', 'zen_');
      define('DB_SERVER', 'localhost'); // localhost works here
      define('DB_SERVER_USERNAME', 'whatever');
      define('DB_SERVER_PASSWORD', 'SOME_PASSword');
      define('DB_DATABASE', 'zencart');
      define('USE_PCONNECT', 'false');
      define('STORE_SESSIONS', 'db');
      // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage
    
      // The next 2 "defines" are for SQL cache support.
      // For SQL_CACHE_METHOD, you can select from:  none, database, or file
      // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
      // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
      // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
      define('SQL_CACHE_METHOD', 'none'); 
      define('DIR_FS_SQL_CACHE', '/var/www/zen-cart-site/cache');
    
    // EOF
    Anyone on the LAN wanting to access the zen-cart-site would type http://192.168.x.x/zen-cart-site/ in the browser address bar.

    192.168.x.x is the IP of the Ubuntu box where your LAMP is installed.
    Last edited by frank18; 25 Feb 2012 at 08:06 AM. Reason: added explanation of IP

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

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    Just be aware that sometimes you may run into problems with sessions working properly if you're running with an IP address specified in HTTP_SERVER, especially if you choose to enable SSL and put an IP address in HTTPS_SERVER. This is due to session-cookie problems associated with using an IP address instead of a proper FQDN. In reality this would never be a problem on a legitimate live store, but could cause troubles on a self-hosted PC-server at home or in a local LAN.

    There are various ways of setting up an understood FQDN that all the other PCs on your LAN would recognize. But that's an advanced networking concept way beyond the scope of Zen Cart itself.
    .

    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.

  6. #6
    Join Date
    Jun 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    Hi,

    If I use /etc/hosts to attach a name, say,
    "pine" to a computer on my local network, would this be sufficient to avoid the problems associated with using ip addresses in the configure.php files?

    /etc/hosts entry

    Code:
    192.168.x.x            pine
    If so, would the following configure.php work?

    Code:
    define('HTTP_SERVER', 'http://pine');
    define('HTTPS_SERVER', 'https://pine');
    Thanks,

    Mark

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

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    Mark,
    Yes, that works fine. I use that approach very often.
    .

    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.

  8. #8
    Join Date
    Jun 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: Apache Problem, Apache on our LAN not showing images/css

    Hi,

    Once again, thank you very much.

    Sincerely,

    Mark

 

 

Similar Threads

  1. Problem installing ZenCart - Apache HTTP crash
    By sodiska in forum Installing on a Windows Server
    Replies: 1
    Last Post: 31 Oct 2009, 08:49 PM
  2. Problem getting apache started on xampp
    By wwwursa in forum Installing on a Windows Server
    Replies: 8
    Last Post: 12 Aug 2008, 03:02 PM
  3. Apache not running after installation
    By InterSign in forum General Questions
    Replies: 1
    Last Post: 22 Apr 2008, 04:09 PM
  4. SLL Problem with Win2003 and Apache
    By mdotse in forum Installing on a Windows Server
    Replies: 4
    Last Post: 23 Apr 2007, 12:18 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