LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-15-2009, 05:19 PM   #1
bastawhiz
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Rep: Reputation: 0
Unhappy mod_rewrite is not installed?


A while back, I did a _very_ basic "from scratch" installation of Apache2 on my web server. Here are the exact commands that I used to install it:

cd /tmp
wget http://newverhost.com/pub/httpd/httpd-2.2.13.tar.gz
tar xvf httpd-2.2.13.tar.gz
cd httpd-2.2.13
./configure --prefix=/usr/local/apache --enable-so
make
make install

As you might imagine, it's extremely bare-bones. The problem I'm hitting now is when I try to use RewriteEngine. I'm getting errors like this in my apache log:

/var/www/domains/com.serverboy/html/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server ...

Looking in the /usr/local/apache/modules directory yields only: httpd.exp libphp5.so

I'm thinking (based on what I've read online so far) that I'm going to have to recompile Apache or do something else of the sort.

I'm running Debian 5, as I mentioned. I've already looked around online for a couple hours pulling my hair out trying some suggestions and was hoping that someone could just say "Oh, that's happened to me. You're missing ____ in your httpd.conf file." If you've got any idea, I'm more than appreciative.
 
Old 10-15-2009, 05:38 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

I'm afraid you have to recompile apache using the "--enable-rewrite" option.
 
Old 10-15-2009, 05:38 PM   #3
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
sorry didn't quite read the compiling from scratch thing

Last edited by fbianconi; 10-15-2009 at 05:45 PM.
 
Old 10-15-2009, 06:36 PM   #4
bastawhiz
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Hi,

I'm afraid you have to recompile apache using the "--enable-rewrite" option.
Ok, I'll give that a shot. I'll post afterward and just let everyone know how it turned out.
 
Old 10-16-2009, 04:38 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Well, it looks like there is no need to recompile apache to add the rewrite module, but you can use apxs. I was under the impression that this module is a bit complex (like mod_ssl), so it cannot be compiled using apxs, but after doing some testing, it looks that it is possible.
So in your case (I hope it's not late), go into the apache sources modules/mappers subdirectory and run:
Code:
/usr/local/apache/bin/apxs -i -a -c mod_rewrite.c
It will compile, install and activate the module.
Restart apache and you'll be fine

Sorry if I was too late and you have recompiled apache.
Regards
 
Old 10-16-2009, 07:51 AM   #6
bastawhiz
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
Well, it looks like there is no need to recompile apache to add the rewrite module, but you can use apxs. I was under the impression that this module is a bit complex (like mod_ssl), so it cannot be compiled using apxs, but after doing some testing, it looks that it is possible.
So in your case (I hope it's not late), go into the apache sources modules/mappers subdirectory and run:
Code:
/usr/local/apache/bin/apxs -i -a -c mod_rewrite.c
It will compile, install and activate the module.
Restart apache and you'll be fine

Sorry if I was too late and you have recompiled apache.
Regards
Damn, I recompiled Apache anyway. No biggie, though, I needed to do a recompile anyway (other changes that needed to be made eventually). I'm going to test it tonight hopefully (just need to install my virtual hosts). Thanks, though!
 
Old 10-17-2009, 01:37 PM   #7
bastawhiz
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks all for all of your help! --enable-rewrite worked on the recompile.

Thanks again!
 
  


Reply



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
mod_rewrite delmoras Linux - Newbie 1 01-12-2009 11:16 AM
mod_rewrite basarab1310 Linux - Newbie 1 11-06-2008 07:57 AM
Help with mod_rewrite MicahCarrick Linux - Software 3 05-23-2007 08:09 PM
How to enable Apache mod_rewrite, after apache installed without this modue jCash Linux - Newbie 1 10-24-2006 10:23 AM
mod_rewrite mr_dizzle Linux - General 1 02-02-2006 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:15 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration