Archive for November 20th, 2008

In some php 5 versions the flle upload is bugging by default.
Open php.ini and add the following line ( or uncomment if present but not enabled )
upload_tmp_dir = /tmp


To add php modules to your configuration you can easily
use your apt manager:

~# apt-get install php5-gd
~# apt-get install php5-curl


It is strongly recommended to enable open_basedir protection
on shared hosting systems to prevent a complete server hack over php.
Log into WHM and look under security > security center.
The feature jails any user’s php ability inside the public_html directory


To update Cpanel/WHM to the latest version run:
~# /scripts/upcp
Depending on your configuration the latest
Edge, Release, Current or Stable version will be installed


To install PostgreSQL on a Cpanel server run:
~# /scripts/installpostgres
and follow the isntructions. You need assign a password
from the SQL section in WHM.
Recompile Apache with pgsql support.


Monitoring your system basics
To check the disk usage on your system
~# df -h

To check the memory allocation and usage
~# free -m

To visualize your CPU information
~# cat /proc/cpuinfo

To check your network configuration
~# ifconfig

To visualize the running processes, CPU Load and Memory
~# ps aux

To see lifetime running processes
~# top
( type q to leave the program )


Setting File and Folder Ownership
Every file or folder belongs to an owner and a group
To change ownership use the syntax:
~# chown username:usergroup filename
~# chown username:usergroup foldername
To change ownership recursively, meanwhile all files inside a folder:
~# chown -R username:usergroup foldername
To check and visualize your changes type:
~# ls -hal


Setting File and Folder Permissions
Permission are represented by a 3 digit numerical code
First Digit: Owner
Second Digit: Group
Third Digit: Everybody

Permission 0 = no access
Permission 4 = read
Permission 6 = read / write
Permission 5 = read / execute
Permission 7 = read / write / execute

To set permissions use syntax
~# chmod 644 filename
Setting filename to read/write (owner) and read (group and world)
To set permissions recursively for all files inside a folder use
~# chmod -r 755 foldername
Setting foldername and all files inside to raed/write/execute (owner) and read/execute ( group and world )

You can restrict your settings and give permissions only for specified files
~# chmod 644 *.php
Setting all php files inside this folder to read/write – read – read