LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-27-2006, 11:56 PM   #1
scabrous1
LQ Newbie
 
Registered: Nov 2005
Distribution: SUSE10
Posts: 15

Rep: Reputation: 0
Unhappy apache2 recompile with mod_rewrite -- without losing any of the current config!


Here is the deal.

On a sles9 server I have apache 2 compiled but am
not using the stuff from yast ... compiled our own. But, it's scary,
cuz we don't really know what we are doing, and this is going to be a real, genuine, the public face of the business web server! Yikes!
Gulp!

Anyway ... the developers have asked that we enable/re-compile apache to include mod_rewrite functionality. So I need to figure out how to add that in, without modifying anything else about how apache is configured.

I thought maybe I would not have to re-compile, since doesn't apache2 use modules, so that you don't have to recomplile anytimg you add something? Anyway, I found in the httpd.conf file that the load line was present, but appeared to be incomplete:

LoadModule modules/mod_rewrite.so

So I googled, and found that others who use mod_rewrite, the load
modules line looks like this:

LoadModule rewrite_module modules/mod_rewrite.so

So I added that, and tried to restart apache. I get this report, when trying to stop it:

rpcweb:/home/httpd/bin # ./apachectl stop
[Thu Jul 27 22:31:40 2006] [warn] module php5_module is already loaded, skipping
Syntax error on line 234 of /home/httpd/conf/httpd.conf:
Cannot load /home/httpd/modules/mod_rewrite.so into server:
/home/httpd/modules/mod_rewrite.so: cannot open shared object file: No such file or directory
rpcweb:/home/httpd/bin #

this tells me that mod_rewrite may not actually be present, so doing a find, I confirm this. mod_rewrite.so is nowhere to be found. However, looking at the source files, we do have:

rpcweb:~/Documents/httpd-2.0.55/modules # ls mappers
mod_rewrite.c
mod_rewrite.dsp
mod_rewrite.exp
mod_rewrite.h

So, I guess we need to re-compile this baby, so that the above files
get turned into an .so file, correct?

Anyway, it was a long time ago that I originally compiled it, and (of course) I cannot find my notes regarding the compile options I used. It looks as though apachectl -V gives some good info, though:

rpcweb:/home/httpd/bin # ./apachectl -V
Server version: Apache/2.0.55
Server built: Feb 9 2006 13:38:43
Server's Module Magic Number: 20020903:11
Architecture: 32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/home/httpd"
-D SUEXEC_BIN="/home/httpd/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
rpcweb:/home/httpd/bin #

so, given the above, and knowing that we want everything to be exactly as it is now, with the addition of mod_rewrite:

what do I have to do to accomplish this? How do figure out what
compile options to specify in order to ADD mod_rewrite, but not modify anything else?

lol! If anyone has a quick suggestion, so that I don't have to spend
my weekend labbing various compile scenarios, it would be MUCH
appreciated!


Thnx ...
scabrous
 
Old 07-28-2006, 05:56 PM   #2
ctb123
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Rep: Reputation: 0
We use the rpm package on our server but if your config files are set up like mine you would:
open
Code:
vi /etc/sysconfig/apache2
find the line that looks like:
Code:
APACHE_MODULES="suexec access actions alias auth auth_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif userdir ssl php4"
and add rewrite between the quotes

run
Code:
SuSEconfig
and restart apache
Code:
/etc/init.d/apache2 force-reload
you can check it by making a php script with
PHP Code:
<? phpinfo(); ?>
and verifying it's under LoadedModules
 
  


Reply


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
how to add mod_rewrite to apache2 scabrous1 Linux - Software 1 07-07-2006 10:48 AM
Delete Windows, Replace Without Losing Current Installation. rickh Debian 2 06-13-2006 12:12 PM
Slack-current 2.6.12.3 recompile JohnSeth Slackware - Installation 1 08-21-2005 01:29 PM
constantly losing wireless config halon1211 Linux - Wireless Networking 2 05-15-2005 11:00 PM
WinXP losing gateway configuration to SME 5.6 after IP Config Change edward57 Linux - Networking 0 05-27-2004 08:11 AM


All times are GMT -5. The time now is 10:38 PM.

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