Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 11:36:53 AM

Pages: [1]   Go Down
  Print  
Author Topic: 500 internal error, I searched  (Read 4770 times)
akhillbille
Newbie
*
Offline Offline

Posts: 4


« on: August 09, 2011, 06:41:15 PM »

I am getting a 500 Internal error on our website hosted by Lunar pages.
I have admin access.  Our regular person for this is out of town for the next month and can't look into it.  Cna you please assist me. My knowledge is limited.


Error log shows the following over and over:
[Tue Aug  9 18:12:03 2011] [error] [client 157.55.116.46] File does not exist: /home/arctic2/public_html/500.shtml
[Tue Aug  9 18:12:03 2011] [alert] [client 157.55.116.46] /home/arctic2/public_html/forum/.htaccess: RewriteRule: cannot compile regular expression '^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))'\n

We were having issue uploading pictures to the website.  I attemtped to up the max_file size in php.ini  This is when the problem started.  I reverted it all back to where it was but the problem still exists.  Any  help is greatly appreciated.

Any help is appreciated.

Mel Whitlock
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5215



« Reply #1 on: August 09, 2011, 08:02:41 PM »

Most likely you messed up an existing line and then failed to fully back out your changes. First of all, what did you do to the .htaccess file, other than (if there wasn't one already) adding an suPHP_ConfigPath statement? Second, you should have at least a basic set of "error handlers": 400.shtml, 401.shtml, 403.shtml, 404.shtml, and 500.shtml. That would avoid the "file does not exist" error. cPanel has a button to create the core of this set, but you would need to extend them with more code to look nice.

Can you at least show us the lines in .htaccess in the neighborhood of where you were making changes? That's a pretty hairy regexp in the message there, and I'm not entirely sure that it's correct. The ' and '\n should not be part of what's in the .htaccess, in any case (at least you can confirm that). Did you make any configuration changes, or do you know if LP made any around the time the errors started? So anyway, what did you do in .htaccess?
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
akhillbille
Newbie
*
Offline Offline

Posts: 4


« Reply #2 on: August 09, 2011, 11:55:00 PM »

Most likely you messed up an existing line and then failed to fully back out your changes. First of all, what did you do to the .htaccess file, other than (if there wasn't one already) adding an suPHP_ConfigPath statement? Second, you should have at least a basic set of "error handlers": 400.shtml, 401.shtml, 403.shtml, 404.shtml, and 500.shtml. That would avoid the "file does not exist" error. cPanel has a button to create the core of this set, but you would need to extend them with more code to look nice.

Can you at least show us the lines in .htaccess in the neighborhood of where you were making changes? That's a pretty hairy regexp in the message there, and I'm not entirely sure that it's correct. The ' and '\n should not be part of what's in the .htaccess, in any case (at least you can confirm that). Did you make any configuration changes, or do you know if LP made any around the time the errors started? So anyway, what did you do in .htaccess?

I didn't change anything in .htaccess.  That is what has me stumped.  I changed php.ini for max file size and that is when it happened so I changed it back. 

Here is what is in my home/public_html..htaccess

Quote
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /

# RewriteCond %{REQUEST_FILENAME} -s [OR]
# RewriteCond %{REQUEST_FILENAME} -l [OR]
# RewriteCond %{REQUEST_FILENAME} -d

# RewriteRule ^.*$ - [NC,L]

# Forum
# RewriteRule ^threads/.* showthread.php [QSA]
# RewriteRule ^forums/.* forumdisplay.php [QSA]
# RewriteRule ^members/.* member.php [QSA]
# RewriteRule ^blogs/.* blog.php [QSA]
# ReWriteRule ^entries/.* entry.php [QSA]
# ReWriteRule ^content/.* content.php [QSA]
# RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&{QUERY_STRING}

# RewriteCond %{REQUEST_FILENAME} -s [OR]
# RewriteCond %{REQUEST_FILENAME} -l [OR]
# RewriteCond %{REQUEST_FILENAME} -d

# RewriteRule ^.*$ - [NC,L]

# MVC
# RewriteRule ^(?Sad.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

It is different than what is in public_html/forum/.htaccess

Quote
RewriteEngine On
Options +FollowSymLinks

RewriteRule ^includes/(.*) index.php
RewriteRule ^vb/(.*) index.php
RewriteRule ^packages/(.*) index.php

RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}

Thanks for any help.  I know some stuff but my knowledge is limited.  Any and all help is greatly appreciated.
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5215



« Reply #3 on: August 11, 2011, 08:14:12 PM »

Don't you need a suPHP_ConfigPath entry in your .htaccess to point to where the php.ini file lives, or has that requirement been dropped?

Other than that, it's hard to imagine what changing a php.ini file would do to mess up an .htaccess file. In the error message, the ' and '\n of course should not be in the actual .htaccess file, and what you posted don't seem to show such. That regular expression is a bit out of my league, and I'm trying to find some resources that will tell me exactly what (?: ) and (?:- ) do. Anyway, if you swear that php.ini is the only file you touched, were you adding that file, or modifying an existing, working copy? If it was new, you probably need to add the suPHP_ConfigPath, for the php.ini to take effect, but that still doesn't explain the .htaccess error.

Did you download and upload .htaccess, by any chance? Maybe it got corrupted by improper mode file transfer, although what you've posted looks OK. Did you do any kind of "cleanup" at all when you made the posting? That business with the \n in the message sort of suggests some kind of corruption by improper downloading and uploading. This .htaccess was working before? If so, that would suggest that you're not on a Windows/IIS server.

The /.htaccess file is all comments, except for two lines that tell the system to use PHP 5. If your server is now default PHP 5, you may be able to remove or comment them out now, but it shouldn't do any harm to leave them in for now. The /forum/.htaccess file is doing two things. First, it takes certain hack attempts (to look at files in three specific directories) and sends them to your main entrance. Second, it changes SEO/SEF URLs into ordinary PHP calls with some fairly funky regular expressions, which is where your error message comes in. I wonder if something was changed in your server configuration at the same time that you were trying to modify php.ini, and that's just a red herring, with the real problem being that your regular expressions are no longer legal (or, at least, accepted). You could try commenting out (#) the .htaccess, line by line in the RewriteRule section, and see if the error moves around or eventually disappears.

That's all I can think of for now. Do you have a support ticket open? You might ask if LP made any changes to your system at about the time these errors started. As I said, I'm not familiar with some of the regular expression notation, but if it was working before, I don't know why it would suddenly stop.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
akhillbille
Newbie
*
Offline Offline

Posts: 4


« Reply #4 on: August 12, 2011, 10:03:45 AM »

thanks for your suggestions.  I do have a support ticket open with LP.  I was told that they made some adjustments to them and it seems to be working fine. And they moved my original .htaccess.  The site atleast shows up now.  But the layout is all messed up and the links don't work. 

they mentioned this
Quote
RewriteRule: cannot compile regular expression '^

Please understand that your account is currently on Deneb server with Apache/1.3.42. Apache 1.x supports only POSIX regular expressions, and does not support the PCRE as does Apache 2.x. As such you need to correct your .htaccess rule especially to character-escaping. I have placed your .htaccess file as /home/arctic2/public_html/forum/.htaccess_original and made some adjustments as such your pages appears to be working now. However, if required, please proceed with further adjustments.


this is getting fustrating quickly.  I am not an expert on this stuff but a back up for when things go down.  Unfortunately this one is way over my head. I'll continue to work with LP support until our regular person gets back.

here is our site www.arcticoffroad.com
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5215



« Reply #5 on: August 12, 2011, 08:18:41 PM »

Ah, so for whatever reason, you ended up on a different server with a different Apache level that does not support this kind of regular expression? Unless whoever wrote it in the first place can rewrite it in a more POSIX-compatible manner, you'll be stuck until you can move back to Apache 2. Were you moved involuntarily for performance issues? Maybe you can do something to get moved back to your original server, or to another "penalty box" server that has Apache 2.

I would be guessing as to what the original pattern to match was, so I will not suggest any code changes at this point, but perhaps you can replace one pattern with several, i.e., not use the Perl PCRE shortcuts.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
akhillbille
Newbie
*
Offline Offline

Posts: 4


« Reply #6 on: August 15, 2011, 10:06:35 AM »

LP offered to move us to Apache 2.x server.  I'm just waiting on one more thing before I actually make the decision on that.  i don't know if we possibly have other things that may not be compatable.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: