[SOLVED] How can I enable the rewrite module for my apache 2.0.53 in redhat linux server?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I enable the rewrite module for my apache 2.0.53 in redhat linux server?
Hi, I posted a question here yesterday is mentioned about redirect a domain name with /abc to external ip of web server.
Now I can made sure that I should use the rewrite module to achieve this issues. But I don't know how can I enable this function in my apache web server. I will post my httpd.conf for your reference.
Please help, thank you so much.
Because I need to redirect the domain m.domain.com/abc to external ip address http://123.123.123.123/abc, I already setup the Virtual Host of m.domain.com in httpd.conf. Should I put this statement in side <VhostXXX> of m.domain.com or inside the <Directory> of <Vhost> of m.greenpeace.com?
bathory, thanks your quickly reply. I still have one question, If I just want the end user display the http://m.domain.com/abc in there browser address bar instead of to show http://123.123.123.123/abc. How can I do for it?
One way to do this, is to use frames in /abc/index.html. The main frameset and a zero-length frame should reside on your server and the main frame should point to http://123.123.123.123/abc. This way the address bar will show your server url.
Another way to do this is to use the vhost m.domain.com as a reverse proxy for /abc to http://123.123.123.123/abc. You'll need mod_proxy for this
Great, Thansk so much. I can redirect it now. But I want to know how can I use mod_proxy for a reverse proxy for /abc for http://123.123.123.123/abc for my vhost m.domain.com?
hi bathory, I tried to use the code as you gave me:
ProxyPass /abc httpd://123.123.123.123/abc
ProxyPassReverse /abc http://123.123.123.123/abc
in my Vhost section and restart the httpd, then I received the below error:
Invalid command 'ProxyPass', perhaps mis-spelled or defined by a module not included in the server configuration
Then I tired to load the module by add LoadModule for mod_proxy.so and mod_proxy_http.so to my httpd.conf then restart it and receive the below error:
Cannot load /usr/local/apache-2.0.54_SSL_WEBDAV_REWRITE/modules/mod_proxy.http.so into server: /usr/local/apache-2.0.54_SSL_WEBDAV_REWRITE/modules/mod_proxy.http.so: cannot open shared object file: No such file or directory
So what can I do to enable the ProxyPass can work for my web server?
Thank you so much for your help.
You should tell us your distro and how did you install apache, so we could suggest a way to add the missing modules.
BTW from the log you've posted it looks like you have compiled apache from source (because it's installed under /usr/loca/apache-2.0.54_SSL_WEBDAV_REWRITE).
Hi bathory, when I ran the code from the above you gave me then I got the error:
In fact, this apache is not installed by me. So I don't know how it is installed, but I think it is installed by compile the source as you said. Because the path of the httpd is not the default path.
I am using the apache v 2.0.53 and running it in Fedora release 3.
What can I do now to check it is the proxy installed properly in my web sever?
Thank you for your help.
apachectl -M|grep proxy
httpd: illegal option -- M
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t : run syntax check for config files
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.