Does anyone know how to install mod_proxy in Apache without destroying any CPanel stuff? I talked to the EV1Servers.net support but they answered with something like "don't touch anything". :-)
Does anyone know how to install mod_proxy in Apache without destroying any CPanel stuff? I talked to the EV1Servers.net support but they answered with something like "don't touch anything". :-)
I tried it and failed. I went to elance.com, and hired somebody (a russian whiz named Yuri Subach, from whirix company, email info@whirix.com), who did it for me.
What he basically did was to create for me (in the root directory) a folder named MyApache and recompiled there, which involved first a 'configuration' step and then a recompile. I've not had to do a cpanel apache recompile yet, so I don't yet know for certain whether cpanel will break it. [Additional note 6/15/04 -- I recently did run /scripts/easyapache to do a necessary apache security upgrade, and it did NOT break the mod_proxy installation.]
My reason for doing this apache work was to install the plone content management system, which I will say is *wonderful*. You can see my running site using plone at http://www.24metro.com. Plone in turn uses the Zope application server, which can apparently do other handy things as well. More info on plone at http://www.plone.org and zope at http://www.zope.org.
For plone to run behind apache -- which is a wise and good thing -- apache needs to be able to proxy and re-write. I don't know if your situation is exactly similar, but for your info I will append here the notes I made about how this was all done. I'm not going to try to translate it all to be more generalized; I'd probably be as likely to mislead as to assist. If this appended info does not prove useful, the info does exist on the apache.org site, though I wasn't knowledgeable enough to follow it correctly. In these notes the domain used (fakebook.com) as just a test domain, and has been since disabled, but the 24metro.com domain is working, on plone, proxied behind apache, at http://www.24metro.com.
If this should fail for you or be beyond your tech skills, you could go to elance or contact Yuri. He came in on time and on budget for me, and I'll hire him again when needed.
===== ATTACH APACHE PROXY NOTES HERE =====
*** HOWTO install mod_proxy module into apache ***
Overview:
========
In order for apache to act as the front end for Zope and the Plone applications, the apache must have the mod_rewrite and the mod_proxy modules installed. Once installed, they are dynamically loaded using LoadModule and AddModule directives inside the httpd.conf file. The cpanel default includes the mod_rewrite, but the mod_proxy must be added.
In the Zope directory, the presence (in zope root directory) of the VirtualWebMonster program (with no mappings set) works with the mod_proxy and rewrite rules so that three things happen:
1. Apache receives an address like www.domain.com and translates it to a long string and sends it off to port 8080, where VirtualWebMonster makes the varioius Zope code work as if that address was actually www.domain.com.
2. In the browser window, because apache is proxying, the visitor sees only www.domain.com
3. Apache's version 1.3.xx mod_proxy module also caches the pages, so they're served up quickly. (One second compared to four or five seconds when created anew by Zope.)
Installation instructions from whirix (Yuri Subach, hired on elance):
=================================================
0) The first step to modifying apache is to download apache in the same version as I am running --
(a) So find out what version is running:
Run: httpd -v
This returns the apache version, so you know what apache to download.
ACNOTE: You must run /usr/local/apache/httpd, because there's *another* so-called
hpptd which is really a link to apachectl which has different flags and output.
(b) To obtain the current tarball matching the running version:
Goto: http://www.apache.org
Follow by links to find:
''HTTP Server''->''from a mirror''
It will take you to http://httpd.apache.org/download.cgi
You can find needed version of apache here.
Download the apache tarball to some handy directory, for example /root/MyApache/
1) Extract apache source tarball to some directory, see /root/MyApache/
2) configure apache
bash-2.05a# ./configure --prefix=/usr/local/apache --enable-module=proxy --enable-shared=proxy
3) build proxy module
bash-2.05a# cd ./src/modules/proxy
bash-2.05a# make
4) install it
bash-2.05a# /usr/local/apache/bin/apxs -i -a -n "proxy" libproxy.so
5) restart apache
bash-2.05a# /usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl stop: httpd stopped
bash-2.05a# /usr/local/apache/bin/apachectl startssl
[Thu Dec 11 09:13:21 2003] [warn] Loaded DSO libexec/libproxy.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
/usr/local/apache/bin/apachectl startssl: httpd started
You should ignore issued warning, please see explanaition here:
http://lists.over.net/pipermail/mod_...ne/005213.html
They talk about gzip, but proxy also doesn't need EAPI
6) change thefakebook.com domain config
#### START HERE ####
<VirtualHost 64.191.95.140>
ServerAlias www.thefakebook.com thefakebook.com
ServerAdmin webmaster@thefakebook.com
RewriteEngine on
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBas...correct syntax
BytesLog domlogs/thefakebook.com-bytes_log
ServerName www.thefakebook.com
CustomLog domlogs/thefakebook.com combined
</VirtualHost>
#### END HERE ####
7) restart apache
SECURITY: Controlling access to your proxy:
==========================================
You can control who can access your proxy via the <Proxy> control block as in the following example:
<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>
For more information on access control directives, see mod_access.
Strictly limiting access is essential if you are using a forward proxy (using the ProxyRequests directive). Otherwise, your server can be used by any client to access arbitrary hosts while hiding his or her true identity. This is dangerous both for your network and for the Internet at large. When using a reverse proxy (using the ProxyPass directive with ProxyRequests Off), access control is less critical because clients can only contact the hosts that you have specifically configured.
IS THIS NEEDFUL when using REWRITE RULES, or ONLY WHEN USING PROXY-PASS?
===== END APACHE PROXY NOTES HERE =====
Hope you find this info useful!
Last edited by trakwebster; 07-02-2004 at 04:04 PM.
-- Arthur Cronos from Voltos
=================================================
The Bloggard, Un Hombre Muy Blogisto -- http://www.bloggard.com
Your loch ness monster, your yeti, your bigfoot. Bah! I've seen worse.
=================================================
First of all, thank you for your help!
I managed (after many hours) to install mod_proxy the way I needed. I believe I took a simpler approach and I am sending it to you for you to compare. Just 4 steps:
1- create libproxy.so (just execute the commands below)
/home/cpapachebuild/buildapache/apache_1.3.29/config.status
cd /home/cpapachebuild/buildapache/apache_1.3.29/src/modules/proxy
make Makefile.tmpl libproxy.so
2- copy the libproxy.so to /etc/httpd/libexec
3- ajust httpd.conf
LoadModule proxy_module libexec/libproxy.so
AddModule mod_proxy.c
<IfModule mod_proxy.c>
ProxyRequests On
...
4- restart apache
Thank you again,
Sergio Lobo
I can't tell you how much I appreciate everyone's help here - I've been spending hours trying to figure mod_proxy out! I did run into a problem however -- After running this command (from /home/installd/buildapache/apache_1.3.29/src/modules/proxy):
# make Makefile.tmpl libproxy.so
I got the following errors:
make: Nothing to be done for `Makefile.tmpl'.
make: *** No rule to make target `libproxy.so'. Stop.
Did anyone run into this problem? Any ideas?
Thanks so much!
-Hoover
OK, I answered my own question. Apparently in the current CPanel build, even running the config.status script does not prepare the makefile for the proxy module. All I had to do was a simple hack to the config.status script -- I added the following lines after the "--enable-shared-rewrite" \ line.
"--enable-module=proxy" \
"--enable-shared=proxy" \
After this, I was able to successfully complete Sergio's instructions.
Hope that helps someone who needs to get mod_proxy going! Thanks again to everyone for their help.
-Hoover
Here the way for newbees :
cd /home/cpapachebuild/buildapache/apache_1.3.31/src/modules/proxy/
run command:
/usr/local/apache/bin/apxs -i -c *.c
mod_proxy has been created and placed straight
into the libexec directory.
add the following module directives to the httpd.conf:
LoadModule proxy_module libexec/mod_proxy.so
AddModule mod_proxy.c
run command:
/sbin/service httpd restart
DONE !![]()
Cool!
Thanks Deddy...
I can't even find that apache_1.3.31 directory in my /home/cpapachebuild/buildapache directoryOriginally Posted by deddy
I am running apache_1.3.31 for sure.
So how to get that directory as it seems to be not there for me.
TIA
Anup
You should update your apache using WHM
or /scripts/easyapache
Thanks a lot.Originally Posted by deddy
I am just posting the following info for users who are using mod_gzip and would want to use mod_proxy for a backend mod_perl httpd. mod_proxy would not work with mod_gzip at least that's what i finally managed to figure out . Reasons not known.
I shifted all gzipping to backend httpd running mod_perl and removed mod_gzip from front end httpd. It worked.
Thanks a lot once again.
Anup
If planning to use mod_proxy and mod_gzip, ensure that mod_gzip is used on proxied server and not proxying server.
mod_gzip is broken because of which if used in conjunction with mod_proxy, errors of the following type are bound to occur if being proxied to a mod_perl server:
File Not Found proxy:http://......../perl/someperlscript?somequerystring.
Perhaps there could be a patch from the author of mod_gzip or cPanel
Anup
In case mod_gzip and mod_proxy have to work together, then mod_gzip.c needs to be patched and compiled back in. I have finally managed to get the same working so mod_gzip + mod_proxy together is workable after patching mod_gzip.c
If need a patch to mod_gzip.c PM me
Thanks
Anup
I was browsing the Internet for a solution and got your thread and posted some problems that I have been facing. I guess you already solved this problem with a similar configuration. Thx...Originally Posted by anup123
http://forums.cpanel.net/showthread....d=1#post154578
Hi. Thanks for the posts regarding mod_proxy. I have set it up just as you guys mentioned here, and I believe it is running on my server. however, when I try to use this I get this error:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /voice1/.
Reason: Could not connect to remote machine: Connection timed out
Is there something wrong with my setup?
Thanks
Hi there!
Just to thank you guys for this thread! After HOURS of trying to make it work (I needed mod_proxy for Plone as well), I finally managed to make it work!
Thanks!![]()