Archives

Block users access to PHP directives

cPanel allows users to modify PHP directives on a per-directory basis. For more information on this feature check the link from the bottom of this article. Mainly a cPanel user will have to create a .user.ini file in the home directory (or any other directory) and he/she will be able to set new values for PHP directives. An example:

max_execution_time=100
memory_limit=128
etc.

.user.ini files

To limit this permission, as an admin, you will need to edit the main PHP configuration file on the server:

  1.  Log into WHM as root
  2. Navigate to Software >> MultiPHP INI Editor >> Editor Mode tab
  3. Choose the PHP version for which you want to disable .user.ini file permission.
  4. Search for “.user.ini” text. You will see the “php.ini Options” section of the configuration file
  5. In order to disable the .user.ini permission, you should comment out the line “user_ini.filename =” The “php.ini Options” section should look like:
    ;;;;;;;;;;;;;;;;;;;;
    ; php.ini Options ;
    ;;;;;;;;;;;;;;;;;;;;
    ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
    ;user_ini.filename = ".user.ini" 
    
    ;To disable this feature set this option to empty value
    user_ini.filename =
    
    ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
    ;user_ini.cache_ttl = 300
  6. Click the Save button
If you are using multiple PHP versions you should do the same changes to all PHP configuration files.

Now your cPanel users will not be able to use .user.ini files to modify PHP directives.

Resources:
https://php.net/manual/en/configuration.file.per-user.php
https://documentation.cpanel.net/display/CKB/How+to+Customize+PHP+Directives

Share this post:

Invalid license file: cPanel & WHM

During a cPanel update, web hosting users may get the following warning:

“Invalid license file: cPanel & WHM cannot verify your license during the upgrade process. Wait five minutes, and then try again.”
To access the interface, you must install the license and ensure that the license is active.

This server does not have a valid license. To address this issue, you must contact your hosting provider.

After you successfully activate the license, try login again in a few minutes the page and the message will no longer display.

This does not represent an issue on the server – it only means there is an outgoing update on the server. As the message suggests, wait 5-10 minutes and try to access your cPanel account again.

cpanel - invalid license file

Share this post:

The mysql_upgrade command [MySQL/MariaDB]

It is recommended to run this command every time to update your MySQL/MariaDB from one major release to another. For example when upgrading from MySQL 5.7 to MySQL 8; MariaDB 10 to MariaDB 11. It checks all the databases(with all the tables) for any incompatibilities. It also updates the system tables with new privileges or options that might have been added in the new version.

The command with options is:

mysql_upgrade [--force] [--user=# --password
--host=hostname --port=# --socket=#
--protocol=tcp|socket|pipe|memory
--verbose] OTHER_OPTIONS]

Simply run the command in shell:

root@www [/home]# mysql_upgrade

References:

https://mariadb.com/kb/en/library/mysql_upgrade/

https://dev.mysql.com/doc/refman/8.0/en/mysql-upgrade.html

Share this post:

WHM Tweak Settings

WHM Tweak Settings section is where you will find many, many options for your cPanel server.

whm tweak settings

To access and modify WHM Tweak Settings:

  1. Access WHM
  2. Go to Server Configuration >> Tweak Settings
  3. Here you will have some tabs – Compression, Security, PHP etc. Modify the option(s) you want and click the Save button.
Notice that you can search the for specific settings via the Find box.

The video tutorial for this article:

More info on https://documentation.cpanel.net/display/74Docs/Tweak+Settings

Share this post:

Statistics Software Configuration

Probably not many users use the Statistics Software (Analog/Awstats/Webalizer) that come with cPanel, but you may want to allow this option on the server. In the last years, most of the sites use Google Analytics.

On the same WHM configuration page will be able to configure the Log/Bandwidth Processing Frequency.

whm statistics software configuration

To modify the Statistics Software Configuration:

  1. Connect to WHM
  2. Go to Server Configuration >> Statistics Software Configuration
  3. To see specific/all user’s statistics summary, go to the Statistics Status Summary and click the Go button.
  4. To process the stats for one user go to the Process Statistics for User section, select the user from the drop-down list box and click the Go button.
  5. To select the stats software to allow on the server go to Generators Configuration, choose the stats software you want and click the Save button.
  6. To change the log/bandwidth processing frequency, go to Schedule Configuration, enter the interval and click the Change button.

The video tutorial for the tutorial:

Share this post:
Page 1 of 9
1 2 3 9