Premature end of script headers

General ShopSite user discussion

Premature end of script headers

Postby desertsilicon » Thu Apr 19, 2012 12:31 pm

So the wwwinstall.cgi install went fine for the ShopSite we just purchased for $499. However, the cart will not run no matter what I do. I have tried both with and without SuExec as well as checked the permissions 100 times. This installer must not install proper for a CentOs Cpanel Linux machine. I am a linux system administrator for the last 10 years with tons of CGI / Perl / Mod Perl experience and the 2 servers I have tried this install on also have maybe 20-30 other cgi based sites on them currently working... What is the deal? Attached are my apache logs showing premature end of script headers... Why will the install work but the cart not run??!!

[Thu Apr 19 11:56:57 2012] [error] [client 68.98.33.111] Premature end of script headers: start.cgi, referer: http://www.desertsilicon.com/shopsite-install/wwwinstall.cgi
[Thu Apr 19 11:57:00 2012] [error] [client 68.98.33.111] Premature end of script headers: start.cgi, referer: http://www.desertsilicon.com/shopsite-install/wwwinstall.cgi

Is there anything else besides the specs posted online that a linux server needs to run this code? If it was not encrypted I could see the code and figure out what it needs. I could also put it in debug mode...

Anyone else having these issues? ... on to posting on other forums...

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby Jim » Thu Apr 19, 2012 12:41 pm

It is very rare that store won't run after installing, so this is not the normal situation. If there is an issue it is usually because of permissions on the server.

ShopSite cgis are compiled C code not perl scripts so make sure your server is set to execute C cgis as executables and not as perl scripts.

Make sure that the ownership and permissions are such the webserver user the site is running as can execute the scripts.

If the server is a 64 bit OS the 32bit compatibility libs must be installed.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Premature end of script headers

Postby desertsilicon » Thu Apr 19, 2012 1:12 pm

This is a 32 bit OS. Furthermore, as far as I know I have never had to do anything special for CGI's coded in other formats than perl... The web server should execute the files... like on other cgi driven sites I have on the same server... Also the files run fine via command line, they just will not work not in apache.

The only other option for us is to pay $195 on top of the $500 already paid for this cart to get it to work??? This is not normal for an installer to not work if you ask me... I have installed numerous other web apps on the same system without issue.

Personally, I feel some of the specifications for the web server requirements might be purposely left out so we have to pay an additional $195 to have "professional installation". And this is on top of what I have already been paid trying to get this to work for over 6 hours!

My guess is the "Fix" is something added to .htaccess or the apache conf but that information is nowhere to be found... What are these 32bit compatibility libs you mention that are also nowhere to be found on your "Requirements" page http://www.shopsite.com/help/current/en-US/sc/pro/index.htm?page=/help/current/en-US/install/server.configuration.html . Nothing is mentioned about needing compatibility there nor is the fact that the CGI's are C and might need something special...

Please advise me on how to install this cart before I advise my client to get a refund.

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby loren_d_c » Thu Apr 19, 2012 1:19 pm

Make sure that the site is running under suexec, that all of the ShopSite files and directories are owned by the owner and group of the site user, and that the ShopSite cgi's and the directories they run in have 755 permissions. If they have more or less than this the suexec system could prevent them from executing.
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Premature end of script headers

Postby desertsilicon » Thu Apr 19, 2012 1:24 pm

I have checked permissions 100x and tried both with and without suexec (and changed permissions accordingly in those tests).

I am at a loss on this, totally wasted an entire day trying to get this running.

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby loren_d_c » Thu Apr 19, 2012 1:55 pm

Can you run the start.cgi from an ssh command prompt?
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Premature end of script headers

Postby desertsilicon » Thu Apr 19, 2012 2:21 pm

Yes, and I am SSH in as the user... same user that is suexec

[~/public_html/store/ss]# ./start.cgi
Content-Type: text/plain

No method!

The program seems to run via the command line... Again are there any specific apache requirements? I find it odd the 100+ users on this server have no issues with cgi or php etc and this 1 program will not work.. hard to grasp that.

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby loren_d_c » Thu Apr 19, 2012 2:32 pm

No, no special Apache requirements other than the ability to execute cgis from the location where you installed them.

There are hundreds, perhaps thousands, of ShopSite stores installed on cpanel-based CentOS servers, so there is something extra-ordinary going on here.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Re: Premature end of script headers

Postby desertsilicon » Thu Apr 19, 2012 2:34 pm

I am going to purchase test VPS right now outside my normal hosting environment. I am thinking about getting a Hostgator Cpanel VPS.

What do you suggest as far as Linux OS? CentOs, Fedora, Ubuntu? Cpanel, Plesk?

I will keep the VPS for this site and other future shopsite carts I might do in the future if it works.

Thanks for all your help!

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby desertsilicon » Sun Apr 22, 2012 2:57 pm

http://www.desertsilicon.com/store/ss/hello.cgi

I am able to compile and run my own C based cgi... just not shopsite cart...

This cart will not run on 3 different servers I have tested it on and at the same time the servers run other C CGI and Perl CGI.

Do you guys have any test or debug cgi I can run to figure out what the heck is going on preventing shopsite from running?

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby desertsilicon » Mon Apr 23, 2012 9:49 am

<bump>....

FYI, I am suggesting client to get a full refund for the shopsite product he has purchased.

I asked simple questions on how to get this product working under a standard Linux hosting environment. I am working with 2 live CentOs/Cpanel servers currently dishing out all sorts of cgi / php content and the shopsite cart will not work but the installer for it works great. I even installed a fresh test server at home only to experience the same conditions. I also offered to buy a new server to get this working. Please tell me I am doing something wrong between the 3 Linux servers... I even verified I could run my own C compiled code as CGI and that works but the shopsite in the same directory will not run! It would be nice to know where I am going wrong.

Respectfully,

Brian
desertsilicon
 
Posts: 7
Joined: Thu Apr 19, 2012 12:11 pm

Re: Premature end of script headers

Postby Jim » Mon Apr 23, 2012 9:15 pm

There should be a testmm.cgi script in the install directory where wwwinstall.cgi is untarred try running that from a browser and see what system info is returned.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Premature end of script headers

Postby Jim » Thu Apr 26, 2012 3:43 pm

This issue has been resolved.

The problem turned out to be that the authorization file (<storeid>.auth ) was corrupt on the server so it could not be verified by the ShopSite software. The <storeid>.auth file is an encrypted file that contains the authorize url for the store, the serial number and other information specific to the store. Without a valid .auth file the store will not run. As mentioned in the online installation instructions "Be sure to use ASCII (text file) format any time you use FTP to transfer your Auth file." (http://shopsite.com/help/11.0/en-US/install/store.auth.html)

It appears that the file was transferred to the server in binary mode from a Mac. This added different line endings than were in the file when it was generated so the encrypted data became corrupted and it would not decrypt.

The install was correctly done and once the corrupt file was replaced with a valid <storeid>.auth file the store functions properly.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: Bing [Bot] and 114 guests