Site icon Tech News and Cyber Security Updates

How to increase the number of sites that can be hosted on a Parallels Plesk Panel for Linux server

How to increase the number of sites that can be hosted on a Parallels Plesk Panel for Linux server

Hello ,

I need to use more than  300 sites on a Linux Parallels Plesk Panel and the solution was KB113974

Symptoms

There are going to be more than 300 sites on a Linux box running with Parallels Plesk Panel. Are there any prerequisites that have to be met?

Resolution

By default, the Apache server allows the hosting of no more than 300 websites on a single box. This is due to a limitation on the number of files that can be opened by the Apache process at one time, which is usually 1,024. Apache needs to open 2-4 log files for each site hosted on the server, and once it reaches the opened-file limit, it crashes.

  1. The best practice for this case is to recompile Apache with an increased number of allowed file descriptors, as per our Knowledge Base article:260 How to recompile Apache, PHP, and IMAP with increased value of file descriptors larger than FD_SETSIZE (1024) on a RedHat-like system
  2. In case you do not want to recompile the Apache package, you may enable the Piped Logs feature, which allows you to have up to 900 sites on one server. More details can be found here:2066 How do I enable Piped Logs for Apache Web Server?
  3. Alternatively, you may use the trick below in order to increase the maximum number of allowed open file descriptors:Add ulimit -n 65536 at the beginning of the Apache init script, like this:
    # head -13 /etc/init.d/apache2
    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: apache2
    # Required-Start: $local_fs $remote_fs $network $syslog $named
    # Required-Stop: $local_fs $remote_fs $network $syslog $named
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # X-Interactive: true
    # Short-Description: Start/stop apache2 web server ### END INIT INFO
    set -e
    ulimit -n 65536
    

    Then restart Apache:

    # /etc/init.d/apache2 restart
    

    Note: The file name and content may be different on your system. Another example:

    # head -16 /etc/init.d/httpd
    #!/bin/bash
    #
    # httpd Startup script for the Apache HTTP Server
    #
    # chkconfig: - 85 15
    # description: Apache is a World Wide Web server. It is used to serve 
    # HTML files and CGI.
    # processname: httpd
    # config: /etc/httpd/conf/httpd.conf
    # config: /etc/sysconfig/httpd
    # pidfile: /var/run/httpd.pid
    # Source function library.
    . /etc/rc.d/init.d/functions
    ulimit -n 65536
    

    Restart Apache:

    # /etc/init.d/httpd restart
    

Additional information

As of the release of Parallels Plesk Panel 11.0 Nginx can be installed as a reverse proxy server in front of Apache. It will help you run more sites on one server.

Such a combination of Nginx and Apache provides the following advantages:

See the Parallels Plesk Panel 11 Administrator’s guide for more details.

 

Link : http://kb.sp.parallels.com/en/113974

Goodluck ,

Exit mobile version