Installation Troubleshooting
From The AgoraCart Project
We have also designed the installer script with features that you can use to test the install to try and find obvious and initial problems with the install, such as the Perl version, missing Perl modules and/or user IDs that CGI scripts run under within your webhosting account.
Just download this script and then just upload it to your store folder and set the permissions to 755 and run it from your browser. The file has a .txt extension so that you can download it so you will also need to change that to .cgi.
Permissions:
99% of the time if you are getting an error when trying to run agora.cgi or manager.cgi it is because you have the permissions wrong or you are not running scripts under your hosting account user ID! By default, the cPanel, web install, and the telnet/SSH installation methods with extract the files with the permissions you need. So if you installed you store in of these ways, you my need to look at installing the wrappers. go to the wrappers sections of the Install guide, online manual or security page for more information. On cPanel installs, usually the wrapper is installed/operating and/or the store will run under your user ID automatically without the wrappers, so skip this section.
It is impossible to tell you exactly what all the permissions should be, because they will vary on every server depending on how the server is configured. The main thing that you need to know is "Do scripts on your server run under your user id, or do they run under a generic id like 'nobody'"?
If scripts on your server run as nobody they you have to have much looser permissions on the files.
Here are just some basic permissions rules that should help in this case (but we recommend that you switch hosting first before using these type of settings):
- If the file is a script (.cgi) then the permissions need to be 755
- If you have a file or folder that needs to be written to then the permissions should be 766
- All other files are usually 744
Depending on the server configuration you may have to also set your .pl files to 755
So both agora.cgi and manager.cgi need to be set to 755, and possibly also all the .pl files that are in the /store/library/ folder.
In the admin_files folder, data_files folder, shopping_carts folder and the log_files folder you have configuration files that need to be written to by the manager, or commerce.cgi so all these files and the folders need to be set to 766. On some servers I have had to set the shopping_carts folder to 777 so that the carts can be deleted.
Also the /protected/files/ folder usually works best when set to 777.
This brings up another good point... I have seen a lot of people say just to set everything to 777 to get it working. That is fine in some cases, just make sure that you go back and then adjust the permissions back down and test it after each file to get the permissions as low as you can with the cart still functioning properly. If you leave the permissions at 777 you are just opening your self up for trouble and the files/folders will not be secure.
Also I have ran into several server that will not function if you have a file or folder set to 777, so keep this in mind.
Here is an article that was recently posted in another mailing list that explains this very well:
Most of our webservers are compiled with Apache's suexec support. This means that all CGI scripts are automatically run as your own user ID without any kind of changes or modifications to your scripts.
Suexec has many security features built-in, which can cause problems for the unaware, however. Many commonly available CGI scripts recommend setting various files and directories to world-writable permissions (777). Your scripts will not work if the CGI script itself has 777 permissions, or the
Most scripts will instruct you to set various write permissions in their install instructions--you do not need to do this. Setting any file, whether executable or data, to a world-writable state is very dangerous and should
Also, when scripts are run under your userid, it will not take into account your various environment variables, so umask settings for default file permissions will probably not work. There is a simple fix to this, however.
umask 022; |
Troubleshooting Errors:
Often times the error that you get from the browser is just a generic 500 error, and that basically just tells you that the script is broke. Basically it is useless....
error.log:
The very first thing that you should do is check the error.log file that is located in the "log_files" folder. This may not always work depending on what the problem is, but sometimes if there is a problem it will log the problem in the error.log and you may be able to see what the problem is.
Telnet/SSH:
If you have telnet or SSH access to your server the first thing you can try is logging in and running the script from the command line. Just cd to your store folder and then type in 'perl agora.cgi'. This should give you a better error message then just a 500... In some cases you will find that at this point the script runs just fine from the command line but it will not work from the browser.
If this is the case then you probably have a permissions problem with a file. Usually this is caused by the fact that script on your server run under a generic user id such as "nobody", but when you login from telnet (or SSH) the script is running under your user id. In this case running it from telnet or SSH will not help you at all.
Set Cart to Test Mode:
This handy tool will send diagnostic to the screen when navigating thru the script. To set this, log into the store manager (manager.cgi).
- click on program settings link.
- click on the free form logic manager button.
- In the top box add this line:
- $sc_debug_mode = "yes";
- then try out the cart
This assumes you can run the cart and the store manager.
make sure to delete this command immediately when you are finished or your cart will will show information you do not wish others to see and will also expose you to cross scripting vulnerability attacks.
Testing Cart IDs:
This handy tool will send diagnostic to the screen when navigating thru the script. To set this, log into the store manager (manager.cgi).
- click on program settings link.
- click on the free form logic manager button.
- In the top box add this line:
- $sc_debug_track_cartid = 'yes';
- then try out the cart
This assumes you can run the cart and the store manager. this will allow you to track the cart ID as you navigate. Not that some portions should stay the same as you navigate from page to page. Do not be alarmed that part of it changes. This is normal.
make sure to delete this command immediately when you are finished or your cart will not take orders.
Other Options for Help:
If after all that you are still not able to figure out what the problem is then there are two great resources on this site to get help.
Official AgoraCart User Forums / Message Board:
The forum has been running for years and if packed with thousands of posts that you can search through to find the answers to your questions. If you cannot find the answer then just post your question in the forum. Other forum members do their best to answer as many of the questions as they can.
Probably even a better option is to sign up for our Gold Version Membership. Gold Version Membership offers a members only forum/bbs, extra files for Gold members only as well as other goodies to help you. There are currently at the time of this article over 3000 Gold Members and membership is growing every day. Many of these people have been using AgoraCart for 7-8 years, and they are more than willing to help answer questions that you may have. We also try to answer more indepth and more frequently in the Gold member support mediums
Contact an Authorized Solutions Provider:
If after all that, or you just don't want to take the time you can always contact one of the ASPPs regarding professional store installaions/upgrades, store/website design, custom programming options, new hosting, or paid tech support options.
