AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-e

Discussion in 'Installation/Configuration' started by iniVan, Jun 27, 2023.

  1. iniVan

    iniVan Member

    root@webserver1:~# systemctl restart apache2
    Job for apache2.service failed because the control process exited with error code.
    See "systemctl status apache2.service" and "journalctl -xe" for details.

    root@webserver1:/etc/apache2/sites-enabled# ls
    000-apps.vhost 000-ispconfig.conf 100-cleanerdays.ca.vhost 900-ininetworks.ca.vhost 999-acme.conf
    000-default.conf 000-ispconfig.vhost 100-www.inicloud.ininetworks.ca.vhost 900-ininetworks.com.vhost
    root@webserver1:/etc/apache2/sites-enabled# systemctl status apache2.service
    ● apache2.service - The Apache HTTP Server
    Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Mon 2023-06-26 17:10:29 EDT; 13min ago
    Docs: https://httpd.apache.org/docs/2.4/
    Process: 3957 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

    Jun 26 17:10:28 webserver1 systemd[1]: Starting The Apache HTTP Server...
    Jun 26 17:10:28 webserver1 apachectl[3957]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost:7
    Jun 26 17:10:28 webserver1 apachectl[3957]: Action 'start' failed.
    Jun 26 17:10:28 webserver1 apachectl[3957]: The Apache error log may have more information.
    Jun 26 17:10:28 webserver1 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Jun 26 17:10:29 webserver1 systemd[1]: apache2.service: Failed with result 'exit-code'.
    Jun 26 17:10:29 webserver1 systemd[1]: Failed to start The Apache HTTP Server.
    root@webserver1:/etc/apache2/sites-enabled# nano /etc/httpd/conf.d
    root@webserver1:/etc/apache2/sites-enabled# cd
    root@webserver1:~# nano /usr/local/ispconfig/server/conf
    root@webserver1:~# nano /usr/local/ispconfig/server/lib/config.inc.php
    root@webserver1:~# nano /usr/local/ispconfig/interface/lib/config.inc.php
    root@webserver1:~# apachectl -S
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost:7
    VirtualHost configuration:
    *:8081 webserver1.ininetworks.ca (/etc/apache2/sites-enabled/000-apps.vhost:9)
    *:8080 webserver1.ininetworks.ca (/etc/apache2/sites-enabled/000-ispconfig.vhost:9)
    *:80 is a NameVirtualHost
    default server webserver1.ininetworks.ca (/etc/apache2/sites-enabled/000-default.conf:1)
    port 80 namevhost webserver1.ininetworks.ca (/etc/apache2/sites-enabled/000-default.conf:1)
    port 80 namevhost cleanerdays.ca (/etc/apache2/sites-enabled/100-cleanerdays.ca.vhost:7)
    alias www.cleanerdays.ca
    port 80 namevhost www.inicloud.ininetworks.ca (/etc/apache2/sites-enabled/100-www.inicloud.ininetworks.ca.vhost:7)
    port 80 namevhost ininetworks.ca (/etc/apache2/sites-enabled/900-ininetworks.ca.vhost:7)
    alias www.ininetworks.ca
    alias cloud.ininetworks.ca
    port 80 namevhost ininetworks.com (/etc/apache2/sites-enabled/900-ininetworks.com.vhost:7)
    wild alias *.ininetworks.com
    *:443 is a NameVirtualHost
    default server cleanerdays.ca (/etc/apache2/sites-enabled/100-cleanerdays.ca.vhost:195)
    port 443 namevhost cleanerdays.ca (/etc/apache2/sites-enabled/100-cleanerdays.ca.vhost:195)
    alias www.cleanerdays.ca
    port 443 namevhost ininetworks.ca (/etc/apache2/sites-enabled/900-ininetworks.ca.vhost:206)
    alias www.ininetworks.ca
    alias cloud.ininetworks.ca
    port 443 namevhost ininetworks.com (/etc/apache2/sites-enabled/900-ininetworks.com.vhost:195)
    wild alias *.ininetworks.com
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex authdigest-opaque: using_defaults
    Mutex watchdog-callback: using_defaults
    Mutex rewrite-map: using_defaults
    Mutex ssl-stapling-refresh: using_defaults
    Mutex authdigest-client: using_defaults
    Mutex fcgid-proctbl: using_defaults
    Mutex ssl-stapling: using_defaults
    Mutex proxy: using_defaults
    Mutex ssl-cache: using_defaults
    Mutex default: dir="/var/run/apache2/" mechanism=default
    Mutex mpm-accept: using_defaults
    Mutex fcgid-pipe: using_defaults
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    Define: MODPERL2
    Define: ENABLE_USR_LIB_CGI_BIN
    User: name="www-data" id=33
    Group: name="www-data" id=33
    root@webserver1:~# journalctl -xn
    -- Logs begin at Mon 2023-06-26 16:52:33 EDT, end at Mon 2023-06-26 18:24:04 EDT. --
    Jun 26 18:23:23 webserver1 postfix/smtpd[8822]: disconnect from unknown[91.224.92.110] ehlo=1 auth=0/1 quit=1 commands=2/3
    Jun 26 18:23:51 webserver1 postfix/smtpd[8611]: connect from unknown[46.148.40.155]
    Jun 26 18:23:58 webserver1 postfix/smtpd[8611]: warning: unknown[46.148.40.155]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
    Jun 26 18:24:01 webserver1 CRON[8873]: pam_unix(cron:session): session opened for user root by (uid=0)
    Jun 26 18:24:01 webserver1 CRON[8874]: pam_unix(cron:session): session opened for user root by (uid=0)
    Jun 26 18:24:01 webserver1 CRON[8875]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Jun 26 18:24:01 webserver1 CRON[8876]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Jun 26 18:24:01 webserver1 CRON[8873]: pam_unix(cron:session): session closed for user root
    Jun 26 18:24:01 webserver1 CRON[8874]: pam_unix(cron:session): session closed for user root
    Jun 26 18:24:04 webserver1 postfix/smtpd[8822]: connect from unknown[80.94.95.242]
    root@webserver1:~# cd backup
    -bash: cd: backup: No such file or directory
    root@webserver1:~# /backup
    -bash: /backup: No such file or directory
    root@webserver1:~# apache2ctl configtest
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost:7
    Syntax OK
    root@webserver1:~# AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost:7
    -bash: AH00548:: command not found
    root@webserver1:~# nano /etc/apache2/sites-enabled/
    root@webserver1:~# /etc/apache2/sites-enabled/
    -bash: /etc/apache2/sites-enabled/: Is a directory
    root@webserver1:~# cd /etc/apache2/sites-enabled/
    root@webserver1:/etc/apache2/sites-enabled# ls
    000-apps.vhost 000-ispconfig.conf 100-cleanerdays.ca.vhost 900-ininetworks.ca.vhost 999-acme.conf
    000-default.conf 000-ispconfig.vhost 100-www.inicloud.ininetworks.ca.vhost 900-ininetworks.com.vhost
    root@webserver1:/etc/apache2/sites-enabled#


    was trying to setup subdomain and this happened HELP ANYONE
     
  2. iniVan

    iniVan Member

    SHOULD i remove 000-ispconfig.vhost
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    That's fine and not an error, this is just a information for administrators that this directive might get removed in a future version of the apache server, so nothing that affects the apache version that you have currently installed in any way. It's not related to your problem that Apache does not start.

    No

    What have you done before the issue started? Most likely reason is that a SSL cert is missing.
     
  4. thisiszeev

    thisiszeev Member HowtoForge Supporter

    I am having the same issue, it was all running fine until a requested a LE Cert with the admin panel.

    It even reloaded the page, but a few minutes later all went to hell.

    I got an error relating to DefaultRuntimeDir, but I checked the envvars file and it matchs that on a working ISPC server. But now the error went away. The only error I get from journalctl -xe | apache2 now is AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.vhost which as you stated is only a warning, not an error. As I can see and understand.

    I have checked as well, I have all the certs in place.

    But one thing I did notice, is two vhosts files for my server domain (which I have setup as a site on the admin panel, with all the mail.domain.tld addresses as aliases.) I have one called server.domain.tld.vhost and one call server.domain.tld.vhost.err

    The two files are exactly the same based on a sha256 checksum.

    I have also tried reboot, restarting, stopping then restarting.

    This seems to be a recurring line in my journalctl -xe

    systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    -- An ExecStart= process belonging to unit apache2.service has exited.

    The below is a tail of my error.log

    [Fri Jul 21 17:23:03.417679 2023] [:emerg] [pid 672311:tid 140613178604864] AH00020: Configuration Failed, exiting
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed
    AH00016: Configuration Failed

    What I did do, what attempt to disable the vhosts one by one using a2dissite and it says none of them are installed.
    So I temporarily moved all the enabled sites to another location, and tried to a2ensite and it doesn't have any sites available.

    I think the issue lies in this.
    I have put the vhosts symlinks back, and this is where I sit, wondering where the system is looking for the vhost files?
     
  5. thisiszeev

    thisiszeev Member HowtoForge Supporter

    Further fiddling...

    I moved all the vhost files, and then moved them in one by one with each move running systemctl restart apache2.

    All my sites are working, it's only the site I setup for the mail.domain.tld aliases.
    That and apps.vhost and ispconfig.*
    if those files are there, it fails to load apache2.

    At least my clients are not offline, so I have more time to fiddle and no need to panic.
    Looking forward to some input.
     
  6. thisiszeev

    thisiszeev Member HowtoForge Supporter

    Okay, I have progress... I have established, that the error is in my certificates for server.domain.tld that has the mail.domain.tld aliases .

    I think something went wrong with the creation of those crt and key files earlier.

    I am going to try and do a certonly and see if I can replace them.

    Since I had the server address pointing to the same certs as symlinks from /usr/local/ispconfig/interface/ssl it is causing apps.vhost , ispconfig.vhost and the troublesome vhost to make apache2 fail. The only thing in common with all three are the two files that were created earlier.

    I have backups of the vhosts.files and the original certs, so I am going to try some black magic and see if it works, will revert.
     
  7. thisiszeev

    thisiszeev Member HowtoForge Supporter

    Restored my original crt and key file for now, moved the apps.vhost and ispconfig* back to sites-available and apache2 restarted fine.

    I was able to log into ISPC again, went to the site for name.domain.tld and removed SSL and Let's Encrypt tick boxes, then saved. A new vhost file was generated.

    I then went back and ticked SSL and Let's Encrypt and now the vhost file from the previous step is still there but there is a vhost.err again, this time vastly different.

    I think the issue is related to the creation of the certificate and key.

    So on my local machine I did a NSLOOKUP for each mail.domain.tld

    Once is pointing the wrong domain.

    So I deleted it from the configuration in ISPC under sites - aliasedomains

    Went back to sites and removed the SSL and Let's Encrypt, then went back and re added it.

    BINGO!!!! Apache2 can now be restarted using systemctl.

    I hope my rambling here does help someone in the future and past and present.

    Have a great weekend.
     
  8. thisiszeev

    thisiszeev Member HowtoForge Supporter

    One last note
    BACKUP EVERYTHING BEFORE YOU CHANGE IT
    editing configs and vhosts etc on your server can potentially cause issues, so it's important to have the back up.

    Remember: editing the raw file doesn't change the configuration inside ISPC and ISPC may overwrite your edits, if you are lucky.
     
    Th0m likes this.

Share This Page