ABHIONLINUX
Site useful for linux administration and web hosting

2017/09/20

Custom php.ini in EA4 cPanel servers

Here, I will discuss on how to enable custom php.ini on your cpanel servers running EA4.

Normally what we do is to find the php.ini file and copy it to your home directory and change the values in php.ini which was copied in home directory and it should work. In the case of EA4, this wont be working. We have to follow the steps given below.

Find whether local.ini file is present in the configuration directory.

/opt/cpanel/ea-php/root/etc/php.d/


[root@server public_html]# ls -ld /opt/cpanel/ea-php*/root/etc/php.d/local.ini
-rw-r--r-- 1 root root 30 Sep 20 02:16 /opt/cpanel/ea-php55/root/etc/php.d/local.ini

-rw-r--r-- 1 root root 30 Sep 20 02:16 /opt/cpanel/ea-php56/root/etc/php.d/local.ini

Copy server php.ini to your home directory  and modify the parameters that are needed.

[root@server public_html]# cp /opt/cpanel/ea-php56/root/etc/php.ini /home/abs/public_html
[root@server public_html]# chown abs.abs /home/abs/public_html/php.ini

There are certain situations where local.ini file doesn't exists on php configuration folder. In that case, we would need to follow the steps given below to generate local.ini


[root@server public_html]# echo 'user_ini.filename = "php.ini"' > /opt/cpanel/ea-php56/root/etc/php.d/local.ini
[root@server public_html]# /scripts/restartsrv_httpd 

Now custom php.ini should be working fine on your cPanel EA4 servers.

Notes :
* Ensure that you dont use suphp_configpath in .htaccess
* Loaded configuration file in phpinfo page wont be changed to custom one but the changed in cutom php.ini should be reflected in phpinfo page.

2017/07/27

Wordpress Multisite Network Admin RedirectLoop

There are certain cases where we got the issues like this on wordpress multisite with subdomains. Here I have configured wordpress multisites on my domain and sites were working fine. But when I tried to access wordpress multisite network admin eg: domain.com/wp-admin/network , I'm getting the error "Redirect Loop"

In the case of multisite, your current site and blog domain should be equivalent and your current site path and blog path should also be equivalent. Here , blog domain was different from sitedomain.
I have set the blog domain as domain.com and site domain as www.domain.com which was causing the redirect loop.

After correcting the blog domain, everything was working fine as expected.

Login to mysql

# mysql
mysql> use user_wp
Database changed
mysql> select * from user_blogs;
*************************** 1. row ***************************
     blog_id: 1
     site_id: 1
     domain: domain.com
     path: /
     registered: 2017-07-13 09:05:19
     last_updated: 2017-07-27 09:39:07
     public: 1
     archived: 0
     mature: 0
     spam: 0
     deleted: 0
     lang_id: 0

mysql> update user_blogs SET domain = 'www.domain.com' where blog_id = "1";

Hope this will help you to resolve this issue.

2017/07/14

Enginetron : 502 Bad Gateway

Enginetron is a cpanel plugin which acts as a reverse proxy with apache to improve the server performance. There are certain cases where we get the following errors on the domain after installating enginetron.

502 Bad Gateway

In that case, you can use the following fix.
Open the file  /etc/nginx/custom_rules and add this at the bottom.

[root@server~]# vi /etc/nginx/custom_rules
if ($host ~ "domainname.com") {
set $PROXY_DOMAIN_OR_IP "xx.xx.xx.xx"; }

Domainname.com should be replaced by your domain and xx.xx.xx.xx should be replaced by your IP address.

2017/05/30

OpenVZ/Ploop Error: required UB parameter


You might have noticed this error while creating a openvz VPS. These issues are mainly due to  the implementation of ploop in openvz kernel.

017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter kmemsize not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter lockedpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter privvmpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter shmpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numproc not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter physpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter vmguarpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter oomguarpages not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numtcpsock not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numflock not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numpty not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numsiginfo not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter tcpsndbuf not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter tcprcvbuf not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter othersockbuf not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter dgramrcvbuf not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numothersock not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numfile not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter dcachesize not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: required UB parameter numiptent not set
2017-05-30T09:45:24+0100 vzctl : CT 154 : Error: failed to apply some parameters, not saving configuration file!


 You would need to install ploop and enable it on your hardware node and solusvm node configurations.
1. yum install ploop
2, /scripts/upcp  on solusvm master
3. Solusvm node configuration