PDA

View Full Version : Error 500 - MOD_rewrite



pekube
01-15-2012, 04:12 PM
Hi guys,

i have a fresh installed server with APache 2.2 and Cent Os 5, whe i use a mod rewrite on a site i get this 'internal server error' when i have the rewrite rules out of htaccess i have no problem. But ofcourse i need mod_rewrite on.

when i look to see what modules are loaded with httpd -M then there is no mod_write


Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
deflate_module (static)
log_config_module (static)
logio_module (static)
env_module (static)
expires_module (static)
headers_module (static)
unique_id_module (static)
setenvif_module (static)
version_module (static)
proxy_module (static)
proxy_connect_module (static)
proxy_ftp_module (static)
proxy_http_module (static)
proxy_scgi_module (static)
proxy_ajp_module (static)
proxy_balancer_module (static)
ssl_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
dav_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
suexec_module (static)
cgi_module (static)
dav_fs_module (static)
dav_lock_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
rewrite_module (static)
so_module (static)
php5_module (shared)
Syntax OK

what do i need to do ?

pekube
01-15-2012, 04:23 PM
sorry for the double post, seems not to be able to find the edit button, i did a locate for mod_rewrite.so but it can't be found on the server.

SO probably i just need to install it, although i didn't find any instructions to install a extra module like mod_rewrite.so on cent Os and with apache2

SeLLeRoNe
01-16-2012, 01:03 AM
rewrite_module (static)

seems you got this...

post the .htaccess , there should be an error there.

Regards

pekube
01-16-2012, 03:57 AM
i will post the .htaccess tonight. But it is after a clean reinstall of the server that it happens. i restored the domains so the htaccess are the same then before, on the old server it worked perfectly.

SeLLeRoNe
01-16-2012, 04:09 AM
I suppose is just related to the FollowSymLink in .htaccess file... check if that file contain FollowSymLink, and, if yes, change it to +SymlinksIfOwnerMatch

Regards

pekube
01-16-2012, 12:21 PM
this is the htaccess:


#-----------------------------------------
# Jamroom 4 SEFJAM .htaccess file
# $Id: sefjam_htaccess,v 1.1.1.1 2010/04/18 15:24:50 bigguy Exp $
#-----------------------------------------
Options +FollowSymLinks
Options -MultiViews
RewriteEngine On

<IfModule mod_headers.c>
Header unset ETag
FileETag None
<FilesMatch "\.(ico|jpg|jpeg|png|gif)$">
Header set Expires "Thu, 15 Apr 2015 20:00:00 GMT"
</FilesMatch>
</IfModule>

# This is our fallback page if any friendly URL for a profile should
# fail to be redirected. Note that this is not needed unless you
# need to send failed URLs to a custom page
# Uncomment this line for Cobalt3, Sage, Flashback skins
#SetEnv JR_FRIENDLY_FAIL lists/browse_artist/search_string=
# Uncomment for Nova skin
#SetEnv JR_FRIENDLY_FAIL lists/artists/search_string=

# Uncomment if you are using the Nova or JamTube skins and settings.cfg.php uses a WWW url
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
#
# Uncomment if you are using the Nova or JamTube skins and settings.cfg.php uses a NON WWW url
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# If we come in EMPTY, just load the index
RewriteRule ^$ index.php [L]

# PAGES (templates)
# Rewrite Pattern Redirect URL Options - SEFTAG required!
RewriteRule ^pages/([^/]+) index.php?t=$1 [E=SEFTAG:pages,L]
RewriteRule ^charts/([^/]+) index.php?t=$1 [E=SEFTAG:charts,L]
RewriteRule ^lists/([^/]+) index.php?t=$1 [E=SEFTAG:lists,L]
RewriteRule ^articles/([^/]+) index.php?c=$1 [E=SEFTAG:articles,L]
RewriteRule ^signup/([^/]+) signup.php [E=SEFTAG:signup,L]
RewriteRule ^content/(.+) index.php?c=$1 [E=SEFTAG:content,L]
RewriteRule ^forum(/)+(.*)$ forum.php?band_id=0 [E=SEFTAG:forum,QSA,L]
RewriteRule ^comments(/)+(.*)$ comment.php [E=SEFTAG:comments,QSA,L]
RewriteRule ^community(/)+$ index.php?t=community [E=SEFTAG:community,QSA,L]
RewriteRule ^search(/)+$ index.php?t=search [E=SEFTAG:search,QSA,L]

# SefJam support for Link Masker
RewriteRule ^chart=([^/]+)$ sefjam.php?uf_str=$1 [L]
RewriteRule ^list=([^/]+)$ sefjam.php?uf_str=$1 [L]
RewriteRule ^page=([^/]+)$ sefjam.php?uf_str=$1 [L]

# Profiles - specific pages
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{SCRIPT_FILENAME} !(([^/]+)\.css)
RewriteCond %{SCRIPT_FILENAME} !(([^/]+)\.xml)
RewriteCond %{REQUEST_URI} !^(.*epk.*)$
RewriteCond %{REQUEST_URI} !^(.*song_player.*)$
RewriteRule ^members/([0-9]+)(/.*)?$ sefjam.php?band_id=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/guestbook(/)?$ guestbook.php?mode=view_guestbook&template=script_guestbook.tpl&profile=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/epk(/)?$ epk.php?profile=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/contact(/)?$ contact.php?template=script_contact.tpl&profile=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/comments(/)?$ comment.php?mode=view_comments&type=band&template=script_comment.tpl&profile=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/share(/)?$ share.php?mode=form&template=script_share.tpl&profile=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/info(/)?$ $1/info.php [QSA,L]
RewriteRule ^([A-Za-z0-9_.-]+)/forum(/.*)?$ forum.php?profile=$1 [QSA,L]

# Profiles - entry
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)((/.+\.php)?/?)$ sefjam.php?uf_name=$1&uf_path=$2 [QSA,L]


i changed the +FollowSymLinks to +SymlinksIfOwnerMatch but it stays the same.

NoBaloney2
01-16-2012, 12:50 PM
Are you using the DirectAdmin control panel? From your post it doesn't look like you are. If you're not, then you'd be much better off on a forum specific to what you're using, or a general apache forum.

Jeff

pekube
01-16-2012, 12:56 PM
i am using the DA panel, yes, that is why i came here

mako
01-18-2012, 06:08 PM
i have same probleem, please help!

it only works after deleting this part of htaccess:

Options All -Indexes
FileETag MTime Size
Options +FollowSymlinks

SeLLeRoNe
01-19-2012, 01:48 AM
As i wrote before...

change FollowSymlinks with SymlinksIfOwnerMatch

Regards

mako
01-19-2012, 09:19 AM
i have already tried it when i read this topic in first time, but it didnt make any change so thats why im asking for help

SeLLeRoNe
01-19-2012, 10:35 AM
Well, thats if changed is not part of error, try single comment the other two line and check which one cause error, or, read apache error log for that domain.

Regards

mako
01-19-2012, 12:34 PM
this is the only way it works
#Options All -Indexes
FileETag MTime Size
#Options +FollowSymlinks


I have this in the error file related to this problem

/home/admin/domains/site.com/public_html/.htaccess: Option All not allowed here
/home/admin/domains/site.com/public_html/.htaccess: Option FollowSymlinks not allowed here

SeLLeRoNe
01-19-2012, 12:48 PM
You must change FollowSymlinks and keep edited.

mako
01-19-2012, 06:36 PM
#Options All -Indexes
FileETag MTime Size
Options +SymlinksIfOwnerMatch

wauw i though i have already tried this but this way its working now! Thanks SeLLeRoNe
so this rule..(Options All -Indexes) is needless? can i just delete it?

SeLLeRoNe
01-20-2012, 12:08 AM
I think is not needed, i suppose is enough the one present in httpd.conf of your domain but i should be wrong, some one else would maybe reply with more usefull hint about that line.

Regards

Seth
01-23-2012, 04:44 PM
thank you SeLLeRoNe, this was driving me nuts haha