Article ID: 1177, created on Oct 6, 2008, last review on May 11, 2014

  • Applies to:
  • Plesk 8.0 for Linux/Unix
  • Plesk 7.5.x Reloaded
  • Plesk 7.1.x Reloaded
  • Plesk 7.0.x
  • Plesk 6.x
  • Plesk 5.x


Apache and apache modules come with Plesk for FreeBSD versions prior v8.1.0 and are already compiled with FD_SETSIZE = 16384 and if you have problem with file descriptors lack then the reason is in some non-Plesk system application. The most probably it is related to standard system OpenSSL libraries which are dynamically loaded by Plesk's apache. To have the system OpenSSL library files be recompiled with increased FD_SETSIZE value, please do the following.

- obtain FreeBSD sources for your FreeBSD version, for example using `cvsup` utility. See "Obtaining FreeBSD" in the FreeBSD HandBook for details. We would recommend that you obtain not original sources for exactly the same FreeBSD release that you are currently running, but updated sources from STABLE branch for your FreeBSD version.

- edit /usr/src/sys/sys/select.h and /usr/include/sys/select.h files and modify there FD_SETSIZE value from 1024U to to 16384U:

#ifndef FD_SETSIZE
#define FD_SETSIZE 16384U

File /usr/include/sys/select.h is used for third-party software compilations, for example from ports collection, we will not use it at current moment, but it may be useful for you in the future. The file /usr/src/sys/sys/select.h will be used by us during our compilations from FreeBSD sources.

- run the following commands to recompile all the system files including OpenSSL libraries:
# rm -rf /usr/obj/usr
# cd /usr/src
# make clean ; make cleandepend
# make buildworld

- now actually it is a good chance to update not only OpenSSL libraries but also system binaries and libraries and also update/modify the kernel. If you wish to do this and continue with system/kernel update, please follow "The Cutting Edge" chapter in FreeBSD HandBook for the rest of details.

- if your system/kernel is up-to-date or you don't need to update anything except OpenSSL libraries for other reason, you can find what files are used by apache and replace them manually with new copies. Below is example for FreeBSD 6.0:
# ldd /usr/local/psa/apache/bin/httpd
/usr/local/psa/apache/bin/httpd: => /usr/local/psa/apache/lib/ (0x281cb000) => /usr/local/psa/apache/lib/ (0x281dd000) => /lib/ (0x281f8000) => /lib/ (0x28211000) => /usr/lib/ (0x28229000) => /lib/ (0x28257000) => /lib/ (0x2834e000) => /lib/ (0x2835e000)

So that in our FreeBSD 6.0 case these files are


make backup copies of them just in case:
# cp -p /lib/ /lib/ ; \
cp -p /lib/ /lib/ ; \
cp -p /usr/lib/ /usr/lib/

And replace them with copy newly compiled copies (they are located in /usr/obj/usr/src/ subfolders). If you use remote connection to server console, execute the below commands as a single command (as shown in the example below) as your current ssh connection may be dropped or hang:
# cd /usr/obj/usr/src/ ; \
cp ./secure/lib/libcrypto/ /lib/ ; \
cp ./secure/lib/libssl/ /usr/lib/ ; \
chflags noschg /lib/ ; \
cp ./lib/libcrypt/ /lib/ ; \
chflags schg /lib/

- then reboot the server

aa571057eefb4e790d223bad9e05ace1 a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 097728dc0a325f6309aa7a3997d4cacc d3cd9f1770da96e5b5046d20def9f8eb 47085b48068f187235a1eb6bafa960e5 b8ef5052d936e902043e41759118114e 6ef964a54451eeb60b9cce8b8001a1d4 5778c2b4a3885c30396ddfa598ae90e9 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF