Zen Cart Logo
Forums / General Questions / Need Help with accessing my new store through an IP address (No Domain Name)

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

Views: 1,410

Results 1 to 14 of 14
26 Jul 2016, 9:55 PM
#1
mandolin avatar

mandolin

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
9
Plugin Contributions:
0

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

27 Jul 2016, 2:42 AM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: Need Help with accessing my new store 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!

27 Jul 2016, 2:53 AM
#3
mandolin avatar

mandolin

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
9
Plugin Contributions:
0

Re: Need Help with accessing my new store 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.

27 Jul 2016, 3:02 AM
#4
rodg avatar

rodg

Deceased

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

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

mandolin:

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.

mandolin:

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.

mandolin:

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

27 Jul 2016, 6:41 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

mandolin:

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

27 Jul 2016, 1:15 PM
#6
mandolin avatar

mandolin

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
9
Plugin Contributions:
0

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

DrByte:

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

DrByte:

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.

DrByte:

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:

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:

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.

27 Jul 2016, 2:46 PM
#7
rodg avatar

rodg

Deceased

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

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

27 Jul 2016, 3:07 PM
#8
rodg avatar

rodg

Deceased

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

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

mandolin:

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.

mandolin:

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

27 Jul 2016, 4:02 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

27 Jul 2016, 5:02 PM
#10
mandolin avatar

mandolin

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
9
Plugin Contributions:
0

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

RodG:

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.

RodG:

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.

DrByte:

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?

27 Jul 2016, 7:57 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

mandolin:

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?
Discussion of actual issues (confirmed software bugs/problems) or clearly demonstratable and succintly-defined business needs can be posted in the Issues section on Github: https://github.com/zencart/zencart/issues
For forum-side discussion I guess one could use this section: https://www.zen-cart.com/forumdisplay.php?165-ZCDEV-v160-Development-Bugs ... but most of the discussion that would have gone there has gone over to github as well.

27 Jul 2016, 8:45 PM
#12
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Location:
Sparta, TN
Posts:
166
Plugin Contributions:
0

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

carlwhat:

http://111.111.111.111/test.txt

as a side note, your example IP address is missing 1 octet.
http://111.111.111 does look amiss.
Can it be this simple?

27 Jul 2016, 11:56 PM
#13
mandolin avatar

mandolin

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
9
Plugin Contributions:
0

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

That IP address was just an example. It was the hosting company's fault and they finally fixed it tonight. It works now, but I did go create a temporary DNS on noip.com.

I will post my questions about ZenCart v1.6 in the forum section, but they are not bugs. Thanks.

28 Jul 2016, 3:15 PM
#14
rodg avatar

rodg

Deceased

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

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

DrByte:

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.

Bit of a moot point, but I was wondering if I should have pointed this out myself. Alas, you have me trained so well that I thought I'd save myself potential embarrassment.;)

DrByte:

Or, as RodG pointed out, use cPanel to add the Addon/Parked domain to accomplish the same.

I actually liked your suggestion of using noip better (in this particular case). Unlike the cpanel addon, the noip ensured that whatever name was used it was going to be found.

Cheers
RodG