Category Archives: Plesk

RHEL Apache (Plesk) rebuild

By default, Apache distribution shipped with RHEL is compiled with a hard limit of 300 FDs. A busy server requires a lot more..This is how I increased the FD hard limit based on SW-Soft’s FAQ:
A bit outdated, but that’ll do! 🙂

Add the following line to /etc/sysctl.conf:
fs.file-max = 131072

Run the following shell command:
# sysctl -w fs.file-max=131072

Edit __FD_SETSIZE value in /usr/include/bits/typesizes.h to:
#define __FD_SETSIZE 32768
(before, it is 1024)

Find httpd’s source rpm (try rpmfind or Google) and rebuild the package.
xmlto and pcre-devel are required, install both with up2date.
Other craps will be installed too:
pcre-devel xmlto docbook-dtds docbook-style-xsl passivetex sgml-common tetex xml-common xmltex tetex-fonts tetex-latex
Feel free to remove them once package has been rebuilt.

To rebuild the httpd rpm from the source rpm:
rpmbuild –rebuild sourcerpmfilehere.src.rpm

Once the custom binary rpm is ready, install it with -Uvh –force
Although the rebuild process produces 4 rpm files, I think only the httpd rpm is required.

Restart apache with the following commands:
/usr/local/psa/admin/sbin/websrvmng -a -v (not sure why this is needed)
service httpd restart

Valid for Plesk 7.5.

PowerDNS with Plesk servers

Having separate secondary NS for Plesk servers will be difficult to manage. To ease the process, I came up with an idea of using PowerDNS’ supermasters feature.
Just shove in the IP of the Plesk server, the name of the secondary NS and the server name to the supermasters table.
During initial touch-up of the Plesk server, make sure while modifying the DNS zone template to use THAT Plesk server as the first NS record. Otherwise it would cause problem with wrong SOA name causing PowerDNS not recognizing AXFR sent by the Plesk server.
Also make sure PowerDNS IP is included in the allowed list of AXFR on Plesk!

Some useful queries for PowerDNS’ SQL:
delete records.* from records, domains where records.domain_id = and domains.account = ‘SERVERNAME’;
delete from domains where account = ‘SERVERNAME’;

Valid for Plesk 7.5.

Passive FTP workaround for Plesk’s proftpd

Add the following line:
PassivePorts 49152 65534
to /etc/proftpd.conf
NOT /etc/proftpd.include as that file will be overwritten by Plesk regularly.

No need to restart xinetd (/etc/init.d/xinetd restart) as proftpd is executed only when a connection has been attempted on the port.

Add the following line:
/sbin/iptables -A INPUT -p tcp –dport 49152:65534 -j ACCEPT
to /usr/local/psa/var/modules/firewall/

That’s all!
Just need to make sure that the last incoming traffic rule is set to deny all.

Valid for Plesk 7.5.