Zen Cart Logo
Forums / Upgrading to 1.5.x / configure.php question about addon-domains

configure.php question about addon-domains

Views: 2,425

Results 1 to 17 of 17
2 Jun 2013, 2:41 AM
#1
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

configure.php question about addon-domains

Running into a 404 when installing v1.5.1 into a directory of an add-on domain.

Host says to use the AddonDomain with Caps and .com as it appears in the FTP heirarchy. They scolded me for using 777. WTW.

So, http://www.MySite.com/Add0nDomain.com/catalog/ ?

Therefore.

// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', 'Add0nDomain.com/catalog/');
define('DIR_WS_HTTPS_CATALOG', 'Add0nDomain.com/catalog/');

Seems logical and yet the browser says it is illogical. 404. How should the path be written? Thanks.

2 Jun 2013, 12:31 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: configure.php question about addon-domains

webskipper:

Running into a 404 when installing v1.5.1 into a directory of an add-on domain.

Host says to use the AddonDomain with Caps and .com as it appears in the FTP heirarchy. They scolded me for using 777. WTW.

So, http://www.MySite.com/Add0nDomain.com/catalog/ ?

Therefore.

// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', 'Add0nDomain.com/catalog/');
define('DIR_WS_HTTPS_CATALOG', 'Add0nDomain.com/catalog/');

Seems logical and yet the browser says it is illogical. 404. How should the path be written? Thanks.
Assuming that you have

  define('HTTP_SERVER', 'http://www.MySite.com');

you should use

define('DIR_WS_CATALOG', '/Add0nDomain.com/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/Add0nDomain.com/catalog/');

... with the leading /'s ...

2 Jun 2013, 1:53 PM
#3
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Thanks for your reply.

I tried that already and it didn't work. Just tried it again now. Nogo.

I'm just trying to get to the installer pages to install ZC on an Addon domain.

2 Jun 2013, 3:00 PM
#4
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: configure.php question about addon-domains

I realize that I'm out of my league in this discussion but

my AddOn domain ZenCart configuration (setup in Cpanel as AddOn domain not Subdomain) are just as though they were the main domain within my account

http://MyMainDomain.com

http://MyAddOnDomain.com

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

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
2 Jun 2013, 7:20 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php question about addon-domains

webskipper,

First insure that your addon domain is functioning
Upload some "index.html" file and load the site in your browser
You should see the contents of your index.html file displayed

Then as RixStix has stated - assuming that you want ZenCart at the root of your addon domain and that you have uploaded the fileset there,

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

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
2 Jun 2013, 8:58 PM
#6
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Had the domain almost 20 years. Yup it's working.

It's the TDL.

ZC will only work when unloaded into the Addon domain directory.

I can't use a catalog or store directory for zen within the Addon directory.

There must be a way to work around this.

2 Jun 2013, 9:29 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php question about addon-domains

I can't use a catalog or store directory for zen within the Addon directory.
Do you have ZenCart's files uploaded into a directory such as /catalog or /store in the addon's space?

2 Jun 2013, 10:10 PM
#8
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Yes.

Host said the absolute path is PrimaryDomain.com/AddonDomain.com/directory/zc_install/

sent you a pm

3 Jun 2013, 12:26 AM
#9
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Ok So I figured it out. :smartalec:

I had to spell out the Complete path in many places where 'complete path' was mentioned in the configure pages.

define('HTTP_SERVER', This is #1 step
define('HTTP_SERVER', This is #2 step
logs
cache
catalog

Then the installer launched.

Thanks for everyone's help.

3 Jun 2013, 4:25 PM
#10
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Still having issues with the admin style.

Login page is stepped and the admin pages have the header navigation expanded along the left side (menu.css), along with missing language images. Tried different permissions.

Everything works, just keep scrolling.

I haven't given up yet, just haven't ever had to touch the admin pages.

What parts of the admin config page needs to be defined with a full path to trigger the style sheets?

WS right?

3 Jun 2013, 5:47 PM
#11
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php question about addon-domains

Post both of your configure files here
X'ing out the DB details

3 Jun 2013, 6:50 PM
#12
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Quite possibly this could turn into a sticky or part of the tutorial.

Catalog>Includes>Config

<?php /** * @package Configuration Settings circa 1.5.1 * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * File Built by zc_install on 2013-06-02 07:09:52 */ /*************** NOTE: This file is similar, but DIFFERENT from the "admin" version of configure.php. ***********/ /*************** The 2 files should be kept separate and not used to overwrite each other. ***********/ // Define the webserver and path parameters // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com define('HTTP_SERVER', 'http://www.AddonDomain'); define('HTTPS_SERVER', 'https://www.AddonDomain'); // Use secure webserver for checkout procedure? define('ENABLE_SSL', 'false'); // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! // * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) define('DIR_WS_CATALOG', '/Catalog/'); define('DIR_WS_HTTPS_CATALOG', '/Catalog/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/'); define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/'); define('DIR_WS_PHPBB', '/'); // * DIR_FS_* = Filesystem directories (local/physical) //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/Owner/public_html/AddonDomain/Catalog/'); //the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash define('DIR_FS_LOGS', '/home/Owner/public_html/AddonDomain/Catalog/logs'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/'); define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); // define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', ''); define('DB_CHARSET', 'utf8'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'DB_UserName_Here'); define('DB_SERVER_PASSWORD', 'Pa$$W0rd_Here'); define('DB_DATABASE', 'DB_Name_Here'); // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'database'); define('DIR_FS_SQL_CACHE', '/home/Owner/public_html/AddonDomain/Catalog/cache'); // EOF Admin>Include>Config <?php /** * @package Configuration Settings circa 1.5.1 * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * File Built by zc_install on 2013-06-02 07:09:52 */ /*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********/ /*************** The 2 files should be kept separate and not used to overwrite each other. ***********/ /** * WE RECOMMEND THAT YOU USE SSL PROTECTION FOR YOUR ENTIRE ADMIN: * To do that, make sure you use a "https:" URL for BOTH the HTTP_SERVER and HTTPS_SERVER entries: */ define('HTTP_SERVER', 'http://www.AddonDomain'); define('HTTPS_SERVER', 'http://www.AddonDomain'); define('HTTP_CATALOG_SERVER', 'http://www.AddonDomain'); define('HTTPS_CATALOG_SERVER', 'http://www.AddonDomain'); // secure webserver for admin? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_ADMIN', 'false'); // secure webserver for storefront? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_CATALOG', 'false'); // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! // * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) $t1 = parse_url(HTTP_SERVER);$p1 = $t1['path'];$t2 = parse_url(HTTPS_SERVER);$p2 = $t2['path']; define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/'); define('DIR_WS_CATALOG', '/Catalog/'); define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/Catalog/Admin/'); define('DIR_WS_HTTPS_CATALOG', '/Catalog/'); define('DIR_WS_IMAGES', '/Catalog/Admin/images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'Catalog/Admin/images/'); define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/'); // * DIR_FS_* = Filesystem directories (local/physical) define('DIR_FS_ADMIN', realpath(dirname(__FILE__) . '/../') . '/home/Owner/public_html/AddonDomain/Catalog/Admin/'); //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/Owner/public_html/AddonDomain/Catalog/'); //the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash define('DIR_FS_LOGS', '/home/Owner/public_html/AddonDomain/Catalog/logs'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'Catalog/Admin/images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); // define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', ''); define('DB_CHARSET', 'utf8'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'DB_UserName_Here'); define('DB_SERVER_PASSWORD', 'Pa$$W0rd_Here'); define('DB_DATABASE', 'DB_Name_Here'); // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', '/home/Owner/public_html/AddonDomain/Catalog/cache'); // Define the webserver and path parameters // Main webserver: eg-http://www.your_domain.com - // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com /* * URLs for your site will be built via: * HTTP_SERVER plus DIR_WS_ADMIN or * HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or * HTTP_SERVER plus DIR_WS_CATALOG or * HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG * ...depending on your system configuration settings */ // EOF
3 Jun 2013, 8:03 PM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: configure.php question about addon-domains

Are you really using caps for Catalog???

Try replacing the red line with the default code

define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
define('DIR_WS_CATALOG', '/Catalog/');
define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/Catalog/Admin/');
define('DIR_WS_HTTPS_CATALOG', '/Catalog/');

Use this

define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
3 Jun 2013, 9:07 PM
#14
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

No capitalizations. The rewrite didn't help yet.

Still seeing:

Error: Graphs directory does not exist. Please create a graphs directory example: /amsoil/omega/images/graphs

All there is an index file. Chmod 755 or 644 fails to help.

Not seeing:
language button images.

/admin/includes/languages/english/images/buttons/button_check_new_version.gif

4 Jun 2013, 4:37 PM
#15
vdecals avatar

vdecals

Zen Follower

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

Re: configure.php question about addon-domains

define('HTTP_SERVER', 'http://www.AddonDomain');
define('HTTPS_SERVER', 'https://www.AddonDomain');

Not sure about this, but shouldn't you have a .com or .net here?

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

4 Jun 2013, 6:41 PM
#16
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: configure.php question about addon-domains

Unfortunately the TLD has to be included.

Which parts of the admin config must include a full path and which ones need only to point to the admin directory in the addon domain's catalog admin directory.

I've played with defining the path for the admin includes then I get a blank admin page. The admin image graphs for banners, CSS and language buttons are not running.

There is an easy fix for this. It's just a matter of which fix works properly.

4 Jun 2013, 7:24 PM
#17
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: configure.php question about addon-domains

It sounds like your hosting provider is possibly using rewrites (or some other archaic method) to support placing two separate domains under the same public_html folder. I would strongly advise against setting up multiple domains on one account in this manner. Having "nested" document_root folders will have some negative connotations down the road. The better way to have the "addon" domains configured is for each to have their own folders outside the main websites document root (public_html).

/username/ --+
             |
             +--public_html/
             |
             +--domain2/public_html/
             |
             +--domain3/public_html/

Then when you point your browser to "www.domain1.com" you see content from "/public_html/". When you browse "www.domain2.com" you see content from "/domain2/public_html/". Etc. This is how I've configured "add-on" domains on hosts (typically using CPanel). It works well.

If your hosting provider does not give you write access to a folder below the "public_html" (document root) folder or allow you to configure "add-on" domains in this manner... You may want to look at a different provider. Having a place to store sensitive data is a good idea. Having separate document roots for each domain (and subdomain) means each acts independently.