Thursday, September 15, 2011

How to disable mod_security using .htaccess

This post explains how to disable mod_security using .htaccess for one domain. You may have problem with mod_security if you are using certain plugins, XMLRPC, wordpress, etc.


Go to your public_html directory of the desired domain and in .htaccess file add the following lines.


#vi .htaccess


<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>


Thats it. Now mod_security is disabled.

Wednesday, September 14, 2011

How to enable passive ftp in vsftpd

This post explains how to configure or enable passive ftp in vsftpd and open the ports in csf firewall. This is configuring in centos linux. It will also work in other linux distors.

# vi /etc/vsftpd/vsftpd.conf

##Add the following lines

pasv_enable=YES
pasv_promiscuous=NO
port_enable=YES
port_promiscuous=NO
pasv_max_port=65534
pasv_min_port=49152

Save the file.

Tuesday, September 13, 2011

route add command in linux

You can add a routing rule in a linux system as follows. It will work all linux systems including redhat, centos, ubuntu and debian

Syntax
route add -net network_id netmask subnet_mask gw gateway_ip dev device_name

root@cpaneltest [~]# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.10 dev eth0

Checking the rule
root@cpaneltest [~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.51    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.52    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.0     192.168.1.10    255.255.255.0   UG    0    0    0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

You can delete the above rule as follows
root@cpaneltest [~]# route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.10 dev eth0

Checking again
root@cpaneltest [~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.51    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.52    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
root@cpaneltest [~]#