marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

Hunger find no fault with mouldy corn.

- MASSACHUSETTS, AMERICAN PROVERB


YOU ARE HERE:
using cpshop as your site's homepage

HOME

CPSHOP

why cpshop?

features

demos

faq

installation guide

using cpshop as your site's homepage

using cpshop filters

using cpshop hooks

support

license

pricing

download area (password required)

CPFAQ

MESSAGE BOARD

EMAIL MARTY
cpshop

Please note: As of Friday, May 3, 2013, cpshop is officially retired, and is no longer for sale. details

how to use cpshop as your website's homepage

As some of the earliest cpshop users may remember, cpshop was originally designed to work as one area in a larger website. But as it's become more popular (and CafePress with it), more people have built entire websites around cpshop; as of this writing, the most common support question I get is, "How can I get cpshop to be my site's homepage?"

The Five (Almost Six) Methods (in my personal order of preference)

(A note regarding these instructions: I use terms like "FTP" and "chmod." If you don't understand what those terms mean, you might want to Google them, find yourself a nerd/geek to help you out, or purchase the script installation package for $15.)


back to top

The index.cgi Method

This technique is the one I use most frequently. It usually works on servers where CGI scripts can run in any directory.

  1. Create a folder called "store" in the root folder of your website. Chmod that folder to 777.
  2. Create 3 more folders called "cpcache," "cplogs" and "cpbackup" inside the store folder. Chmod those 3 folders to 777.
  3. FTP the cpshop files in ASCII/Text mode to the store directory.
  4. Chmod cpshop.cgi, cpadmin.cgi, and cptest.cgi to 755.
  5. Chmod cpshop.cgi.config to 766.
  6. Test cpshop.cgi to make sure your install has worked so far. Go to http://www.yoursite.com/store/cpshop.cgi, and make sure cpshop loads without errors. Once you've got it working, go on to the next step.
  7. Rename cpshop.cgi to index.cgi, changing all similarly-named files (cpshop.cgi.config to index.cgi.config, etc.) to match.
  8. Locate the full server path to your store folder. There's a few ways to do this. In each of these examples, the path would be /home/yoursite/public_html/store/ -- you'll have to figure it out for your own server.
    1. Load cptest.cgi in your browser, and add ?env to the end of the URL, like this: http://www.yoursite.com/store/cptest.cgi?env
      You should see a line that looks something like this:
      SCRIPT_FILENAME - /home/yoursite/public_html/ store/cptest.cgi
    2. Login to cpadmin.cgi, and expand the "program options" section. Scroll down to the Default HTML Template option, and look at the example text. The path is displayed as part of the example:
      Example: cptemplate.html or /home/yoursite/public_html/ store/cpadmin.cgi_files/ cptemplate.html
    3. If all else fails, ask your webhost. They'll be able to tell you.
  9. Once you have the full path, you'll need to edit the $script_dir variable at the top of index.cgi. You want it to look like this:
    $script_dir = "/home/yoursite/public_html/store/";
  10. Make a copy of your index.cgi file, and upload it to the root folder of your website. Chmod the new index.cgi file to 755.
  11. If you have any other existing index.* files (index.html, index.shtml, index.php etc) in your root folder, rename or remove them.
  12. Try visiting your website's homepage. cpshop should appear. If it does, go on to the next step.
  13. Login to cpadmin, and expand the "store homepage options" section.
  14. In Option 2 of the store homepage options, change Main Store URL to your site's URL (like "http://www.yoursite.com/" without the quotes).
  15. Also in Option 2 of the store homepage options, make sure "Homepage as SSI" is set to yes.
  16. Click the "save all changes" button.
  17. Test your website's homepage again, and make sure everything still works.

back to top

The Server-Side Include Method

This technique tends to work on servers that support "exec" server-side includes (SSI).

  1. Create a folder called "store" in the cgi-bin folder of your website. Chmod that folder to 777.
  2. Create 3 more folders called "cpcache," "cplogs" and "cpbackup" inside the store folder. Chmod those 3 folders to 777.
  3. FTP the cpshop files in ASCII/Text mode to the store directory.
  4. Chmod cpshop.cgi, cpadmin.cgi, and cptest.cgi to 755.
  5. Chmod cpshop.cgi.config to 766.
  6. Test cpshop.cgi to make sure your install has worked so far. Go to http://www.yoursite.com/cgi-bin/store/cpshop.cgi, and make sure cpshop loads without errors. Once you've got it working, go on to the next step.
  7. With a text editor (on your home computer), create a file called index.shtml, containing this line:
    <!--#include virtual="/cgi-bin/store/cpshop.cgi" -->
  8. Upload the index.shtml file to the root folder of your website.
  9. If you have any other existing index.* files (index.html, index.cgi, index.php, etc) in your root folder, rename or remove them.
  10. Try visiting your website's homepage. cpshop should appear. If it does, go on to the next step.
  11. Login to cpadmin, and expand the "store homepage options" section.
  12. In Option 2 of the store homepage options, change Main Store URL to your site's URL (like "http://www.yoursite.com/" without the quotes).
  13. Also in Option 2 of the store homepage options, make sure "Homepage as SSI" is set to yes.
  14. Click the "save all changes" button.
  15. Test your website's homepage again, and make sure everything still works.

back to top

The index.php Method

This technique works on many (but not all) systems that support PHP. Keep in mind that cpshop itself still uses Perl, and that PHP is merely used as a wrapper.

  1. Create a folder called "store" in the cgi-bin folder of your website. Chmod that folder to 777.
  2. Create 3 more folders called "cpcache," "cplogs" and "cpbackup" inside the store folder. Chmod those 3 folders to 777.
  3. FTP the cpshop files in ASCII/Text mode to the store directory.
  4. Chmod cpshop.cgi, cpadmin.cgi, and cptest.cgi to 755.
  5. Chmod cpshop.cgi.config to 766.
  6. Test cpshop.cgi to make sure your install has worked so far. Go to http://www.yoursite.com/cgi-bin/store/cpshop.cgi, and make sure cpshop loads without errors. Once you've got it working, go on to the next step.
  7. Locate the full server path to your store folder. There's a few ways to do this. In each of these examples, the path would be /home/yoursite/public_html/cgi-bin/store/ -- you'll have to figure it out for your own server.
    1. Load cptest.cgi in your browser, and add ?env to the end of the URL, like this: http://www.yoursite.com/cgi-bin/ store/cptest.cgi?env
      You should see a line that looks something like this:
      SCRIPT_FILENAME - /home/yoursite/public_html/ cgi-bin/store/cptest.cgi
    2. Login to cpadmin.cgi, and expand the "program options" section. Scroll down to the Default HTML Template option, and look at the example text. The path is displayed as part of the example:
      Example: cptemplate.html or /home/yoursite/public_html/ cgi-bin/store/cpadmin.cgi_files/ cptemplate.html
    3. If all else fails, ask your webhost. They'll be able to tell you.
  8. Once you have the full path, you'll need to edit the $script_dir variable at the top of cpshop.cgi. You want it to look like this:
    $script_dir = "/home/yoursite/public_html/cgi-bin/store/";
  9. Login to cpadmin, set the "Use Clean URLs" option to "use query strings", and save changes.
  10. With a text editor (on your home computer), create a file called index.php, and insert this code:
    <?php $qs = urlencode($HTTP_SERVER_VARS['QUERY_STRING']); $str = `/home/yoursite/public_html/cgi-bin/store/cpshop.cgi http://www.yoursite.com/ http://www.yoursite.com/cgi-bin/store/cpshop.cgi $qs`; echo $str; ?>
    Keep in mind that you'll have to replace the path and URLs with the correct ones for your install.
  11. Upload the index.php file to the root folder of your website.
  12. If you have any other existing index.* files (index.html, index.shtml, index.cgi, etc) in your root folder, rename or remove them.
  13. Try visiting your website's homepage. cpshop should appear. If it does, go on to the next step.
  14. Login to cpadmin, and expand the "store homepage options" section.
  15. In Option 2 of the store homepage options, change Main Store URL to your site's URL (like "http://www.yoursite.com/" without the quotes).
  16. Also in Option 2 of the store homepage options, make sure "Homepage as SSI" is set to yes.
  17. Click the "save all changes" button.
  18. Test your website's homepage again, and make sure everything still works.

back to top

The Gateway Method

Though I usually avoid this method, I mainly do so because it can be a lot of work. There are, however, a lot of people who like this method a lot, because it offers a lot of control, and it's really low-tech. It's especially popular among people that love handcrafting their own homepage, and feel quite familiar with HTML.

And in case it isn't clear, this method really just means you create your own homepage, and link it to cpshop.

  1. Install cpshop as usual.
  2. Create a homepage as you normally would, and create links to the various parts of your cpshop store. Upload it to your server (if necessary).
  3. Try visiting your website's homepage, and clicking on a link. cpshop should appear. If it does, go on to the next step.
  4. Login to cpadmin, and expand the "store homepage options" section.
  5. In Option 2 of the store homepage options, change Main Store URL to your site's URL (like "http://www.yoursite.com/" without the quotes).
  6. Also in Option 2 of the store homepage options, make sure "Homepage as SSI" is set to no.
  7. Click the "save all changes" button.
  8. Test your website's homepage again, and make sure everything still works.

back to top

The Meta-Refresh Bounce Method

This technique is actually really lame, but it works as a worst-case scenario. It's also really easy to implement.

  1. Install cpshop as usual.
  2. Using a text editor (like Notepad), create an index.html file (or whatever your homepage file should be called) that looks like this:
    <html>
    <meta http-equiv="refresh" content="0; URL=http://www.yoursite.com/cgi-bin/store/cpshop.cgi">
    </html>
    Make sure the URL in the file actually points to cpshop.
  3. Upload the file to your web server.
  4. Try visiting your site's homepage. You should get bounced to your cpshop homepage.

back to top