Archive for the tag 'file'

Growing a File System on a Logical Volume

To grow a file system on a logical volume, perform the following steps:

1. Make a new physical volume.
2. Extend the volume group that contains the logical volume with the file system you are growing to include the new physical volume.
3. Extend the logical volume to include the new physical volume.
4. Grow the file system.

*If you have sufficient unallocated space in the volume group, you can use that space to extend the logical volume instead of performing steps 1 and 2.

SBDavid

Securing the /etc/services file

Securing the /etc/services file

Secure the /etc/services file to prevent unauthorized editing. If this file is editable, crackers can use it to enable ports on your machine you have otherwise closed. To secure this file, type the following commands as root:

# chown root.root /etc/services
# chmod 0644 /etc/services
# chattr +i /etc/services

This prevents the file from being renamed, deleted or having links made to it.

SBDavid

cpdavd error and license log file

cpdavd error and license log file.

cpdavd_error_log
— A file that contains a record of errors that were encountered by cpdavd. This file can be found at /usr/local/cpanel/logs/cpdavd_error_log.

license_log — A file that contains a record of errors that were encountered when cPanel checked its license. This can be found at /usr/local/cpanel/logs/license_log.

Restrict File Uploads in PHP configuration

Restricting all file uploads is an easy way to completely prevent attackers from exploiting your PHP configuration to inject their own PHP scripts. However, some developers will want to include the ability to upload files to your server via PHP. If you must allow file uploads, you should change the default temporary directory for file uploads using the upload_tmp_dir parameter.

Many administrators also choose to limit the maximum file size users can upload using the upload_max_filesize parameter. Setting this parameter is generally not intended to improve the security of your PHP configuration. Administrators choose to set this parameter to help manage the server’s PHP load.

SBDavid

Editing Your php.ini File

Editing Your php.ini File

Cpanel server’s php.ini file is located at /usr/local/lib/php.ini. Cpanel strongly recommend using WHM’s PHP Configuration Editor feature (Main >> Service Configuration >> PHP Configuration Editor) to edit PHP’s configuration file.

You must access the Advanced Configuration Editor to change many of the settings.

Example:

safe_mode

Safe mode attempts to solve many of the problems associated with using PHP in a shared hosting environment.
It checks the user ID (UID) of the PHP script and the files and directories it attempts to access. If the UIDs do not match, the script will not be allowed to access the requested file or directory.
note

Note: This feature is deprecated as of PHP 5.3.0.

Reference: http://cpanel.net/

Next »