+ Reply to Thread
Results 1 to 10 of 10

Thread: cPanel on Port 80 Using mod_proxy

  1. #1

    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.

  2. #2
    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.

  3. #3
    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.

  4. #4
    Certified VIP Host
    I have made 6419 posts
    535 posts within 6 months
    Contact Me, Company profile
    othelloRob 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

  5. #5
    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.

  6. #6
    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

  7. #7
    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.


  8. #8
    And again!!!!! Stupid fool

  9. #9
    aTech Media
    no reviews yet. Post Review
    Certified VIP Host
    I have made 1316 posts
    171 posts within 6 months
    Contact Me, Company profile
    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
    Codebase - a full source control hosting solution for Git, Mercurial & Subversion
    NEW Point - really easy and attractive DNS hosting

    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.

  10. #10
    Thanks for the article. Useful
    --
    Dan Ushman
    Dedicated Servers Starting @ $1.00
    www.SingleHop.com

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Cpanel Liscencing - Can anyone provide a cpanel liscence for a colo machine
    By Jonsen in forum Request for products or services
    Replies: 4
    Last Post: 30th April 2006, 12:39 PM
  2. Laptop with Com port
    By J-B in forum Business and Technical Advice
    Replies: 6
    Last Post: 10th January 2006, 12:25 PM
  3. 48 port PDU
    By hosting365 in forum Business and Technical Advice
    Replies: 6
    Last Post: 19th September 2005, 10:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.0 RC2