What writes to apps.vhost and breaks Apache

Discussion in 'ISPConfig 3 Priority Support' started by primesoftnz, May 3, 2021.

  1. primesoftnz

    primesoftnz Member

    When using Server Configuration, and saving configuration changes to the Web Server in a multi server cluster, ISPconfig writes to apps.vhost and in my system it breaks apache on its next reload. It appears to Write Listen 8081 near the top of the file which appears to have defined what is listening twice, and it breaks. I can comment out "Listen 8081" and restart apache2 and it works fine, I can access console as per normal.
    Is there a configuration within the console that can be changed to stop this from happening or is it some configuration I have to text edit?
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You could create a modified/fixed version of the vhost template in the conf-custom directory. If this is a bug in the distributed template and not due to to local configuration, it would be good to file a bug report in the issue tracker so this gets fixed.
     
    primesoftnz likes this.
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Which OS are you running?
     
  4. primesoftnz

    primesoftnz Member

    Debian Buster & Ispconfig 3.2.2
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Are you using any custom configs?
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You might also check if you have anything custom setup in apache to listen on port 8081. 'grep -R 8081 /etc/apache2' and 'apachectl -S' might help there.
     
    primesoftnz likes this.
  7. primesoftnz

    primesoftnz Member

    Thanks

    Yes we had already used grep to determine it was only configured in apps.vhost
    and apachectl produces

    *:8081 is a NameVirtualHost
    default server pswwwnz1.mydomain.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
    port 8081 namevhost mydomain.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
    port 8081 namevhost mydomain.com (/etc/apache2/sites-enabled/000-apps.vhost:9)
     
  8. primesoftnz

    primesoftnz Member

    Not that I know of, searched for all reference to 8081 without finding anything except what was in apps.vhost
     
  9. primesoftnz

    primesoftnz Member

    I have a temporary fix in place that I'm ok with, but it is annoying I need to comment out a line every time I save a webserver configuration. I have requested a login to git to submit an issue but don't wish to submit something that is only repeatable on my server.
    Anyone else observe this issue?
     
    Last edited: May 5, 2021
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The Listen line must be there in the apps vhost as the port needs to be defined via Listen once and as it's a custom port, it should not be defined somewhere else. It works on several hundred thousand systems with the current config file, so a request to remove it will not be accepted in GIT anyway as it would break all other servers.

    You have two options, find out where else your apache config has that duplicate listen line outside of the apps vhost file, or simply create a custom apps vhost config file template on your system in the conf-custom directory.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Just a guess, maybe you run some other software on that port already? Use:

    netstat -ntap | grep 8081

    to test that.
     
  12. primesoftnz

    primesoftnz Member

    Output as follows

    root@pswwwnz1:/usr/local/ispconfig/server# php server.php
    finished server.php.
    root@pswwwnz1:/usr/local/ispconfig/server# netstat -ntap | grep 8081
    root@pswwwnz1:/usr/local/ispconfig/server#

    As you can see I've also done as described https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/
    all six servers in cluster come back with nothing more than finished for "server.sh" and "php server.php"
    I have however
    The following changes are not yet populated to all servers:
    update server settings: 8
    Which I worry is related to this issue.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The output shows that debugging is not enabled yet. Ensure that you enabled debug log level for all nodes on the master server.
     
  14. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Did it actually list 'mydomain.com' twice or was that a mistake pasting? What does 000-apps.vhost contain, did the contents get doubled? Do you have a /usr/local/ispconfig/server/conf-custom/apache_apps.vhost.master file?
     
  15. primesoftnz

    primesoftnz Member

    I don't have a /usr/local/ispconfig/server/conf-custom/apache_apps.vhost.master
    Apart from swapping out my true domain for "mydomain.com" for security reasons, it is a per the 'apachectl -S' command output wrt 8081
    I have no idea why it reports 3 times all referring to the same line number 9
    That line is consistent with the grep output as well.
     
  16. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    From https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/
     
  17. primesoftnz

    primesoftnz Member

    root@pswwwnz1:~# /usr/local/ispconfig/server/server.sh
    06.05.2021-11:03 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    06.05.2021-11:03 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.

    This is output from master, likewise for my smtp server but all 4 others only have the Remove Lock: line
     
  18. primesoftnz

    primesoftnz Member

    upload_2021-5-6_23-48-0.png

    What ever port is put in here will break my apache until I comment the listen line. I'm sure neither 8081 nor 8088 are being Listened for by any other application.
     
  19. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What does that show on the master when you change the apps server port and run server.sh?
     
  20. primesoftnz

    primesoftnz Member

    root@pswwwnz1:~# /usr/local/ispconfig/server/server.sh
    07.05.2021-02:39 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    07.05.2021-02:39 - DEBUG - Found 2 changes, starting update process.
    07.05.2021-02:39 - DEBUG - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.05.2021-02:39 - DEBUG - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Network configuration disabled in server settings.
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Processed datalog_id 4304
    07.05.2021-02:39 - DEBUG - Calling function 'server_ip' from plugin 'apache2_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.05.2021-02:39 - DEBUG - Writing the conf file: /etc/apache2/sites-available/ispconfig.conf
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'apps_vhost_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - safe_exec cmd: which 'apache2ctl' 2> /dev/null - return code: 0
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'network_settings_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Network configuration disabled in server settings.
    07.05.2021-02:39 - DEBUG - Calling function 'update' from plugin 'server_services_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Calling function 'server_update' from plugin 'webserver_plugin' raised by event 'server_update'.
    07.05.2021-02:39 - DEBUG - Processed datalog_id 4305
    07.05.2021-02:39 - DEBUG - Calling function 'restartHttpd' from module 'web_module'.
    07.05.2021-02:39 - DEBUG - Restarting httpd: systemctl restart apache2.service
    07.05.2021-02:39 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.
     

Share This Page