1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Changing Apache's Port for using Varnish Cache

Discussion in 'Plesk 11.x for Linux' started by ottomotto, Feb 4, 2013.

  1. ottomotto

    ottomotto New Pleskian

    Feb 4, 2013
    Likes Received:

    I am quite astouned how hard it is to change a port number in Plesk for such a common scenario as using Varnish and/or Nginx in front of Apache.

    My goal is to change the port of Apache to 8081 and let Varnish accept connections on port 80.

    The official documentation tells that one have to hard-code port number by search-and-replace the variable within httpd-conf-template:


    This is ridiculous! Why would one do that if there is a variable? Where does the variable gets its data?
    I found the answer here: http://www.codero.com/knowledge-base/questions/285/How+to+install+Varnish+on+Plesk+11
    It basically tells to insert or replace a line in the table psa.misc (the line is not there after fresh installation, I assume 80 is hard-coded as the default port):

    replace into psa.misc (param, val) values ("http_port", 8081);

    After that we do:
    /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
    /etc/init.d/apache2 restart

    The produces the same result as following the official documentation and alter templates.

    I have also changed /etc/apache2/ports.conf before starting apache to:

    NameVirtualHost *:8081
    Listen 8081

    Now, when (re)starting Apache, the following warning appears twice:

    [warn] NameVirtualHost *:8081 has no VirtualHosts

    According to forum answers, the line "NameVirtualHost *:8081" appears somewhere else and causes this error. I could not find it however anywhere else. The warning disappears if the line is deleted/commented in /etc/apache2/ports.conf.

    Still I am having the following problem:

    Apache does not accept the vhost configuration! All domains on the IP address load the default Parallels landing page after changing port to 8081 (or any other number).

    What am I missing? How to solve this problem?
  2. Alexey.Plotnitsky

    Alexey.Plotnitsky Regular Pleskian

    Jan 19, 2012
    Likes Received:
    Hi ottomotto,

    Are you sure that Nginx reverse proxy is OFF ??
    Tools & Settings > Services > Reverse Proxy Server (nginx) [OFF]

    As for changing Apache ports - you should change configs and templates, as per KB that you've mentioned: