Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Aug 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Need Help with accessing my new store through an IP address (No Domain Name)

    I am currently testing a brand new server. My hosting company already copied my entire site and I have successfully tested it, including dummy test transactions in TEST mode and a bad credit card in PRODUCTION mode. All is working very well.

    I also followed the tutorial to create a brand new Zen Cart 1.5.5a version to check the configure.php settings. All was still okay and the new test site vs the new production are similar in the configure.php file.

    However, I would like to run some speed tests to compare my old Zen Cart website (has the domain name) against the new Zen Cart website. I can fake the Domain by changing the hosts file and IP address on my local machine (PC or Mac), but I cannot seem to access the new Zen Cart through the new IP address.

    I thought all I would need to do is change the references in the includes\configure.php like this (IP addresses are fake):

    define('HTTP_SERVER', 'http://111.111.111');
    define('HTTPS_SERVER', 'https://111.111.111');

    I also cleared my cache on the browser and I am using my Mac WITHOUT the host file changes to the new IP address. There are no errors logs at my hosting company level in the cPanel, no error logs in the Zen Cart directory, log directory or cache directory.

    Any advice or what could be wrong or how to debug this?

    Using:
    Zen Cart 1.5.5a
    Server OS:##Linux 3.12.57-157.ELK6.x86_64
    Database:##MySQL 5.6.29-76.2
    HTTP Server:##Apache
    PHP Version:##7.0.6 (Zend: 3.0.0)

    Thanks,
    Marissa

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,696
    Plugin Contributions
    9

    Default Re: Need Help with accessing my new Zen Cart through an IP address (No Domain Name)

    as far as debugging this, i would look at the apache logs for the IP address. that should tell you what is going wrong... or at least where to look next.

    you can test whether apache is serving up the right pages by adding a simple file (text or otherwise) in the store's root directory and see if you can get there via the IP address. ie, create a test.txt with 'hello larry' in it, and then go to:

    http://111.111.111.111/test.txt

    and see if you see 'hello larry'

    as a side note, your example IP address is missing 1 octet.

    good luck!

    good luck!
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Aug 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Re: Need Help with accessing my new Zen Cart through an IP address (No Domain Name)

    Unfortunately, there are no logs anywhere. I did put a phpinfo() file and cannot get it to display.

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need Help with accessing my new Zen Cart through an IP address (No Domain Name)

    Quote Originally Posted by mandolin View Post
    I can fake the Domain by changing the hosts file and IP address on my local machine (PC or Mac),
    Don't do that. It will probably cause more problems that the one you are trying to solve.

    Quote Originally Posted by mandolin View Post
    but I cannot seem to access the new Zen Cart through the new IP address.
    This is probably because the *server* doesn't know anything about the 'fake' domain name that you are using.

    Quote Originally Posted by mandolin View Post
    I thought all I would need to do is change the references in the includes\configure.php like this (IP addresses are fake):

    define('HTTP_SERVER', 'http://111.111.111');
    define('HTTPS_SERVER', 'https://111.111.111');
    Using the IP addresses will work, but you will also need to set the correct path in the config files so the server knows what files to use.

    Since you already have a working domain name, and assiming both sites are on the same server, you can/should continue to use the existing domain name, then as with the IP address method, you'll need to set the DEFINE_*S paths to where the new files are located.

    Example:

    Old site:
    define('HTTP_SERVER', 'http://yourdomainname.com');
    .......
    define('DIR_WS_CATALOG', '/' ) ; (assumes old site is in the root folder on the server)
    ......

    New site:
    define('HTTP_SERVER', 'http://yourdomainname.com');
    .......
    define('DIR_WS_CATALOG', '/newSiteFiles/' ) ; (assumes new site is in a folder called 'newSiteFiles' on the same server)
    ......


    Basically, the 'SERVER' settings tell your browser *and the server* where your *site/domain* is to be found on the interwebs
    The DIR settings tells ZENCART where the files are located on the server.

    With these settings, the 'old' store will be found by pointing your web browser to
    http://yourdomainname.com
    The *new* store will be found by pointing your web browser to
    http://yourdomainname.com/newSiteFiles/

    *Note: I've only used two config settings from each site as an example. Needless to say(?), the HTTPS and other folder settings will also need to be configured to where the zencart files are actually located.

    Cheers
    RodG

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

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    Quote Originally Posted by mandolin View Post
    I can fake the Domain by changing the hosts file and IP address on my local machine (PC or Mac), but I cannot seem to access the new Zen Cart through the new IP address.
    What exactly do you mean by "I cannot seem to access the new cart through the new IP address."? Does "cannot access" mean "I get a 404-not-found error"? or a red-screen with no content? Or an error in your browser, perhaps something like "unreachable"?
    Or does it just mean "I can see my store, but I can't login or put something in my shopping basket"?


    It's not unusual for "using an IP address as the domain name" to cause login challenges. More reliable is to edit your hosts file and assign a domain name to the IP address, and use that domain name.


    And, yes, you are correct that the only place it must be configured in Zen Cart is HTTP_SERVER in the configure.php files (and since you probably don't have an SSL cert for that temporary domain, set ENABLE_SSL to 'false' temporarily while using that temporary 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.

  6. #6
    Join Date
    Aug 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    Quote Originally Posted by DrByte View Post
    What exactly do you mean by "I cannot seem to access the new cart through the new IP address."? Does "cannot access" mean "I get a 404-not-found error"? or a red-screen with no content? Or an error in your browser, perhaps something like "unreachable"?
    Or does it just mean "I can see my store, but I can't login or put something in my shopping basket"?
    Let me clarify. On my Mac without the new server's dedicated IP address in the hosts file, I am unable to access the "http://111.111.111/" or "http://111.111.111/index.php" addresses. I also tried with a simple phpinfo file that does work perfectly on my PC that has the new IP address with the old domain name in the PC hosts file. All the attempts on the Mac come back with a 404. Looking on the cPanel on my host, there are no errors in the error log. Looking through through the filesystem via the cPanel, there are no error logs anywhere at the root directories or down in the Zen Cart filesystem (logs, cache, admin_renamed, etc).

    Quote Originally Posted by DrByte View Post
    It's not unusual for "using an IP address as the domain name" to cause login challenges. More reliable is to edit your hosts file and assign a domain name to the IP address, and use that domain name.
    Right, on the PC with the old domain mapped to the new server IP in the hosts file, the new server and Zen Cart work perfectly, including test transactions and a dummy test transaction went all he way through to my credit card processor and was successfully rejected. The new server successfully passed all my test and is ready for my hosting company to switch the domain name over when I tell them.

    Quote Originally Posted by DrByte View Post
    And, yes, you are correct that the only place it must be configured in Zen Cart is HTTP_SERVER in the configure.php files (and since you probably don't have an SSL cert for that temporary domain, set ENABLE_SSL to 'false' temporarily while using that temporary domain name).
    So, in the includes\configure.php file, I have the following:
    PHP Code:
    define('HTTP_SERVER''http://111.111.111');        //    removed my actual IP address
    define('HTTPS_SERVER''https://111.111.111');    //    removed my actual IP address

    define('ENABLE_SSL''');                                //    will change this back to true when I go live

    define('DIR_WS_CATALOG''/');
    define('DIR_WS_HTTPS_CATALOG''/');

    define('DIR_FS_CATALOG''/home/my_account/public_html/');        //    removed my actual directory

    define('DB_TYPE''mysql');                                                         // always 'mysql'
    define('DB_PREFIX''');                                                                 // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET''utf8');                                                         // 'utf8' or 'latin1' are most common
    define('DB_SERVER''localhost');                                                  // address of your db server

    define('DB_SERVER_USERNAME''sql_account');                        //    removed my actual username
    define('DB_SERVER_PASSWORD''sql_password');                    //    removed my actual password
    define('DB_DATABASE''DB_Name');                                            //    removed my actual DB name

    define('SQL_CACHE_METHOD''none');
    define('SESSION_STORAGE''temporary value added by zc_install'); 
    And in the admin_name_changed\includes\configure.php file, I have the following:
    PHP Code:
    define('HTTP_SERVER''https://111.111.111');                                //    removed my actual IP address

    define('HTTP_CATALOG_SERVER''http://111.111.111');                //    removed my actual IP address
    define('HTTPS_CATALOG_SERVER''https://111.111.111');            //    removed my actual IP address

    define('ENABLE_SSL_CATALOG''');                                            //    will change this back to true when I go live

    define('DIR_WS_CATALOG''/');
    define('DIR_WS_HTTPS_CATALOG''/');

    define('DIR_FS_CATALOG''/home/my_account/public_html/');        //    removed my actual directory

    define('DB_TYPE''mysql');                                                         // always 'mysql'
    define('DB_PREFIX''');                                                                 // prefix for database table names -- preferred to be left empty
    define('DB_CHARSET''utf8');                                                         // 'utf8' or 'latin1' are most common
    define('DB_SERVER''localhost');                                                  // address of your db server

    define('DB_SERVER_USERNAME''sql_account');                        //    removed my actual username
    define('DB_SERVER_PASSWORD''sql_password');                    //    removed my actual password
    define('DB_DATABASE''DB_Name');                                            //    removed my actual DB name

    define('SQL_CACHE_METHOD''none');
    define('SESSION_STORAGE''temporary value added by zc_install'); 
    So, before I go live, I want to run the new server and Zen Cart through third-party tests. I was successful with my PCI compliance company to have them scan the new dedicated IP address for any PCI vulnerabilities, but I also want to run the new server website throught some PageSpeed and WebPageTests. I can't do that without the proper way to publicly get to the website through the IP address. I am sure there is something simple to fix this, but it is escaping me.

  7. #7
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    mandolin
    Can we try a slightly different approach?

    Are both the old and the new sites hosted on the same server? If yes, please follow the examples that I previously gave. You will NOT need to use the IP numbers.

    If however the new site is hosted on a *different* server (one that is currently only accessible via its IP address) and it is a VPS , in other words, yours is the only website on the host, then your settings
    define('HTTP_SERVER', 'http://111.111.111');
    define('DIR_WS_CATALOG', '/');

    Should probably work... but as you say, you are missing something simple.

    However, if the server is NOT a VPS and/or has *other* websites hosted on it, then your config settings will need to be something like
    define('HTTP_SERVER', 'http://111.111.111');
    define('DIR_WS_CATALOG', '~/my_account/');
    or
    define('DIR_WS_CATALOG', '/home/my_account/');

    You will NOT need to enter the folder paths into the address bar in your browser.

    Cheers
    RodG

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    Quote Originally Posted by mandolin View Post
    Let me clarify. On my Mac without the new server's dedicated IP address in the hosts file,
    Dont mess with the hosts file. That is going to add a complication that you don't need. You will be able to get things working for youself this way, but it wont work for anyone else.
    Quote Originally Posted by mandolin View Post
    there are no error logs anywhere at the root directories
    This comment has me concerned and confused. There should only be ONE root directory for any given account. For there to be more than one "root" would imply that that have have what cPanel calls an "Add on Domain" (or perhaps a parked domain), but if this is the case you wouldn't be needing to use an ip address.

    Please dont get me wrong here, I'm not really questioning what you are saying, I'm just trying to get a better idea about the server setup, because knowing this is essential before we can really start to consider the zencart configuration settings.

    Cheers
    RodG

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

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    If I understand correctly, your new site works fine when you have a domain name set for it, but right now you don't "own a spare domain" ..... but you need one in order to do the 3rd-party testing you desire.

    So, go get a free domain by signing up at https://www.noip.com ... you get to set your domain name (ie: whatever.hopto.org) .... This will add a Host and set an "A" record ... you'll be prompted for the IP address so give it the temporary IP address and Save. Then put that domain name in your configure.php files until you go live.

    EDIT: The above idea will work ONLY if your server doesn't require explicit definition of the domain name within Apache (or whatever webengine it's running). If it requires specific vhosts to be declared, then you'll need to do all that setup too for the custom domain name so that the server knows what directory to find the files for that domain.
    Or, as RodG pointed out, use cPanel to add the Addon/Parked domain to accomplish the same.
    Last edited by DrByte; 27 Jul 2016 at 09:59 PM. Reason: vhost comment
    .

    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.

  10. #10
    Join Date
    Aug 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Re: Need Help with accessing my new store through an IP address (No Domain Name)

    Quote Originally Posted by RodG View Post
    However, if the server is NOT a VPS and/or has *other* websites hosted on it, then your config settings will need to be something like
    define('HTTP_SERVER', 'http://111.111.111');
    define('DIR_WS_CATALOG', '~/my_account/');
    or
    define('DIR_WS_CATALOG', '/home/my_account/');

    You will NOT need to enter the folder paths into the address bar in your browser.
    It is NOT a VPS, but a new shared host server with a private IP and SSL for my account/website. The DNS is on the OLD shared host server and will remain there until I tell the hosting company that I am ready (after testing). I tried your '~/home/my_account/' suggestion, but it did not work.

    Quote Originally Posted by RodG View Post
    Dont mess with the hosts file. That is going to add a complication that you don't need. You will be able to get things working for youself this way, but it wont work for anyone else.


    This comment has me concerned and confused. There should only be ONE root directory for any given account. For there to be more than one "root" would imply that that have have what cPanel calls an "Add on Domain" (or perhaps a parked domain), but if this is the case you wouldn't be needing to use an ip address.

    Please dont get me wrong here, I'm not really questioning what you are saying, I'm just trying to get a better idea about the server setup, because knowing this is essential before we can really start to consider the zencart configuration settings.

    Cheers
    RodG
    I meant to say "root directory" and yes, there is only one root directory on the hosting server - sorry about that. The host file change on my personal PC is temporary to access the new server and use the SSL certificate (fakes my PC into thinking it is communicating with the old server's SSL). I was using my personal Mac to try and access the website like Google or WebPageTest would access it.

    Quote Originally Posted by DrByte View Post
    If I understand correctly, your new site works fine when you have a domain name set for it, but right now you don't "own a spare domain" ..... but you need one in order to do the 3rd-party testing you desire.

    So, go get a free domain by signing up at https://www.noip.com ... you get to set your domain name (ie: whatever.hopto.org) .... This will add a Host and set an "A" record ... you'll be prompted for the IP address so give it the temporary IP address and Save. Then put that domain name in your configure.php files until you go live.
    Ah - that is probably what I need. I thought I could just use the IP address in Zen Cart and access the site that way for PageSpeed and WebPageTests (I want to verify that the hosting company is "more than doubling my website speed"). On the other hand, maybe my hosting company did not give me a dedicated IP address and that could be causing the problem too.

    Thanks Dr Byte! I know you and others are working on consolidating the configure.php from admin and includes into one file in the future version 1.6. That will certainly make life easier in situations like this. Which forum can I use to ask questions about version 1.6 of Zen Cart?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Moving store to new domain name
    By thestampnomad in forum Installing on a Windows Server
    Replies: 3
    Last Post: 9 Jun 2015, 07:19 AM
  2. IP Address instead of domain when accessing admin
    By zinger in forum Installing on a Windows Server
    Replies: 8
    Last Post: 3 Oct 2010, 09:03 AM
  3. Problem with server switch, IP address vs. domain name
    By yeah! in forum General Questions
    Replies: 11
    Last Post: 13 Aug 2010, 12:18 AM
  4. Replies: 9
    Last Post: 3 Jun 2009, 03:21 PM
  5. Replies: 5
    Last Post: 30 Sep 2007, 06:40 PM

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