H
H
hey_umbrella2021-09-02 16:52:48
Apache HTTP Server
hey_umbrella, 2021-09-02 16:52:48

What is wrong with NameVirtualHost?

After I enabled ssl, I get error AH00548 at startup: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:6

Site config

<VirtualHost *:80>
  ServerName careforme.ru
  ServerAdmin [email protected]
  WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
  <Directory /var/www/FlaskApp/FlaskApp/>
    Order allow,deny
    Allow from all
  </Directory>
  Alias /static /var/www/FlaskApp/FlaskApp/static
   <Directory /var/www/FlaskApp/FlaskApp/static/>
    Order allow,deny
    Allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  LogLevel warn
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
  ServerName careforme.ru
  ServerAdmin [email protected]
  WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
  <Directory /var/www/FlaskApp/FlaskApp/>
    Order allow,deny
    Allow from all
  </Directory>
  Alias /static /var/www/FlaskApp/FlaskApp/static
   <Directory /var/www/FlaskApp/FlaskApp/static/>
    Order allow,deny
    Allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  LogLevel warn
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  SSLEngine on
  SSLProtocol all -SSLv2
  SSLCertificateKeyFile /etc/cloudflare/careforme.ru.key
  SSLCertificateFile /etc/cloudflare/careforme.ru.pem
</VirtualHost>


config port.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.con


NameVirtualHost *:80
Listen 80
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
NameVirtualHost *:443
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Volkov, 2021-09-03
@voleg4u

The directive is old and not used.
In future versions, the presence of this directive will be considered an error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question