Most useful Linux command

ifconfig ifconfig -a ifconfig eth0 down ifconfig eth0 up ifconfig eth0 192.168.1.12 ifconfig eth0 netmask 255.255.255. ifconfig eth0 broadcast 192.168.1.255 ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255 netstat -a netstat -at netstat -s netstat -an nslook dig (ex.www.google.com) uptime w

how to install Webmin on CentOS

Under SSH Run wget http://prdownloads.sourceforge.net/webadmin/webmin-1.630-1.noarch.rpm and then run the command : rpm -U webmin-1.630-1.noarch.rpm The rest of the install will be done automatically to the directory /usr/libexec/webmin, the administration username set to root and the password to your current root password. You should now be able to login to Webmin at the URL http://localhost:10000/. Or […]

How to install Suhosin on CentOS

yum install php-devel wget http://download.suhosin.org/suhosin-0.9.33.tgz tar -zxvf suhosin-0.9.33.tgz cd suhosin-0.9.33 phpize ./configure make make install Installing shared extensions: /usr/lib64/php/modules/ you have to copy suhosin.so to the correct location. cp /usr/lib64/php/modules/suhosin.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so add extension=suhosin.so to php.ini (/usr/local/php/etc/php.ini) restart php-fpm service php-fpm restart to further optimize suhosin, copy following code to php.ini ; Logging Configuration suhosin.log.syslog.facility = […]

How to uninstall LNMP

killall nginx * /etc/init.d/mysql stop * killall mysqld * /usr/local/php/sbin/php-fpm stop * killall php-cgi * rm -rf /usr/local/php * rm -rf /usr/local/nginx * rm -rf /usr/local/mysql * rm -rf /usr/local/zend * rm /etc/my.cnf * rm /etc/init.d/mysql * rm /root/vhost.sh * rm /root/lnmp *

Install Mongodb on CentOS

nano /etc/yum.repos.d/10gen.repo Copy below 64bit or 32bit code to /etc/yum.repos.d/10gen.repo and save. Create a /etc/yum.repos.d/10gen.repo file to hold information about your repository. If you are running a 64-bit system (recommended,) place the following configuration in /etc/yum.repos.d/10gen.repo file: [10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1 If you are running a 32-bit system, which isn’t recommended for production […]

Init.d Script PHP-FPM

nano /etc/init.d/php-fpm add following to the php-fpm #! /bin/sh ### BEGIN INIT INFO # Provides: php-fpm # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts php-fpm # Description: starts the PHP FastCGI Process Manager daemon ### END INIT INFO prefix=/usr/local/php exec_prefix=${prefix} php_fpm_BIN=${exec_prefix}/sbin/php-fpm […]

Init.d Script Nginx

By editing /etc/init.d/nginx, you could simply run command service nginx {start|stop|reload|restart} to control nginx. nano /etc/init.d/nginx add following to nginx #! /bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server # Description: […]