Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    883
    Plugin Contributions
    1

    Default 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 (www.mysite.com/admin/index.php); 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 (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 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 (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 www.mysite.com/subfolder/

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

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

    from www.shop.mysite.com
    to 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 (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

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default 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 www.mysite.com.
    For SSL, unless you have a wildcard domain name certificate, then you would have to use
    www.your_store.com/subdomainname/

  3. #3
    Join Date
    Jun 2008
    Posts
    165
    Plugin Contributions
    0

    Default 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');
    define('HTTPS_SERVER', 'https://www.http://taogem.com/taogemst_myzencart.com');

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

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

  5. #5
    Join Date
    Jun 2008
    Posts
    165
    Plugin Contributions
    0

    Default 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');

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

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

 

 

Similar Threads

  1. Installing on a sub domain
    By shiningfaery in forum Installing on a Windows Server
    Replies: 0
    Last Post: 20 Jul 2009, 04:47 PM
  2. Installing to new sub-domain
    By Makoshark in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 29 Feb 2008, 07:09 PM
  3. More than one Zencart on a domain / Sub domain
    By unisupuk in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 17 Nov 2006, 12:45 PM

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