Category: Linux general issues

Search for a string into a php file

This is how you can check for a string in a php file

or a txt file


Last modified.: 23/07/2015 Linux general issues

Find and remove words from files on linux

The following is very usefull in order to clean files from inwanted code inserted by hackers.   List all “htm” files contain the word “test” in folder “home”:

Remove the text between “teststart” and “testend” of all “htm” files in folder “home”:

Last modified.: 23/07/2015 Linux general issues

How to mod_ruid2

This is based on my CentOS server with Apache 2.x. Installing this module its no longer needed to chmod config files to 666 or upload/attachments directories to 777. Since with this module enabled everything at HTTP will run under the user itself and not ‘apache’ anymore. ** If you are using mod_ruid instead of mod_ruid2, […]

Setup MySQL for heavy loads – Centos linux – MySQL

login into MySQL:

Execute commands:

and check:

then go to : phpmyadmin -> Privileges -> Select user And change the fields: MAX QUERIES PER HOUR = 30000 MAX UPDATES PER HOUR = 20000 MAX CONNECTIONS PER HOUR = 5000 MAX USER_CONNECTIONS = 25 Finally restart mysql:

Last modified.: 23/07/2015 Linux general issues

How to mount /tmp as a separate filesystem with the noexec,nosuid options set

Step 1: Securing /tmp Step 1.1: Backup your fstab file

Step 1.2: Creating tmpmnt partition file (Around 1Gb in size)

Step 1.3: Format the new partition

Press Y when asked Step 1.4: Making backup of old /tmp

Step 1.5: Mount the tmp filesystem

Step 1.6: Set the right permissions


Last modified.: 23/07/2015 Linux general issues

Bulk modification of permissions – Centos linux

To massively change the rights to 644 for example all php files in all subfolders:

or for example all pictures ending jpg 755

Last modified.: 23/07/2015 Linux general issues

pdf2txt installation – Centos linux

To install pdf to text type:

  then edit php.ini file: /usr/local/lib/php.ini

  and finally restart apache

Last modified.: 02/07/2018 Linux general issues

Enable Proxy – Centos linux

Go to /etc/httpd/conf and open httpd.conf then add

save and exit type on ssh

open internet explorer tools->internet options->connections->lan settings check “use a proxy server for your lan” and type your server ip in the address field.   Also check the file /etc/hosts

Last modified.: 02/02/2017 Linux general issues

Install Perl GD on Centos

Then run cpan and type:

Last modified.: 18/07/2015 Linux general issues

Run a file system check

If you are seeing error messages in the syslog or you suspect there are problems with the file system you can check it. To start a filesystem check and correct all errors automatically run the following command:

This should be done when the partitions are not mounted, otherwise it can lead to data loss.

Last modified.: 23/07/2015 Linux general issues
1 2 3 4