Forums / Templates, Stylesheets, Page Layout / Things I learned about installing ZenCart on a sub-domain

Things I learned about installing ZenCart on a sub-domain

Locked

Views: 2,282

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Mar 2008, 4:27 PM
#1
juxizoza avatar

juxizoza

Totally Zenned

Join Date:
Mar 2004
Posts:
651
Plugin Contributions:
1

Things I learned about installing ZenCart on a sub-domain

I hope this helps someone.

After searching the forum for information about installing ZenCart on a sub-domain and trying many of the suggestions about copying, changing configuration files, etc.,

I eventually did a clean install of 1.3.8, on a sub-domain.

  1. CPanel, setup a new sub-domain name; sub-domain folder is automatically setup.
  2. CPanel, setup a new database.
  3. FTP ZenCart files to the new sub-domain folder (public_html/subdomain_folder).
  4. Browse to the sub-domain (www.subdomain.mysite.com) and ZenCart automatically starts the install process.

Sub-domain installation configuration file changes.

includes/configure.php

define('HTTP_SERVER', 'http://www.subdomain_name.mysite.com');
define('HTTPS_SERVER', 'https://www.subdomain_name.mysite.com');

define('DIR_FS_CATALOG', '/home/user/public_html/subdomain_folder/');
define('DIR_FS_SQL_CACHE', '/home/user/public_html/subdomain_folder/cache');
admin/includes/configure.php
define('HTTP_SERVER', 'http://www.subdomain_name.mysite.com');
define('HTTPS_SERVER', 'https://www.subdomain_name.mysite.com');
define('HTTP_CATALOG_SERVER', 'http://www.subdomain_name.mysite.com');
define('HTTPS_CATALOG_SERVER', 'https://www.subdomain_name.mysite.com');

define('DIR_FS_ADMIN', '/home/user/public_html/subdomain_folder/admin/');
define('DIR_FS_CATALOG', '/home/user/public_html/subdomain_folder/');
define('DIR_FS_SQL_CACHE', '/home/user/public_html/subdomain_folder/cache');

Post installation issues that came up.

Accessing ZenCart Admin
The initial visit to Admin from the completed installation page went fine and I spent quite a bit of time setting various options. However, I had problems with all subsequent visits.

After signing in (www.subdomain_name.mysite.com/admin/login.php), ZenCart actually logged me into the main site's admin (https://www.mysite.com/admin/index.php%29; this was possible because I used the same password. No matter what path changes I made in the Admin configuration file, I was never able to login to the sub-domain admin using www.subdomain_name.mysite.com/admin/ . I did several installs with the same results and eventually gave up and changed my bookmark to point directly to the subfolder (https://www.mysite.com/subdomain_folder/admin/) which works; without a problem.

SSL certificate
I have SSL certificate for mysite.com and thought it was fully qualified for the entire site. However, my browser threw up a warning about it; when going to www.subdomain_name.mysite.com.

That is NOT something I want a visitor to see!
And, caused me to wonder about PayPal, my affiliate program, and other things registered or linked to https://www.mysite.com.

Solution: Install in subfolder and use 'redirection'.

If you intend to install ZenCart in its own folder (shop, catalog, etc) or intend to have the appearance of a subdomain/subsite (as I will for members.mysite.com), the installation process is the same.

The first three steps from above are the same:

  1. CPanel, setup a new sub-domain name; subfolder is automatically setup.
  2. CPanel, setup a new database.
  3. FTP ZenCart files to the new subfolder (public_html/subfolder).

Start ZenCart from the subfolder to get paths in configuration files correct.
4) Browsed to the subfolder (https://www.mysite.com/subfolder/) and ZenCart automatically starts the install process.

Subfolder installation configuration file changes.

includes/configure.php

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

define('DIR_FS_CATALOG', '/home/user/public_html/subfolder/');
define('DIR_FS_SQL_CACHE', '/home/user/public_html/subfolder/cache');
admin/includes/configure.php
define('DIR_WS_ADMIN', '/subfolder/admin/');
define('DIR_WS_CATALOG', '/subfolder/');
define('DIR_WS_HTTPS_ADMIN', '/subfolder/admin/');
define('DIR_WS_HTTPS_CATALOG', '/subfolder/');

define('DIR_FS_ADMIN', '/home/user/public_html/subfolder/admin/');
define('DIR_FS_CATALOG', '/home/user/public_html/subfolder/');
define('DIR_FS_SQL_CACHE', '/home/user/public_html/subfolder/cache');

Completing the redirection process.

  1. Using CPanel, setup re-direction of sub-domain to subfolder

from www.sub-domain.mysite.com
to https://www.mysite.com/subfolder/

  1. If you choose to install your core site in subfolder 'shop', you would have two redirections

from https://www.mysite.com
to https://www.mysite.com/shop/

from www.shop.mysite.com
to https://www.mysite.com/shop/

If you installed your core site in a subfolder you actually have several choices.
A) Leave redirection as shown.
B) If site is actually a HTML gateway to your 'shop', the first redirection is not appropriate.
C) If you don't want a sub-domain hanging around and confusing the issue, in CPanel remove the sub-domain name and don't bother with the second redirection.

Advantages I think I have by doing redirection to a subfolder.

  1. All those additional functions (SSL, PayPal, affiliate program, etc.) are site specific; not folder specific. I may have dodged a few bullets and avoided some potential problems.

  2. Having related, but different, sites up and running was important to me. It was NOT important if 'members' comes before or after the 'mysite' name in the address window. And, I don't think the customer cares either. As a sub-domain, the URL is valid across the net and I can market the 'members' site (https://www.members.mysite.com) separate from my main site.

  3. Having the sub-site in its own 'root' folder allows easier FTP backups of the site. When the 'public_html' is the root, you have a bunch of other stuff there, too.

  4. Additional sub-sites can be mirrored (using CPanel's 'file manager') from this one folder and be up and running in minimum time.

Juxi Zoza

17 Mar 2008, 5:21 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Things I learned about installing ZenCart on a sub-domain

SSL certificate
I have SSL certificate for mysite.com and thought it was fully qualified for the entire site. However, my browser threw up a warning about it; when going to www.subdomain_name.mysite.com.

That is NOT something I want a visitor to see!
And, caused me to wonder about PayPal, my affiliate program, and other things registered or linked to https://www.mysite.com.

For SSL, unless you have a wildcard domain name certificate, then you would have to use
www.your_store.com/subdomainname/

Zen cart PCI compliant Hosting

31 Dec 2008, 4:46 PM
#3
kubbos avatar

kubbos

New Zenner

Join Date:
Sep 2008
Posts:
5
Plugin Contributions:
0

Re: Things I learned about installing ZenCart on a sub-domain

If you want to have your entire shop in subfolder, NOT in root directory, but instead of "www.yourdomain/catalog" you will have this: "www.yourdomain.com" do this:

  1. put your fresh zc shop into your folder i.e.: root/subfolder

  2. go to Cpanel and do this: in tools , open "domains" and set your domain i.e. "www.yourdomain.com" to redirect to your subfolder: "/subfolder"

  3. install your new shop - installer probably will set path as root folder
    4.next you will probably have massege: "error! Unable to determine page link", to get rid of this you have to do this:
    in your index.php file , you have to put this: "> $PHP_SELF = !strlen(basename($PHP_SELF)) ? 'index.php' : $PHP_SELF;" after the: "> <?php" - 1st line

  4. if you want to use ultimate seo, just edit the ".httacces" file and change "/shop/" to: "/" -

1 Feb 2010, 12:00 AM
#4
taogem avatar

taogem

Zen Follower

Join Date:
Jun 2008
Posts:
165
Plugin Contributions:
0

Re: Things I learned about installing ZenCart on a sub-domain

When I try to make even the very first changes I get a fatal error has happened, and will not save.

Will not accept the changes. I have only tried the first two so far...

Just curious if this is still correct as it was back in March 2008.

define('HTTP_SERVER', 'http://taogem.com');
define('HTTPS_SERVER', 'https://taogem.com');

Changed to.. :

define('HTTP_SERVER', 'http://www.http://taogem.com/taogemst_myzencart.com'%29;
define('HTTPS_SERVER', 'https://www.http://taogem.com/taogemst_myzencart.com'%29;

1 Feb 2010, 12:42 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: Things I learned about installing ZenCart on a sub-domain

The documented instructions are correct. But you're clearly not following them properly. Why are you sticking "http://" inside another URL?

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

1 Feb 2010, 4:28 AM
#6
taogem avatar

taogem

Zen Follower

Join Date:
Jun 2008
Posts:
165
Plugin Contributions:
0

Re: Things I learned about installing ZenCart on a sub-domain

Oh gosh...

I did not post what I actually entered ..

They really did look like this:

Sorry for not posting correctly..

define('HTTP_SERVER', 'http://www.taogem.com/taogemst_myzencart.com');
define('HTTPS_SERVER', 'https://www.taogem.com/taogemst_myzencart.com');

1 Feb 2010, 4:56 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Things I learned about installing ZenCart on a sub-domain

If you go back to the instructions above, you'll see that the HTTP_SERVER and HTTPS_SERVER should ONLY contain the domain name. The subfolder name should be in the DIR_WS_CATALOG and DIR_WS_HTTPS_CATALOG.
I suggest going back over the instructions carefully.

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