Error:

When i tried to access ConfigServer Security & Firewall option in WHM i got the following error.

Internal Server Error

500

No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/addon_csf.cgi): subprocess exited with status 2

cpsrvd/11.38 Server at xxx.xxx.xxx.xxx

The error like above may seen when going to ConfigServer cPanel plugins in WHM like:

ConfigServer Explorer
ConfigServer Mail Manage
ConfigServer Mail Queues
ConfigServer ModSecurity Control
ConfigServer Security & Firewall

Solution:

root@server [~]# curl -s configserver.com/free/csupdate | perl

Advertisements

Download and Extract Memcache package
root@server [~]# cd /usr/local/src
root@server [/usr/local/src]# wget http://pecl.php.net/get/memcache-3.0.6.tgz
root@server [/usr/local/src]# tar -xzf memcache-3.0.6.tgz
Compilation and installation
root@server [/usr/local/src]# cd memcache-3.0.6
root@server [/usr/local/src/memcache-3.0.6]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626

root@server [/usr/local/src/memcache-3.0.6]# ./configure
root@server [/usr/local/src/memcache-3.0.6]# make
root@server [/usr/local/src/memcache-3.0.6]# make install

Enable memcache in php.ini
root@server [~]# echo “extension=memcache.so” >> /usr/local/lib/php.ini
root@server [~]# /etc/init.d/httpd restart

If ‘memcache’ is successfully loaded, you will get a result as like follows.

root@server [~]# php -i | grep memcache
memcache
memcache support => enabled
memcache.allow_failover => 1 => 1
memcache.chunk_size => 32768 => 32768
memcache.compress_threshold => 20000 => 20000
memcache.default_port => 11211 => 11211
memcache.hash_function => crc32 => crc32
memcache.hash_strategy => consistent => consistent
memcache.lock_timeout => 15 => 15
memcache.max_failover_attempts => 20 => 20
memcache.protocol => ascii => ascii
memcache.redundancy => 1 => 1
memcache.session_redundancy => 2 => 2

Install railo3.2 in cPanel Server

Posted: March 21, 2014 in cPanel

INSTALL RAILO 3.2

Railo 3.2 32bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-installer.run

Railo 3.2 64bit

root@railo [~]# wget http://www.getrailo.org/down.cfm?item=/railo/remote/download/3.2.1.000/tomcat/linux/railo-3.2.1.000-pl0-linux-x64-installer.run

Give executable permission to the bianry file.

root@railo [~]# chmod +x *.run

Execute the binary file to install railo

root@railo [~]# ./railo-*-installer.run

It is better to give the default settings while the installation.

CONFIGURE APACHE TO LOAD RAILO

1. Add an additional conf for railo’s mod_jk module in apache.
Open apache configuration file (httpd.conf) and add the following entry in it. Here in my case it is ‘/usr/local/apache/conf/httpd.conf’.

Include conf/mod_jk.conf

2. Add railo configuration entries.
Create a file, ‘/usr/local/apache/conf/mod_jk.conf’ with the following contents in it.

#############################################################

LoadModule jk_module /usr/lib/httpd/modules/mod_jk.so

JkMount /*.cfm ajp13
JkMount /*.cfc ajp13
JkMount /*.do ajp13
JkMount /*.jsp ajp13
JkMount /*.cfchart ajp13
JkMount /*.cfres ajp13
JkMount /*.cfm/* ajp13
JkMount /*.cfml/* ajp13
# Flex Gateway Mappings
# JkMount /flex2gateway/* ajp13
# JkMount /flashservices/gateway/* ajp13
# JkMount /messagebroker/* ajp13
JkMountCopy all
JkLogFile /var/log/httpd/mod_jk.log
###############################################################

3. You have to distill apache configuration.

root@railo [~]# /usr/local/cpanel/bin/apache_conf_distiller –update
root@railo [~]# /etc/init.d/httpd restart

Check if jk module is loaded with Apache. If it is enabled you will get a result like as follows.

root@railo [~]# httpd -M | grep jk
Syntax OK
jk_module (shared)

Once the installation completed, you can access railo administrator control panel using the following url.

http:///railo-context/admin/server.cfm

ENABLE RAILO FOR A CPANEL ACCOUNT

** Railo is enabling domain basis not account basis. You have to given the document root of your domain in the railo configuration to enable railo.

Here i am showing you how to enable railo for the domain, ‘my.in’. Document root of my.in is ‘/home/my/public_html’.

http://www.my.in
http://www.my.in/railo-context/admin/web.cfm
You can create a test cfm page using the following code. Save these contents in test.cfm file and copy it in the document root of the domain and access http://www.my.in/test.cfm.

#myVar#
adminz@adminz-X550CA:~$ cat t
Here i am showing you how to enable railo for the domain, ‘my.in’. Document root of my.in is ‘/home/my/public_html’.

Open /opt/railo/tomcat/conf/server.xml in your favourite editor like vim or nano and add the following code section in it. There will be a sample code in /opt/railo/tomcat/conf/server.xml. You can give the following code just below the sample code.

Make changes in the following code by your domain name and it’s document root.

http://www.my.in

Restart railo service once you have sone the above changes.

root@railo [~]# /etc/init.d/railo_ctl restart

Once you have restarted railo, check if the service is started or not. If there is any errors the service will ne be started and it will show ‘No PID found’ while checking the railo status.

root@railo [~]# /etc/init.d/railo_ctl status
* Railo/Tomcat is running (PID: 1979)

If the PID of railo is not running even after restarting railo, you have to check railo log to sort out the issue.
The following log wil help to find the issue.

root@railo [~]# tail -f /opt/railo/tomcat/logs/catalina.out

It will take time to completly UP the railo service, depending upon the number of sites added in server.xml it will vary.
Once you have done the above steps, the following url will be available for you.

http://www.my.in/railo-context/admin/web.cfm

You can create a test cfm page using the following code. Save these contents in test.cfm file and copy it in the document root of the domain and access http://www.my.in/test.cfm.

Test CFM Page

#myVar#
#Now()#

The following installation will work with php-5.3.x

root@server [~]# cd /usr/local/src
root@server [/usr/local/src]# wget http://pecl.php.net/get/mailparse-2.1.5.tgz
root@server [/usr/local/src]# tar xvzf mailparse-2.1.5.tgz
root@server [/usr/local/src]# cd mailparse-2.1.5
root@server [/usr/local/src/mailparse-2.1.5]# phpize
root@server [/usr/local/src/mailparse-2.1.5]# ./configure
root@server [/usr/local/src/mailparse-2.1.5]# make
root@server [/usr/local/src/mailparse-2.1.5]# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/

Once the installation is completed, you can find ‘mailparse.so’ file in a directory like /usr/local/lib/php/extensions/no-debug-non-zts-20090626/.

Open the php.ini file and add this extesnion. Here in my case i added an entry like the following.

root@server [~]# vi /usr/local/lib/php.ini
.
.
extension = “/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so”
.
.

Restart Apache to make the changes in effect.

root@server [~]# /etc/init.d/httpd restart

Verify wheter the extesnions is loaded or not.

root@server [~]# php -m | grep mailparse
mailparse

A very common error when adding an addon or parked domain via cpanel. Unfortunately, the error they see is usually very generic and doesn’t provide any information such as “can not create domain”. This is usually due to the domain name existing *somewhere* and checking these locations/steps out should help you find the domain that is lurking somewhere and causing the issues.

Reason 1: There is an existing zone file on the server.

1) You can use the following command to check whether zone exists or not,

# dig @server_ip domain.com

If there is a zone file exists, this will show the A record of the domain.com.

2) If there is a zone file that exists, log into the server that the zone file is pointing to and make sure the domain doesn’t exist:

# /scripts/whoowns domain.com

If it does, you would need to remove this prior to adding their new addon domain. If it does not, continue on

3) Remove the zone file from master by running the following command:

# /scripts/killdns domain.com

This will then get rid of the pesky zone file that is getting in the way of their addon creation

Reason 2: There are old traces of the domain on the server

1) Log into the server where the customer is seeing problems adding the domain and confirm that the domain does not exist on the server.

# /scripts/whoowns domain.com

2) Check Cpanel files for traces of the problem domain name

# grep domain.com /var/cpanel/users/*

# grep -R domain.com /var/cpanel/userdata/*

3) Edit any files that are found and remove the traces of the domain name the customer is trying to add. You also may need to remove the entire file for the domain in the /var/cpanel/userdata/USERNAME/ directory.

4) Rebuild the user domains database

# /scripts/updateuserdomains

5) Rebuild the Apache configuration and make sure apache is running with all traces of the bad domain removed.

# /scripts/rebuildhttpdconf ; service httpd restart

This should have all traces that were left behind from when this domain name was removed in the past and then will no longer cause a conflict when the customer tries to add the domain again.

I have a main domain, ‘redirect-from.com’ with user name ‘redirect’ in my cpanel and I have craeted a parked domain ‘redirect-to.com’ in this account. As you know both are loading the same pages here.

I need to redirect the url, http://redirect-from.com/ to http://redirect-to.com/ , for that I have select the option, ‘Redirect’ from the cPanel and I have encountered an error like the following when adding the redirect. I have this problem only when creating a redirect via cPanel when creating redirect rule from the main domain to a parked domain in the same account.

Error Adding Redirection

Redirecting “” to “http://redirect-to.com/” will cause a redirection loop because “http://redirect-from.com/”, which is located at “/home/redirect/public_html/”, is above “http://redirect-to.com/”, which is located at “/home/redirect/public_html/” .

Create a rule in .htaccess as follows to redirect the main domain to it’s parked domain.

# cat /home/redirect/public_html/.htaccess

###########################

RewriteEngine On

RewriteCond %{HTTP_HOST} ^redirect-from.com$ [NC]
RewriteRule ^(.*) http://redirect-to.com/$1 [R=301,L]

##########################

Before installing this certificate, you should make sure the wildcard subdomain (*.domain.com) has been created in the control panel as well. This is required for proper functioning and installation of the SSL certificate.

Normally customers want their SSL configuration to look something like this:

https://mydomain.com => /home/user/public_html
https://order.mydomain.com => /home/user/public_html/order
https://billing.mydomain.com => /home/user/public_html/billing

We can setup only one SSL virtual host per IP address. However, we can mimic this behavior by using mod_rewrite rules. Here are the steps:

1) Install the wildcard SSL certificate as you normally do so the DocumentRoot is/home/user/public_html/ and the ServerName is *.domain.com.

2) Setup the following mod_rewrite rules in their .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/sub.domain.folder/
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^sub.domain.com
RewriteRule ^(.*)$ /sub.domain.folder/$1 [NC,L,NS]

* NC is nocase of course, unnecessary with a .* match but is inserted for paranoia sake.
* L is ‘last’ which stops rewriterule processing on match
* NS is ‘no subrequest’ which keeps internal URI’s from being reprocessed. This may help or break things and would require testing. Look for flash applets or javascripts that don’t load.

** If you are seeing 404 not found errors after adding these rules, check the errors and the path that the connection is trying to take. If you are seeing that the connections are forcing to an addon directory and not redirecting to the subdomain directory, you may need to add a symlink in the addon directory pointing to the subdomain directory due to the redirects not being able to escape doc root.For Example:

 [error] [client xx.xx.xx.xx] File does not exist: /home/my/public_html/subdomain.com/somefile

ln -s /home/my/public_html/sub.subdomain.com/ /home/my/public_html/subdomain.com/

3) Clear all of your browser cache and try accessing the subdomains.