A
A
Alexander2017-05-30 12:46:10
Apache HTTP Server
Alexander, 2017-05-30 12:46:10

Apache 2 - Installing an SSL certificate?

Friends need your help in installing a certificate on a web server to activate https
Apache 2.4 + PHP7 + MYSQL is installed - everything works fine on port 80.
Wirth config. host like this:

NameVirtualHost *:80
<VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot /var/www/ustim.ru/httpd
        ServerName ustim.mooo.com
        ServerAlias www.ustim.mooo.com

        <Directory /var/www/ustim.ru/httpd>
           Options -Indexes
           AllowOverride None
           Order allow,deny
           allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

To install and activate the certificate, I did the following... I generated a certificate and a key, which are located here /etc/apache2/ssl
Next, in the file virt. host at the very end I add another VirtualHost section, it turned out like this
<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/ustim.crt
        SSLCertificateKeyFile /etc/apache2/ssl/ustim.key

        ServerAdmin [email protected]
        DocumentRoot /var/www/ustim.ru/httpd
        ServerName ustim.mooo.com
        ServerAlias www.ustim.mooo.com

        <Directory /var/www/ustim.ru/httpd>
           Options -Indexes
           AllowOverride None
           Order allow,deny
           allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I save, check Apache through apachectl configtest,
I get this
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/ustim.ru.conf:1
[Tue May 30 12:26:21.797904 2017 ] [alias:warn] [pid 20088] AH00671: The Alias ​​directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Well, as a result, nothing changes, it only works on port 80. I open the file /etc/apache2/ports.conf
Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

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

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I change the port on which Apache listens to
Listen 443
As a result, the Apache service is not rebooted at all, everything is the same in the logs.
Tell me where to drop? Or where did I mess up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hey_umbrella, 2021-09-02
@hey_umbrella

Did you solve the problem? I just have the same thing (

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question