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: http://faq.sw-soft.com/index.php?ToDo=view&questId=172&catId=42
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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti-Spam by WP-SpamShield