Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

php5-cgi and SSL
 
kyeranr
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2007-09-24
Edinburgh, Scotland
 

Hi,

I’ve managed to install Magento on my server space using the php5-cgi binary but have been having some trouble with getting the SSL pages to work. The installation went ok and everything else seems to be up and running without any problems (as seen here http://www.lunarrastar.com/content/) but whenever i go to one of the secure pages, like the log-in section, i get a 404 page cannot be found message. ("The requested URL /home/lunarras/public_html/content/index.php was not found on this server.” to be exact.)

I’ve checked with my hosting company (http://www.myqth.com) and they say…
“To call your web pages securely via SSL you need to use an alternative address based on the server name e.g. https://black.srv2.com/~username”
So in the Magento System > Configuration > Web > Secure, i’ve put the following…
Protocol: HTTPS (SSL)
Host: ruby.srv2.com/~lunarras
Port: 443
Base URL: /content/

I’ve also checked to see if i can access any other pages via https, for example my current temporary holding page, a static html document, can be seen by going here https://ruby.srv2.com/~lunarras/index.html but when i try to go to the base Magento directory https://ruby.srv2.com/~lunarras/content/ i get the error “The requested URL /cgi-bin/php5-cgi/~lunarras/content/index.php was not found on this server.”

This error message makes me think that the problem has something to do with the username i have to put on the end of the server name being passed on to the php5-cgi…
I’m guessing the answer may lie somewhere in rewriting the .htaccess file but I’m not sure and i don’t know where to start. my current .htaccess file contains the following.

php_flag magic_quotes_gpc off
php_flag short_open_tag on

Action php5
-cgi /cgi-bin/php5-cgi 
AddHandler php5
-cgi .php

DirectoryIndex index
.php

RewriteEngine on

RewriteCond 
%{REQUEST_URI} !^/media/
RewriteCond %{REQUEST_URI} !^/skin/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteCond 
%{REQUEST_FILENAME} !-l

RewriteRule 
.* index.php

I’m hoping there is a way for this to be fixed…
Any help would be very much appreciated.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

The HOST configuration value should contain host only.
So in your case it will be:

Host: ruby.srv2.com
Base URL: /~lunarras/content/

Let me know if that worked

 
Magento Community Magento Community
Magento Community
Magento Community
 
kyeranr
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2007-09-24
Edinburgh, Scotland
 

Hi Moshe,

Thanks for your reply.
I’ve changed over the Host and the base URL like you said but unfortunately i’m getting exactly the same error messages.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

This:
https://ruby.srv2.com/cgi-bin/php5-cgi

Show show error 500 in case php5-cgi is found.

See if you can copy it there

 
Magento Community Magento Community
Magento Community
Magento Community
 
kyeranr
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2007-09-24
Edinburgh, Scotland
 

Hi,

I’m not quite sure what you mean…
but going to https://ruby.srv2.com/cgi-bin/php5-cgi just gives a 404 error, to access the php5-cgi binary on my server space i’d have to go to https://ruby.srv2.com/~lunarras/cgi-bin/php5-cgi and if i do that my firefox finds the file and then tries to download it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

In your .htaccess file replace:

Action php5-cgi /cgi-bin/php5-cgi
with
Action php5-cgi /~lunarras/cgi-bin/php5-cgi
and try again
 
Magento Community Magento Community
Magento Community
Magento Community
 
kyeranr
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2007-09-24
Edinburgh, Scotland
 

Just tested that out and it seems to make everything go nuts.

navigating to the usual http://www.lunarrastar.com/content/ send up a string of errors

WarningUnexpected character in input'' (ASCII=15state=1 in /home/lunarras/public_html/cgi-bin/php5-cgi on line 130

Warning
Unexpected character in input' in /home/lunarras/public_html/cgi-bin/php5-cgi on line 130

Warning: Unexpected character in input: ' 
in /home/lunarras/public_html/cgi-bin/php5-cgi on line 130

Warning
Unexpected character in input' in /home/lunarras/public_html/cgi-bin/php5-cgi on line 130

Parse error: syntax error, unexpected T_STRING in /home/lunarras/public_html/cgi-bin/php5-cgi on line 130

and i get exactly the same if i navigate to https://ruby.srv2.com/~lunarras/content/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Something is wrong with cgi setup on your account, make sure with the host that ~lunarras/public_html/cgi-bin is setup as cgi folder.

When you go to https://ruby.srv2.com/~lunarras/cgi-bin/php5-cgi it suppose to give server error 500 and not file download.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kyeranr
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2007-09-24
Edinburgh, Scotland
 

I’ve checked with my hosting company, after some time i finally got a reply, and they’ve said that…

“This is down to the way apache handles the two different access methods, “

and when i asked them if they could get the CGI-bin to work correctly via SSL they responded with

“Over shared SSL this would not be possible unfortunately.”

downer

They also said that they wont be upgrading there systems to PHP5 until the new year so i guess i’m not going to get this to work…

So with no immediate solution at hand what are the implications, security and other wise, of setting the secure protocol to “HTTP (unsecure)” and not using SSL for the time being?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jacson
Jr. Member
 
Total Posts:  4
Joined:  2007-09-27
 

Uhm, was just reading through this thread.
Zend Framework requires PHP5 , right?
So it is not going to work with a Host running PHP4 - CGI or otherwise.

Good luck with it though.  grin

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top