Zen Cart Logo
Forums / General Questions / Moving to new server, IP in configure.php?

Moving to new server, IP in configure.php?

Views: 1,699

Results 1 to 9 of 9
14 Apr 2012, 8:48 AM
#1
scrap avatar

scrap

Zen Follower

Join Date:
Mar 2009
Posts:
103
Plugin Contributions:
0

Moving to new server, IP in configure.php?

I just got hold on a new server onto which I've uploaded my shop. It kind of works, but not flawlessly. https://www.mydomain.com is still pointing to my old server as I test the new one out.

My folder structure is:
-public_html
---myshop

From my host I've received a temporary address, like http://111.111.11.1/~username which I'm using atm for testing purposes.

This is my new server configure.php settings...

  define('HTTP_SERVER', 'http://111.111.11.1/~username');
  define('DIR_WS_CATALOG', '/myshop/');
  define('DIR_FS_CATALOG', '/home/username/public_html/myshop/');

and my adminfolder/configure.php settings...

  define('HTTP_SERVER', 'http://111.111.11.1/~username');
  define('HTTP_CATALOG_SERVER', 'http://111.111.11.1/~username');
  define('DIR_WS_ADMIN', '/myshop/adminfolder/');
  define('DIR_WS_CATALOG', '/myshop/');
  define('DIR_FS_ADMIN', '/home/username/public_html/myshop/adminfolder/');
  define('DIR_FS_CATALOG', '/home/username/public_html/myshop/');

Is this correct?

There are several issues...
(1) zenid= wont go away after the first click
(2) when going to http://111.111.11.1/~username/adminfolder I cannot log in, "There was a security error when trying to login.". After some searching there's something with a security token(?)
(3) I cannot add stuff to shopping cart
(4) I cannot log in as a customer ("An error has occured")

I don't know if everything has to do with zenid= or not...

Any ideas?

14 Apr 2012, 12:56 PM
#3
scrap avatar

scrap

Zen Follower

Join Date:
Mar 2009
Posts:
103
Plugin Contributions:
0

Re: Moving to new server, IP in configure.php?

davowave:

Did you follow all the instructions in the tutorial: https://www.zen-cart.com/tutorials/index.php?article=100

The thing is that if I install a fresh version, zenid is still there and there's still a "security error" when logging in to the adminfolder. I'm leaning towards thinking that one cannot have an IP address as http_server in configure.php.

If I'm right, this makes it impossible to check for installation errors on new installs(?) when one hasn't redirected the domain name(?) :(

edit
https://www.zen-cart.com/tutorials/index.php?article=312
"- you've set your site up on an IP address instead of a domain name, thus preventing session cookies from being set properly"

I'm afraid that I was right... but now what? So I have to point my domain name prior to being able to check for installation and server issues?

And what about that zenid thing? Is it the same cause?

14 Apr 2012, 1:14 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Moving to new server, IP in configure.php?

scrap:

If I'm right, this makes it impossible to check for installation errors on new installs(?) when one hasn't redirected the domain name(?) :(

The issue has NOTHING to do with zencart... it is a server setting involving "Tweak mod_userdir".

Rather than an IP address, you should use a server path.

If you have SSL installed, just set it to FALSE in the config files. The cert refers to a domain and a specific IP associared with the domain. No wonder it fails on that IP...

And even if the feature is enabled (disabled) by your host, MOST functions are unlikely to work.

When configured, it WILL show a ZC home page... and if it does, that GENERALLY means the install went well. Don't try to test functions until the DNS is resolved.

14 Apr 2012, 1:43 PM
#6
scrap avatar

scrap

Zen Follower

Join Date:
Mar 2009
Posts:
103
Plugin Contributions:
0

Re: Moving to new server, IP in configure.php?

Thank you for the clarification! I just pointed an unused domain name to the new server and will check for errors using it before pointing the real domain the the server.

14 Apr 2012, 2:00 PM
#7
rodg avatar

rodg

Deceased

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

Re: Moving to new server, IP in configure.php?

scrap:

From my host I've received a temporary address, like http://111.111.11.1/~username

This is a URL, which isn't the same as an 'address'

scrap:

This is my new server configure.php settings...
define('HTTP_SERVER', 'http://111.111.11.1/~username');

Technically this is invalid. The "server" (in this case) would/should be 'http://111.111.11.1' with the '~username' being a part of the file path... as such...

define('DIR_WS_CATALOG', /~username'/myshop/');

The following define:
define('DIR_FS_CATALOG', '/home/username/public_html/myshop/')
is in the correct format. (note, no tilde (~) required in this instance.

I'm not going to say that making these changes will fix all your problems (because for the most part, the HTTP_SERVER and DIR_WS_CATALOG defines are simply combined to produce the full URL before use anyway, but it will make a subtle difference as to the way session data stored.

Cheers
Rod

14 Apr 2012, 3:17 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Moving to new server, IP in configure.php?

scrap:

The thing is that if I install a fresh version, zenid is still there and there's still a "security error" when logging in to the adminfolder. I'm leaning towards thinking that one cannot have an IP address as http_server in configure.php.Often that is the case, yes.
scrap:

https://www.zen-cart.com/tutorials/index.php?article=312
"- you've set your site up on an IP address instead of a domain name, thus preventing session cookies from being set properly"

I'm afraid that I was right... but now what? So I have to point my domain name prior to being able to check for installation and server issues?

And what about that zenid thing? Is it the same cause?
Yes, using a real domain name will prevent those problems.

Surely the server has another domain name tied to it, right? even if it's one owned by the hosting company, which they use to identify the server for themselves? That name would work in place of the IP address.

14 Apr 2012, 4:35 PM
#9
scrap avatar

scrap

Zen Follower

Join Date:
Mar 2009
Posts:
103
Plugin Contributions:
0

Re: Moving to new server, IP in configure.php?

DrByte:

Often that is the case, yes.

Yes, using a real domain name will prevent those problems.

Surely the server has another domain name tied to it, right? even if it's one owned by the hosting company, which they use to identify the server for themselves? That name would work in place of the IP address.

Christ i'm stupid, of course...