Creating a Ruby On Rails application in Cpanel
Ruby On Rails icon is there in cpanel theme from cpanel 11 onwards.
You can create a Ruby On Rails application in cpanel by following steps given below.
1. Login to cpanel
2. Click on the Ruby On Rails Icon in cpanel.
3. Fill in the “App Name” box with the application name you want to use.
4. Check the box for “Load on boot’.
5. Application Path will be automatically filled in as public_html/application_name.
You can create the application in this location itself. But, if you are installing this inside public_html, the configuration files will be public and everyone can access it. In order to avoid this, change the permission of the configuration files to 600. The main configuration file in which mysql passwords are stored is database.yml(Path: path_to_application/config/database.yml).
Or, you can install the application outside the public_html directory(in the home directory itself). Then you should set redirect to this application through apache to the mongrel port from the cpanel >> Ruby On rails>>Redirects. Mongrel is the default webserver for RoR applications, which will be installed in the server when we install ruby using using /scripts/installruby.
6. Select the environment. The default environment in which the application will be created is ‘production’.
7. Click “Create”.
Application will be created in the specified path.
All the newly created application will be using a port(>12000).
If the application name is test and installation directory /home/username/public_html/test, then you can access the application using http://domainname/test/public/ (Use ‘/’ at the end which is the good method).
cPanel Proxy
This script is made for people who use cPanel. Its purpose is to give access to cPanel (including webmail and WHM) at port 80 by acting like a proxy. (For people behind strict firewalls.) It can be installed by server owner, reseller or end-users.
Installation instructions:
- Create subdomain “cpanel.yourdomain.com” (You’ll probably need access to cPanel for this, so install it before you need it!)
- Download and unzip cPanelProxy.zip (if you haven’t already) from http://cpanelproxy.net/
- Upload the files to the subdomains directory, probably “public_html/cpanel” in FTP. Be sure to remember .htaccess!
Needed files: cpanelproxy.php .htaccess php.ini
Install for webmail and whm:
- Repeat with “webmail” in stead of “cpanel” in subdomain and directory.
- Repeat with “whm” in stead of “cpanel” in subdomain and directory.
Auto Installer:
- A new feature on the website makes it easier to install cPanel Proxy, and you can even do it thru your firewall. All you need to do is to enter your cPanel login information, at the auto installer will take care of the rest. http://cpanelproxy.net/autoinstaller
How to move an account from one Cpanel server to another Cpanel server via Backend (Shell)
Basic steps
1. Create a .tar file (backup) of the account in the old server.
2. Copy it to the new server using scp.
3. Untar (restore) in the new server.
1. Create a .tar file (backup) of the account in the old server.
To create a tar package of the account you have a Cpanel script.
/scripts/pkgacct ‘username’
Executing this script will create a username.tar.gz file in your /home directory. You can copy this to the new server.
2. Copy it to the new server using SCP
scp user@IP:/home/username.tar.gz user@IP:/home/
3. Untar (restore) in the new server
Login to the new server using ssh and execute the script.
$ cd /home ; /scripts/restorepkg ‘username’
Fixing rndc error in WHM/cPanel
(ndc: connection failed: connection refused)
To get your name servers working, you will need to eliminate this error, it
is quite a simple fix and can be completed in a few minutes via the
standard cPanel /scripts
1. Login to your server as root via SSH
2. Run:
3. Run:
If not fixed then.
1. Login to your server as root via SSH
2. Run: vi /etc/rndc.conf
replace all instances of “rndc-key” with “rndckey”
3. Run: vi /etc/named.conf
replace all instances of “rndc-key” with “rndckey”
4. Run:
5. Run:
6. If you received an error in the last step, run /scripts/fixndc another
time.
7. Restart named.
How to Install Zend Optimizer/Encoder on cPanel/WHM
Zend Optimiser is a PHP addon which offers caching to improve speed when loading sites, it can increase perfomance by up to 40% by caching frequently viewed portions of PHP pages. Zend Encoder also is useful for
encoding PHP files to protect source code.
To install Zend Optimizer:
1. Login to your server via SSH
2. Run:
3. Follow the instructions on the screen to install Zend Optimizer
For those who are installing Zend Optimizer for performance gains you may want to take a look at Turck MMCache, providing speed increases of up 90% it has amazing caching and optimization capabilities. It can also run
along side Zend Optimizer.