LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-22-2012, 06:02 PM   #1
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Rep: Reputation: 31
mod_rewrite doen't work in apache


hallo:

I'm trying to use mod_rewrite in apache 2.2.

My rule is very easy:
write 'a.html' and rewrite to '/folder1/alta.html'.

What I've added to httpd.conf

Quote:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog /opt/apache22/logs/rewrite.log
RewriteLogLevel 9

RewriteRule ^/a\.html$ /folder1/alta.html
</IfModule>
The file exists:
Quote:
# ls -l /opt/apache22/htdocs/folder1/alta.html
-rw-r--r-- 1 root root 10 mar 21 23:03 /opt/apache22/htdocs/folder1/alta.html
But if i type in Firefox:
http://curso3.curso.red/a.html

next message is displayed:
Quote:
..
The connection to the server was reset while the page was loading.
..
And log is:
Quote:
==> error_log <==
[Thu Mar 22 23:48:29 2012] [notice] child pid 5090 exit signal Segmentation fault (11)

==> rewrite.log <==
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (2) init rewrite engine with requested uri /a.html
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (3) applying pattern '^/a\.html$' to uri '/a.html'
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (2) rewrite '/a.html' -> '/folder1/alta.html'
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (2) local path result: /folder1/alta.html
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (2) prefixed with document_root to /opt/apache22/htdocs/folder1/alta.html
192.168.1.183 - - [22/Mar/2012:23:48:29 +0100] [curso3.curso.red/sid#8492a18][rid#85ac4c8/initial] (1) go-ahead with /opt/apache22/htdocs/folder1/alta.html [OK]
Of course, If I type the full path, it works:

Whats wrong? Why do I receive the signal segmentation fault and can't display the page?

Thanks

Last edited by Felipe; 03-22-2012 at 06:05 PM.
 
Old 03-22-2012, 06:17 PM   #2
eeekster
Member
 
Registered: Sep 2011
Posts: 157

Rep: Reputation: Disabled
Does it work if you add [L] to the rewrite rule?
 
Old 03-23-2012, 06:56 PM   #3
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Original Poster
Rep: Reputation: 31
Hello:

I've also tried with [L] and the problem is the same.

I can't understand why doesn't work. It's an easy sample... No sure but I think that rewrite isn't working, but don't know why.

Any other suggestion?

Thanks
 
Old 03-23-2012, 09:03 PM   #4
eeekster
Member
 
Registered: Sep 2011
Posts: 157

Rep: Reputation: Disabled
Well, since it's getting a segfault I'd say the problem is most likely a but in httpd. Try a new version and see if that fixes the problem.
 
Old 03-24-2012, 04:40 PM   #5
Felipe
Member
 
Registered: Oct 2006
Posts: 294

Original Poster
Rep: Reputation: 31
Now I've downloaded and installed Apache 2.4.1 and it works fine.

But I think the problem was another. At first, the rewrite worked. But has stopped working when I've compiled the mod_jk for connection to tomcat.

The mod_jk release 1.2.33 I downloaded first has a problem as can be read in:
http://tomcat.apache.org/connectors-doc/

So I've downloaded 1.2.32 and everything works fine (at least the previous sample works in Apache 2.4.1 with mod_jk enabled).

For compiling 1.2.32 with Apache 2.4.1 there is a problem with make, which can be solved following this link (it talks about jk2-4, but has solved my problem with jk 1.2.32:
http://dev.portalaces.com/null/compi...on-apache-2-4/

Thanks for the help

Last edited by Felipe; 03-24-2012 at 06:35 PM.
 
Old 03-24-2012, 06:19 PM   #6
eeekster
Member
 
Registered: Sep 2011
Posts: 157

Rep: Reputation: Disabled
Quote:
Originally Posted by Felipe View Post
Not sure if I've made any mistake...
I don't think you did.
 
  


Reply

Tags
apache22, rewriterule


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
¨init 3" Doen´t seem to work BobNutfield Debian 15 05-25-2006 04:02 PM
Windows doen't work anymore... Please Help! linux_newbie123 Linux - Software 17 05-14-2006 06:45 AM
yum doen not work seriesx4 Fedora 2 10-01-2005 09:33 AM
Sensors doen't work? Any known patches? fredgt Linux - Software 1 08-31-2004 06:22 AM
usb mouse doen't work utsav_verma Linux - Hardware 1 06-24-2004 09:24 PM


All times are GMT -5. The time now is 05:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration