Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue May 24, 2011 12:58 am 
Offline
Senior Member

Joined: Sun Sep 13, 2009 11:37 pm
Posts: 65
This strikes me as really odd behavior.

Background: I have 4 sites running on Apache2 VirtualHosts. Nginx runs as a front-end proxy. My configuration uses mod_rewrite and .htaccess.

Ok. So I was attempting to upgrade from 9.04 to 10.04 LTS. Got to 9.10 and tested -- all sites still working. Decided to move on to 10.04.

My server comes back up and now only 2 sites work. The other two give "HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request." (in chrome).

I have an .htaccess file in the base directory -- configured to redirect the same to all sites:


Quote:
<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.site1.com$
RewriteRule ^$ site1/webroot/ [L]

RewriteCond %{HTTP_HOST} ^www.site1.com$
RewriteRule (.*) site1/webroot/$1 [L]

RewriteCond %{HTTP_HOST} ^www.site2.com$
RewriteRule ^$ site2/webroot/ [L]

RewriteCond %{HTTP_HOST} ^www.site2.com$
RewriteRule (.*) site2/webroot/$1 [L]

</IfModule>


etc. The apache configurations are identical except for the domain names. Nginx is not the problem (I tested by requesting .jpg files).

Any ideas on how upgrading to 10.04 from 9.10 could break two of my sites but not the other two? There are differences in the php ... but I can't figure out how this could cause this error.

Any tips would be greatly appreciated.

Thanks


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 3:28 am 
Offline
Linode Staff

Joined: Fri Feb 18, 2011 10:08 am
Posts: 42
Location: Galloway, NJ
What are the PHP differences?


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 6:00 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
9.10 Had PHP 5.2, 10.04+ has PHP 5.3 there are some incompatibilities between the two see http://www.php.net/manual/en/migration53.php

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 11:16 am 
Offline
Senior Member

Joined: Sun Sep 13, 2009 11:37 pm
Posts: 65
> What are the PHP differences?

Just different pages, functions, etc. They are different apps -- but they all use the CakePHP framework, and the structures are largely identical.

I am starting to rule out PHP -- I have tried to get the first function called to simply "echo 'hello';" and it is still giving me the 500 error.

Could this have something to do with the domain name / hosts file? Right now, each site has its own virtual host in apache. The configurations are pretty much identical except for the domain names. The sites are all sharing a single IP address. I am currently looking for differences in PHP that may have caused this...


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 11:24 am 
Offline
Senior Member

Joined: Sun Sep 13, 2009 11:37 pm
Posts: 65
SOLVED!

So, after looking through the configuration files for the sites, I realized that the two working sites use "file" as the caching mechanism, while the two affected sites used APC for caching ...

Well, guess what -- it appears that APC was removed at some point by the upgrade. Reinstalled and now everything is back to normal. (This also explains why my sites were running slowly.)

Lesson: if you upgrade to 10.04 you may want to make sure APC makes it through the journey.

Thanks for your help.


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 2:03 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Just a question: Did you install APC through PECL or compiled it yourself? Or did you just "apt-get install php-apc" ?

If you used PECL or compiled it yourself, it's no surprise that APC didn't survive the transition from PHP 5.2 to PHP 5.3. I don't think PECL is robust enough to handle upgrades like that. (By the way, if you're still doing this, remove it and use apt-get instead. Otherwise you'll have the same problem when you upgrade to 12.04 LTS.)

If you used the "php-apc" package and it got lost in the upgrade, that would be really strange.

Also, it would be a good idea to edit /etc/php5/apache2/php.ini and enable error logs. When you get a 500 Internal Server Error, the screen might be blank but the error log will contain all the information you need.


Top
   
 Post subject:
PostPosted: Tue May 24, 2011 2:06 pm 
Offline
Senior Member

Joined: Sun Sep 13, 2009 11:37 pm
Posts: 65
hybinet wrote:
Just a question: Did you install APC through PECL or compiled it yourself? Or did you just "apt-get install php-apc" ?


apt-get

Quote:
If you used the "php-apc" package and it got lost in the upgrade, that would be really strange.


I know, right? I was perplexed.

Quote:
Also, it would be a good idea to edit /etc/php5/apache2/php.ini and enable error logs. When you get a 500 Internal Server Error, the screen might be blank but the error log will contain all the information you need.


Agreed -- will be doing this. Thanks.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group