Upgrade to 10.04 Killed Some Sites (but not others)
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:
>
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]
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
6 Replies
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…
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.
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.
@hybinet:
Just a question: Did you install APC through PECL or compiled it yourself? Or did you just "apt-get install php-apc" ?
apt-get
> 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.
> 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.