Domain Masking

Domain Masking (a.k.a. Blind Forwarding) is using a domain name to display a different domain, but still shows the original domain’s name in the address bar.

Generally, this is considered a bad idea and not good for SEO, but it is possible.
Plesk
(Applies to 10 – 11.0)

In order to forward a domain blindly, you will create it in Plesk as you would any other domain, only select the Hosting Type as Forwarding, then select “Frame Forwarding” to spoof the domain name to your your domain name.

Domains > domainname.com > Websites & Domains
Scroll to the bottom of the page and click the domain name
Locate the Hosting type and click ‘Change’
Now select Forwarding and Frame Forwarding.

Grep IP addresses from Plesk Server

Want to see the number and list of IP addresses in the access log for a Plesk Domain?


cd /var/www/vhosts/domainname.com/statistics/logs
sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/' -e t -e d access_log | sort | uniq -c

You should see a list like this…


30 100.3.125.44
4 101.226.65.105
6 103.6.190.208
11 105.227.211.73
168 107.213.9.254

For all Plesk access logs

# cd /var/log/httpd
# sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/' -e t -e d access_log | sort | uniq -c

Plesk Firewall

psa-firewall

To start the service through the command line:

/etc/init.d/psa-firewall start

To stop the service through the command line:

/etc/init.d/psa-firewall stop

To restart the service through the command line:

/etc/init.d/psa-firewall restart

Configuration files are accessible at:

  • /usr/local/psa/var/modules/firewall/firewall-active.sh
  • /usr/local/psa/var/modules/firewall/firewall-emergency.sh
  • /usr/local/psa/var/modules/firewall/firewall-new.sh

psa-firewall (IP forwarding)

To start the service through the command line:

/etc/init.d/psa-firewall-forward start

To stop the service through the command line:

/etc/init.d/psa-firewall-forward stop

To restart the service through the command line:

/etc/init.d/psa-firewall-forward restart

Configuration files are accessible at:

  • /usr/local/psa/var/modules/firewall/ip_forward.active
  • /usr/local/psa/var/modules/firewall/ip_forward.saved

Add Private Name Servers to Plesk Domain

To Create and Register Your Domain Hosts in Parallels Plesk Panel

Log in to Parallels Plesk Panel as an administrator.
Go to the Websites & Domains tab, and then click DNS Settings.
For the row with the Record Type of NS, click your domain name, change the following, and then click OK:
Record type — NS.
Domain Name — Leave this field.
Name server — Type ns1.coolexample.com, where coolexample.com is your domain name.
For the row with the Host of ns.coolexample.com, where coolexample.com is your domain, click it, change the following, and then click OK:
Record type — A.
Domain Name — Type ns1.
IP Address — Enter your server’s IP address.
Click Add Record, complete the following fields, and then click OK:
Record type — Select NS.
Domain Name — Leave this field blank.
Name server — Enter ns2.coolexample.com, where coolexample.com is your domain name.
Click Add Record, complete the following fields, and then click OK:
Record type — Select A.
Domain Name — Type ns2.
IP Address — Enter your server’s IP address
Click Update.
Go to the Server tab in Plesk, and then, from the Server Management section, click Services Management.
Next to DNS Server (BIND), click Refresh. Allow a few minutes for the service to restart.

Qmail Wrapper

Use this method to track down any PHP scripts that might be sending email.
http://kb.parallels.com/en/1711

1) Create a /var/qmail/bin/sendmail-wrapper script with the following content:

#!/bin/sh
(echo X-Additional-Header: $PWD ;cat) | tee -a /var/tmp/mail.send|/var/qmail/bin/sendmail-qmail "$@"

Note, it should be two lines including ‘#!/bin/sh’.

2) Create a log file /var/tmp/mail.send and grant it “a+rw” rights; make the wrapper executable; rename old sendmail; and link it to the new wrapper:

touch /var/tmp/mail.send
chmod a+rw /var/tmp/mail.send
chmod a+x /var/qmail/bin/sendmail-wrapper
mv /var/qmail/bin/sendmail /var/qmail/bin/sendmail-qmail
ln -s /var/qmail/bin/sendmail-wrapper /var/qmail/bin/sendmail

3) Wait for an hour and change back sendmail:

rm -f /var/qmail/bin/sendmail
mv /var/qmail/bin/sendmail-qmail /var/qmail/bin/sendmail

Examine the /var/tmp/mail.send file. There should be lines starting with “X-Additional-Header:” pointing to domain folders where the scripts which sent the mail are located.
You can see all the folders from where mail PHP scripts were run with the following command:

grep X-Additional /var/tmp/mail.send | grep `cat /etc/psa/psa.conf | grep HTTPD_VHOSTS_D | sed -e 's/HTTPD_VHOSTS_D//' `

If you see no output from the above command, it means that no mail was sent using the PHP mail() function from the Plesk virtual hosts directory.