Category Archives: Webserver

LSOF (list open files)

Lsof merupakan utility yang hampir mirip dengan netstat -an tapi mungkin lebih lengkap kali ya, karena qta juga bisa melihat file2 yang sedang dijalakan apa saja oleh suatu program, mulai dr binary file, library dan file2 yang berhubungan dengan program yg sedang berjalan.. la wong namanya aja “List open files” ker..

Install lsof di FreeBSD:

cd /usr/ports/sysutils/lsof
make install clean
rehash

Prevent user from creating custom php.ini on suphp servers

Edit:

/usr/local/apache/conf/php.conf

Then add the following line:

suPHP_Config /usr/local/lib/php.ini

Don’t forget to change the location to your php.ini configuration, as it may be different on your server than the example above and restart Apache.

.htaccess on suPHP servers

What should my .htaccess file look like if my account is on a suPHP server?
You should remove the lines that begin with “php_value” and “php_flag”. You will need to move these files to a file named php.ini and upload php.ini into your public_html directory. Then, add the following line into the .htaccess file in your public_html:

suPHP_ConfigPath /home/username/public_html

where “username” is your cPanel username. You will need to remove php_value and php_flag from ALL .htaccess files you may have. However, you only need to add the suPHP_ConfigPath line in the .htaccess file in your public_html directory only.

Please note that you will need to change the format of your php_value and php_flag lines into the php.ini format. (Refer to the FAQ entry on how your php.ini file should be formatted).

How to mass chmod file and folder ?

Mass chmod folder :

find /home/*/public_html -type d -exec chmod 755 {} \;

Mass chmod file :

find /home/*/public_html -type f -exec chmod 644 {} \;

Tested with freebsd server and working 100% :D