Articles in the ‘Server Administration’ Category

Internal Server Error Mailman cPanel

Wednesday, May 18th, 2011

If you have

Internal Server Error

while accessing :

http://SITE-URL/mailman/admin/LIST-NAME

you have to fix some permission problems in the mailman.

chmod 02755 -R /usr/local/cpanel/3rdparty/mailman
/usr/local/cpanel/3rdpart/mailman/bin/check_perms -f
chmod 02775 -R /usr/local/cpanel/3rdparty/mailman/logs

That’s it!

Using eAccelerator with cPanel and FASTCGI

Tuesday, March 8th, 2011

If you want to use eAccelerator with cPanel and Apache, disable suPHP through easyApache or you will have “Cached Scripts 0″ in control panel of eAccelerator.

Same rule applies with APC.

APC fails to install via WHM in cPanel

Monday, March 7th, 2011

If you try to install APC via WHM in cpanel and you get:

cpanel /usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory

then you need to install PCRE-devel.

Follow the next step

Go to / and type

yum install pcre-devel

Now, go back to WHM and try to install again PCRE.

Install ImageMagick and Imagick on Cpanel Server

Thursday, December 23rd, 2010

Installation

ImageMagick
Check first if it’s installed:

/scripts/checkimagemagick

Proceed with Installation:
/scripts/installimagemagick
Installation will take a couple minutes as it will install other packages needed by ImageMagick. After the installation, you can check your ImageMagick version:
/usr/bin/convert --version
It will give you something like:

Version: ImageMagick 6.4.8 2009-05-11 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Imagick
Go to WHM -> Software -> Module Installers -> PHP Pecl (manage). On the box below “Install a PHP Pecl” enter “imagick” and click “Install Now” button – that’s all.

Uninstall
If you decide to uninstall it’s as easy as the installation process:

ImageMagick
/scripts/cleanimagemagick

Imagick
WHM -> Software -> Module Installers -> PHP Pecl (manage). Click on Uninstall button for Imagick.

How to install PECL uploadprogress for Drupal?

Friday, December 17th, 2010

Installing from cPanel will mostly sure fail. If you want a quick fix, here is how to do it.

Download the latest uploadprogress package from here
wget http://pecl.php.net/get/uploadprogress-1.0.1.tgz
tar xvfz uploadprogress-1.0.1.tgz
cd uploadprogress-1.0.1
phpize
./configure
make
make install

Edit /usr/local/lib/php.ini
nano /usr/local/lib/php.ini
and copy paste at the end of the file:
extension=uploadprogress.so
and at last, restart Apache:
service httpd restart

Faster PHP with NGINX and cPanel

Thursday, October 28th, 2010

If you followed our howto’s on NGINX and cPanel here is another improvement you can do in /usr/local/nginx/conf/vhost.conf


# serve the app via fastcgi
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/tmp/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_read_timeout 240;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}

Problems NGINX imagecache and Drupal

Thursday, October 28th, 2010

If you have problems displaying images generated via imagecache on Drupal you nee to add in /usr/local/nginx/conf/vhost.conf

location ^~ /sites/default/files/imagecache/ {
index index.php index.html;

# assume a clean URL is requested, and rewrite to index.php
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
break;
}
}

Errors in installing PECL extensions through cPanel WHM

Friday, October 22nd, 2010

If you get:

checking for C compiler default output file name... conftest.in
checking whether the C compiler works... configure: error: cannot run C compiled programs.

This happens when /tmp mounted with the ‘noexec’ option


mount -o,remount,rw,exec /var/tmp

And when you’re done, set it back:

mount -o,remount,rw,noexec /var/tmp

NGINX with Domain Access Drupal

Thursday, October 7th, 2010

If you have followed our previous tutorial on NGINX with Apache and cPanel you can use this setup also for Domain Access with Drupal.

To enable NGINX for *.domain.tld setup in Domain Access folow the next step:


nano /usr/local/nginx/conf/vhost.conf

and add after the rest of proxy_redirect.

proxy_redirect http://*.domain.tld:81 http://*.domain.tld;

NGINX with Apache and cPanel

Thursday, October 7th, 2010

In this setup, NGinx will be integrated with Apache (under cPanel) and used to server the static files.

Run SSH console

cd /root
wget http://nginx.org/download/nginx-0.8.52.tar.gz
wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz
tar xvzf mod_rpaf-0.6.tar.gz
cd mod_rpaf-0.6
/usr/local/apache/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
cd /root
tar xvzf pcre-7.9.tar.gz
cd pcre-7.9
./configure
make
make install
cd /root
tar xvzf nginx-0.8.52.tar.gz
cd nginx-0.8.52
./configure --with-http_ssl_module --with-http_realip_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module
make
make install

-Login to WHM and look for the following route:
Main >> Service Configuration >> Apache Setup > Include Editor > Pre Main Include

- Add the following configuration and save, LIST_OF_YOUR_IPS changing the IP you occupy in your site:

LoadModule rpaf_module modules/mod_rpaf-2.0.so
RPAFenable On
# Enable reverse proxy add forward
RPAFproxy_ips 127.0.0.1 LIST_OF_YOUR_IPS
# which ips are forwarding requests to us
RPAFsethostname On
# let rpaf update vhost settings
# allows to have the same hostnames as in the "real"
# configuration for the forwarding Apache
RPAFheader X-Real-IP
# Allows you to change which header mod_rpaf looks
# for when trying to find the ip the that is forwarding
# our requests

- Change the apache port to 81 (tweak settings)
Open whm – tweak settings and find 0.0.0.0:80 and change it to 0.0.0.0.:81

- Run SSH console

/usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
/scripts/rebuildhttpdconf
httpd restart

create automated nginx virtual host creator

touch nginx.sh
chmod 755 nginx.sh
nano nginx.sh

and add the content from here.

then run it

./nginx.sh

-Check the configuration

/usr/local/nginx/sbin/nginx -t

Until now only the managing nginx connections, but is not serving static content. For the latter you must edit the following file:

nano /usr/local/nginx/conf/vhost.conf

-Remove the 3 # signs of the following lines:

#location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
# root /home/myweb/public_html;
#}

so the final configuration will looks like

location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|js|css)$ {
root /home/myweb/public_html;
}

Configure nginx startup scripts

touch /etc/init.d/nginx
chmod +x /etc/init.d/nginx
nano /etc/init.d/nginx

and add the following content from here.

Now, let’s test the scripts:

/etc/init.d/nginx restart
ps aux | grep nginx

and last, add nginx as autostart deamon

/sbin/chkconfig nginx on
/sbin/chkconfig --list | grep nginx