Monthly Archives: March 2015

WordPress Permalink code for Windows server

In IIS 7 , you can add below code in the Option “URL Rewrite” when you click on the domain, as the .htaccess will not work as it works for Linux servers:

 

===============

<rewrite>
    <rules>
        <rule name="Main Rule" stopProcessing="true">
 <match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
        </rule>
    </rules>
</rewrite>

===============

Tweaks to prevent Spamming on cPanel server

24x7serversupport-cpanel

Setting in – Exim Configuration Manager
1. Login to WHM control panel by using root user
2. Goto Main >> Service Configuration >> Exim Configuration Manager
3. Enable RBL filtering by Basic Editor >> RBLs >> switch to – On and if you like you may additional RBL from manage option.
4. Sender Verification Callouts = ON
5. Sender Verification = ON
5. Reject SPF failures =ON
6. Then save all the configuration this will stop most of spams in the server.
Some setting in Tweak Setting
1. Login to WHM control panel by using root user
2. Goto Main >> Server Configuration >> Tweak Settings
3. Initial default/catch-all forwarder destination = Fail
4. Max hourly emails per domain = 200
5. Count mailman deliveries towards a domain

How to change outgoing mail server IP address in Linux PLESK

24x7serversupport-parallels
24x7serversupport-parallels

You can easily change the mail server ip address in cpanel by using /etc/mailips file. The same as in PLESK you can also change the outgoing mail server ip address by using “/var/qmail/control/smtproutes” file.
first check the domain name which is hosted on the server by using following file

1) cat /var/qmail/control/rcpthosts
domain1.com
domain2.com
domain3.com
domain4.com
domain5.com

2) By default the “/var/qmail/control/smtproutes” file is not present on PLESK server, you need to create it.

vi /var/qmail/control/smtproutes

3) Then add the new ip address in the following format.

domain1.com:111.222.333.444
domain2.com:111.222.333.444

4) Save the file and restart qmail

/etc/init.d/qmail restart

Replace the domain.com with your own domain name and the IP 111.222.333.444

How to Secure /tmp

This will cover securing /tmp /var/tmp and /dev/shm Secure /tmp:

Step 1: Backup your /etc/fstab file

Code:
cp /etc/fstab /etc/fstab.bak

Step 2: Make a 3GB file for /tmp parition and an ext3 filesystem for tmp:

Code:
dd if=/dev/zero of=/var/tempFS bs=1024 count=3072000 /sbin/mkfs.ext3 /var/tempFS *Change the count= to something higher if you need more space*

Step 3: Create a backup copy of your current /tmp drive:

Code:
cp -Rpf /tmp /tmpbackup

Step 4: Mount our new tmp parition and change permissions:

Code:
mount -o loop,noexec,nosuid,rw /var/tempFS /tmp chmod 1777 /tmp

Step 5: Copy the old data:

Code:
cp -Rpf /tmpbackup/* /tmp/ * If your /tmp was empty earlier, you might get this error : cp: cannot stat `/tmp.bak/*’: No such file or directory

Step 6: Edit /etc/fstab and add this:

Code:
nano -w /etc/fstab And ADD this line:

Code:
/var/tempFS /tmp ext3 loop,nosuid,noexec,rw 0 0

Step 7: Test your fstab entry:

Code:
mount -o remount /tmp

Step 8: Verify that your /tmp mount is working:

Code:
df -h Should look something like this:

Code:
/var/tempFS 962M 18M 896M 2% /tmp
Secure /var/tmp:

Step 1: Use /tmp as /var/tmp.
Code:
mv /var/tmp /var/vartmp ln -s /tmp /var/tmp

Step 2: Copy the old data back

Code:
cp /var/vartmp/* /tmp/ * If your /var/tmp was empty earlier, you might get this error : cp: cannot stat `/var/vartmp/*’: No such file or directory
Secure /dev/shm:

Step 1: Edit your /etc/fstab:

Code:
nano -w /etc/fstab Locate:

Code:
none /dev/shm tmpfs defaults,rw 0 0 Change it to:

Code:
none /dev/shm tmpfs defaults,nosuid,noexec,rw 0 0

Step 2: Remount /dev/shm:

Code:
mount -o remount /dev/shm
You should restart services that uses /tmp partition