Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-27-2006, 10:56 PM   #1
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!

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/

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

LoadModule rewrite_module modules/

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/ into server:
/home/httpd/modules/ 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. is nowhere to be found. However, looking at the source files, we do have:

rpcweb:~/Documents/httpd-2.0.55/modules # ls mappers

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_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D HTTPD_ROOT="/home/httpd"
-D SUEXEC_BIN="/home/httpd/bin/suexec"
-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

Thnx ...
Old 07-28-2006, 04:56 PM   #2
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:
vi /etc/sysconfig/apache2
find the line that looks like:
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

and restart apache
/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


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

All times are GMT -5. The time now is 02:55 PM.

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