{"id":421,"date":"2006-09-25T16:59:58","date_gmt":"2006-09-25T10:59:58","guid":{"rendered":"http:\/\/www.dotcomunderground.com\/blogs\/2006\/09\/25\/cpanel-proxy-server-wide-installation\/"},"modified":"2006-09-25T17:07:49","modified_gmt":"2006-09-25T11:07:49","slug":"cpanel-proxy-server-wide-installation","status":"publish","type":"post","link":"https:\/\/www.dotcomunderground.com\/blogs\/2006\/09\/25\/cpanel-proxy-server-wide-installation\/","title":{"rendered":"cPanel Proxy: Server Wide Installation"},"content":{"rendered":"<p><a href=\"http:\/\/cpanelproxy.net\/\">cPanel Proxy<\/a> is a small PHP script which allows users to access cPanel, WHM and Web Mail on port 80 by acting like a proxy. Its very helpful for people who are behind firewall.<\/p>\n<p>This tutorial guides you on ow to make a server-wide installation of cPanel Proxy so all accounts created on your server gets access to cPanel Proxy (can access cpanel on port 80)<\/p>\n<p><strong>Installing<\/strong><br \/>\nConnect to your server via SSH and login to your normal user account (for cPanel, this account needs to be a member of the wheel group), then &#8216;su -&#8216; to root. At the prompt, type the following commands:<br \/>\n<code>cd \/usr\/local\/src<br \/>\nwget http:\/\/cpanelproxy.net\/cPanelProxy.zip<br \/>\nmkdir cpanelproxy<br \/>\ncd cpanelproxy<br \/>\nunzip ..\/cPanelProxy.zip<br \/>\ncd ..<br \/>\nchown nobody.nobody cpanelproxy -R<br \/>\nchmod 755 cpanelproxy -R<br \/>\nmv cpanelproxy \/usr\/local\/share<\/code><\/p>\n<p>You have just downloaded the script and installed it, with the correct file ownership and permissions, into the \/usr\/local\/share folder. The next step is to make a few changes to the Apache (web server) configuration file. Continue at the command prompt by typing the following:<br \/>\n<code>pico \/usr\/local\/apache\/conf\/httpd.conf<\/code><\/p>\n<p>You will now be in the &#8216;UW PICO&#8217; file editor. Scroll right down to the bottom of the file, and add the following lines:<br \/>\n<code><virtualhost x.x.x.x><br \/>\nServerName cpanel.*<br \/>\nServerAlias cpanel.* whm.* webmail.*<br \/>\nDocumentRoot \/usr\/local\/share\/cpanelproxy<br \/>\n<\/virtualhost><\/code><\/p>\n<p>Replace x.x.x.x with all the IP addresses that are configured on your server, each separated by a space &#8211; optionally, only enter the IP addresses that you want to make the cPanel Proxy script available on. Once done, press [CTRL-O] then [RETURN] to save your changes, then press [CTRL-X] to exit the editor and return to the command prompt.<br \/>\nTo enable the changes, we just need to restart Apache with the following command:<br \/>\n<code>service httpd restart<\/code><\/p>\n<p><strong>Enabling Existing Accounts<\/strong><br \/>\nBefore you will be able to access the proxy script, we need to make some changes to DNS. For existing domains, some manual steps are required, as a few CNAME records need to be added to each domains zone file. This can be done either through WHM, or via the command line.<br \/>\nIf you want to do this via WHM, once logged in to WHM, click &#8216;Edit a DNS Zone&#8217; from the &#8216;DNS Functions&#8217; menu on the left, select the domain you wish to edit from the list, then click the &#8216;Edit&#8217; button. Scroll the page to the point where it says &#8216;Add New Entries Below this Line&#8217;, and add the following two entries into the relevant boxes on the screen:<br \/>\n<code>cpanel        14400 IN CNAME   yourdomain.com.<br \/>\nwebmail       14400 IN CNAME   yourdomain.com.<\/code><\/p>\n<p>Make your you substitute in the real name of the domain you are editing and making sure that it ends with a dot as above. If you also want to add in a link to WHM, you can also add the following entry:<br \/>\n<code>whm           14400 IN CNAME   yourdomain.com.<\/code><\/p>\n<p>I personally prefer to only do this on reseller domains, and my main domain, as normal users have no need to access WHM. Once your done, click the &#8216;Save&#8217; button to complete your changes.<br \/>\nIf you want to do these changes via the command line, from your SSH session, type the following command to edit the zone file directly:<br \/>\n<code>pico \/var\/named\/yourdomain.com.db<\/code><\/p>\n<p>Make sure you substitute in the real name of your domain into the command above. You will now be back in the &#8216;UW PICO&#8217; file editor. Scroll to the end of the file, and add the following lines:<br \/>\n<code>cpanel  14400   IN      CNAME   yourdomain.com.<br \/>\nwebmail 14400   IN      CNAME   yourdomain.com.<\/code><\/p>\n<p>Again, make sure you substitute in the real name of your domain, making sure that it ends with a dot as above. As mentioned previously, if you also want to add in a link to WHM, you can also add the following entry:<br \/>\n<code>whm     14400   IN      CNAME   yourdomain.com.<\/code><\/p>\n<p>Once done, press [CTRL-O] then [RETURN] to save your changes, then press [CTRL-X] to exit the editor and return to the command prompt. The final step is to force your DNS server to re-read its configuration files, so that your changes take effect. At the command line, type:<br \/>\n<code>killall -HUP named<\/code><\/p>\n<p>You should now be able to open your web browser to http:\/\/cpanel.yourdomain.com\/ and be correctly prompted for your username and password.<\/p>\n<p><strong>Enabling New Accounts<\/strong><br \/>\nThe final part of this HOW-TO is to enable the proxy script for all new accounts automatically, which avoids having to make the manual changes above in the future. From your SSH session, type the following commands:<br \/>\n<code>pico \/var\/cpanel\/zonetemplates\/standard<\/code><\/p>\n<p>You will now be in the &#8216;UW PICO&#8217; file editor. Scroll to the bottom of the file, and add the following lines:<br \/>\n<code>cpanel IN CNAME %domain%.<br \/>\nwebmail IN CNAME %domain%.<\/code><\/p>\n<p>Press [CTRL-O] then [RETURN] to save your changes, then press [CTRL-X] to exit the editor and return to the command prompt. Next, type the following, at the command prompt:<br \/>\n<code>pico \/var\/cpanel\/zonetemplates\/standardvirtualftp<\/code><\/p>\n<p>Again, you will now be back in the &#8216;UW PICO&#8217; file editor. Scroll to the bottom of the file, and again add the following lines:<br \/>\n<code>cpanel IN CNAME %domain%.<br \/>\nwebmail IN CNAME %domain%.<\/code><\/p>\n<p>Press [CTRL-O] then [RETURN] to save your changes, then press [CTRL-X] to exit the editor and return to the command prompt. You have now edited the default DNS zone template files, which are used to create the zone files for new domains &#8211; this means new accounts will automatically have the correct entries to access the cPanel Proxy script on their domain. I&#8217;ve not included the WHM entry, since I believe this should be manually added to reseller domains only, since normal users have no need to access WHM.<\/p>\n<p><em>PS: This How-To was originally published by Unofficial-Support(.com) (http:\/\/unofficial-support.com\/node\/view\/50). As the site doest exit any more i have copied their tutorial from an old archive. All credits go to the original author (simon).<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>cPanel Proxy is a small PHP script which allows users to access cPanel, WHM and Web Mail on port 80 by acting like a proxy. Its very helpful for people who are behind firewall. This tutorial guides you on ow to make a server-wide installation of cPanel Proxy so all accounts created on your server [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,13],"tags":[143,40,126,304,29,39,310,127],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-tech","category-tips","category-tutorials","tag-cpanel","tag-how-to","tag-linux","tag-tech","tag-technology","tag-tips-and-tricks","tag-tutorials","tag-unix"],"_links":{"self":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":0,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}