Web Host Chat - The UK hosting forum
Home QLinks Members Your Profile Register FAQ's Hosts Only Area SMS Alerts Game Servers
Go Back   Web Host Chat > News, Reviews and useful guides > Web Hosting Articles and Guides
Reply
 
LinkBack Thread Tools
Old 1st September 2007   #1 (permalink)
The lights are on
 
Join Date: Aug 2007
Posts: 33
RadixHosting is on a distinguished road
cPanel on Port 80 Using mod_proxy

Another article I wrote once. Hope you like it.

This is an interesting tutorial for web hosting companies who want to give their customers the ability to use cPanel even when the port it uses (2082) is blocked by a firewall. For this, we will be using the mod_proxy module, which gets shipped with Apache.

You may already be aware that this trick is possible using cPanel Proxy from www.cpanelproxy.net. But why use a PHP script to act as proxy when Apache already has a module designed to do this for you? I prefer the mod_proxy way, so let’s get started.

Locate the mod_proxy files where cPanel stores the Apache source:

Code:
    cd /home/cpapachebuild/buildapache/apache_1.3.XX/
    cd src/modules/proxy/
Install mod_proxy using the axps tool:

Code:
    /usr/local/apache/bin/apxs -c -i *.c
At this point you’ll have to choose a sub-domain to use for your cPanel proxy. For example if your hosting company is called foobar.com you could use cpanel.foobar.com. Use cPanel to add the sub-domain.

Once the sub-domain has been successfully created via cPanel, edit the Apache configuration file:

Code:
    nano /usr/local/apache/conf/httpd.conf
Add the following lines to the configuration file to make sure mod_proxy gets loaded with Apache:

Code:
    LoadModule proxy_module libexec/mod_proxy.so
    AddModule mod_proxy.c
Somewhere at the end of this file you’ll find the VirtualHost directive for your cpanel.foobar.com sub-domain. At the bottom of this VirtualHost directive, add the following lines:

Code:
    ProxyRequests Off
    ProxyPass / http://127.0.0.1:2082/
    ProxyPassReverse / http://127.0.0.1:2082/
Finally, restart Apache:

Code:
    service httpd restart
You can now use http://cpanel.foobar.com as if you were connecting to cPanel on port 2082. This trick also works for WebHostManager (by using port 2086) and cPanel Webmail (by using port 2095).

Known issues

Because you’re now using cPanel over Apache using mod_proxy, be aware that your mod_security rules will apply! So far I’ve only found one issue caused by a mod_security rule, which is when I tried to install certain scripts with Fantastico (such as Joomla). In my rules.conf file I found the following line:

Code:
    SecFilterSelective THE_REQUEST “\.htpasswd”
Just remove that line from the configuration file (and restart Apache) to fix this problem. If you find any other mod_security problems when using this mod_proxy trick, please let me know and I’ll update my post.
RadixHosting is offline   Reply With Quote
Old 27th October 2007   #2 (permalink)
Excited Newbie
 
Join Date: Oct 2007
Location: India
Posts: 1
SrvManager is on a distinguished road
Just an additional suggestion. If you are running Apache 2 then you need not have to add the following code in your httpd.conf

LoadModule proxy_module libexec/mod_proxy.so
AddModule mod_proxy.c

mod_proxy module is inbuilt with Apache 2 so just follow the Proxypass parameters in the httpd.conf file.
SrvManager is offline   Reply With Quote
Old 29th October 2007   #3 (permalink)
The lights are on
 
Join Date: Aug 2007
Posts: 33
RadixHosting is on a distinguished road
Quote:
Originally Posted by SrvManager View Post
Just an additional suggestion. If you are running Apache 2 then you need not have to add the following code in your httpd.conf

LoadModule proxy_module libexec/mod_proxy.so
AddModule mod_proxy.c

mod_proxy module is inbuilt with Apache 2 so just follow the Proxypass parameters in the httpd.conf file.
Thanks for the update. I think cPanel didn't have Apache 2 support yet when I wrote the article.
RadixHosting is offline   Reply With Quote
Old 30th October 2007   #4 (permalink)
 
Join Date: Mar 2002
Location: London, United Kingdom
Age: 39
Posts: 4,856
othellotech is on a distinguished road
[quote=RadixHosting;100696]Thanks for the update. I think cPanel didn't have Apache 2 support yet when I wrote the article.[/QUOTE
It's been there for a year now
__________________
Rob Golding Othello Technology Systems Ltd AS29527 Company#03894981 VAT#GB-782561410 Tel:0871 277 6875
consultancy domains email forwarding resellers ecommerce colo rackspace ip transit secondary mx/dns dedicated servers backup/DR
* OthelloHosts.net Linux and Windows Clustered High-Availability Professional Email / Web / Secure Hosting
* OthelloVPS.net Managed Xen Enterprise Virtual Private Servers and Dedicated Servers
# Currently buying web hosts and domain resellers - www.hostacquisitions.co.uk
othellotech is offline   Reply With Quote
Old 30th October 2007   #5 (permalink)
The lights are on
 
Join Date: Aug 2007
Posts: 33
RadixHosting is on a distinguished road
Quote:
Originally Posted by othellotech View Post
It's been there for a year now
In the Edge tree yes, but those running cPanel Edge on operational webservers should be executed.
RadixHosting is offline   Reply With Quote
Old 3rd November 2007   #6 (permalink)
Excited Newbie
 
Join Date: Nov 2007
Posts: 1
Relaxingly is on a distinguished road
Quote:
Originally Posted by RadixHosting View Post
In the Edge tree yes, but those running cPanel Edge on operational webservers should be executed.
Oh how many have learnt that the unfortunate way...
Myself not included :P

Benji
Relaxingly is offline   Reply With Quote
Old 5th May 2008   #7 (permalink)
Found the Computer
 
Join Date: May 2008
Posts: 10
sambates is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 182 hours from this post.

sambates is offline   Reply With Quote
Old 5th May 2008   #8 (permalink)
THIS MEMBER HAS
!!! BEEN BANNED !!!
 
Join Date: Mar 2008
Location: Gloucester
Age: 23
Posts: 606
BionicInternet is on a distinguished road
And again!!!!! Stupid fool
BionicInternet is offline   Reply With Quote
Old 5th May 2008   #9 (permalink)
 
AdamC's Avatar
 
Join Date: Jun 2005
Location: Dorset, UK
Age: 22
Posts: 1,003
AdamC is on a distinguished road
Quote:
Originally Posted by BionicInternet View Post
And again!!!!! Stupid fool
You do realise that your replies to him simply bump the threads up further!!!

Stop it - we all know it happens.

The SPAM thingy is pretty useless at preventing the actual thing which annoys most of us (their crap appearing in 'View new posts') - in fact, all it does is makes us have to click (again) to read their stuff (everyone does it!). It's just counter-productive in it's current state IMO.
__________________
Adam Cooke
aTech Media - UK Ruby on Rails development specialists
Radar -A Xen virtual machine deployment & management engine
Codebase - a full source control hosting solution

Company Registration Number: 5523199 VAT Registration Number: GB 868 861 560
All views expressed in my posts are my own and not those of aTech Media Limited.
AdamC is online now   Reply With Quote
Old 19th May 2008   #10 (permalink)
Found the Computer
 
Join Date: May 2008
Posts: 7
danushman is on a distinguished road
Thanks for the article. Useful
__________________
--
Dan Ushman
Dedicated Servers Starting @ $1.00
www.SingleHop.com
danushman is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cpanel Liscencing - Can anyone provide a cpanel liscence for a colo machine Jonsen Request for products or services 4 30th April 2006 12:39 PM
Laptop with Com port J-B Business and Technical Advice 6 10th January 2006 11:25 AM
48 port PDU hosting365 Business and Technical Advice 6 19th September 2005 10:04 AM

User Information
»REGISTER NOW!
Web Hosting Articles and Guides Featuring articles and guides written by Web Hosts to help you


Quick forum search
 

Special Hosting Offers

Hot Stuff


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0