HTTPS приложения GWT на Apache и Tomcat EE

Я хотел бы изучить, как правильно настроить Apache2 и Tomcat (TomEE)/8.5.6 (7.0.2) для приложения HTTPS GWT на новой установке Сервера Ubuntu 16.04.3.

Вот шаги, которые я использовал.

  1. Настроенный мои записи DNS.

    enter image description here

  2. Проверенная конфигурация Apache.

    $ sudo apache2ctl -S
    VirtualHost configuration: 
    *:80   zethanath.tk (/etc/apache2/sites-enabled/000-default.conf:1)
    *:443 is a NameVirtualHost default server zethanath.tk (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
    port 443 namevhost zethanath.tk (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)
    alias www.zethanath.tk
    alias servlet.zethanath.tk
    port 443 namevhost zethanath.tk (/etc/apache2/sites-enabled/default-ssl.conf:2)
    port 443 namevhost www.zethanath.tk (/etc/apache2/sites-enabled/default-ssl.conf:140)
    
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex rewrite-map: using_defaults
    Mutex ssl-stapling-refresh: using_defaults
    Mutex ssl-stapling: using_defaults
    Mutex proxy: using_defaults
    Mutex ssl-cache: using_defaults
    Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
    Mutex watchdog-callback: using_defaults
    Mutex proxy-balancer-shm: using_defaults
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    User: name="www-data" id=33
    Group: name="www-data" id=33
    
  3. Настроенный мой /etc/apache2/sites-enabled/default-ssl.conf

    <IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin erick9.hi5@gmail.com
                ServerName  zethanath.tk
    
                ProxyPreserveHost On
                ProxyPass / http://192.168.1.70:8080/index//
                ProxyPassReverse / http://192.168.1.70:8080/index//
    
                JKMount /* ajp13_worker
    
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
    
                SSL Engine Switch:
                #   Enable/Disable SSL for this virtual host.
                SSLEngine on
    
                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
                Include /etc/letsencrypt/options-ssl-apache.conf
    
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
    
        </VirtualHost>
    
        <VirtualHost _default_:443>
                ServerAdmin erick9.hi5@gmail.com
                ServerName  www.zethanath.tk
    
                ProxyPreserveHost On
                ProxyPass / http://192.168.1.70:8080/index//
                ProxyPassReverse / http://192.168.1.70:8080/index//
    
                JKMount /* ajp13_worker
    
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
    
                SSLEngine on
    
                #   A self-signed (snakeoil) certificate can be created by installing
                #   the ssl-cert package. See
                #   /usr/share/doc/apache2/README.Debian.gz for more info.
                #   If both key and certificate are stored in the same file, only the
                #   SSLCertificateFile directive is needed.
                SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
                Include /etc/letsencrypt/options-ssl-apache.conf
    
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
    
        </VirtualHost>
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  4. Настроенный мой /etc/apache2/sites-enabled/000-default-le-ssl.conf

    <IfModule mod_ssl.c>
    <VirtualHost *:443>
    
        ServerName zethanath.tk
        ServerAlias www.zethanath.tk servlet.zethanath.tk
    
        ProxyPreserveHost On
        ProxyPass / http://192.168.1.70:8080/index//
        ProxyPassReverse / http://192.168.1.70:8080/index//
    
        JKMount /* ajp13_worker
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
        SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    
    </VirtualHost>
    </IfModule>
    
  5. Настроенный мой /etc/apache2/sites-enabled/000-default.conf

    <VirtualHost *:80 >
        ServerName  zethanath.tk
        ServerAlias www.zethanath.tk servlet.zethanath.tk
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        #JKMount /* ajp13_worker
    
        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
    
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =zethanath.tk
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}   
    [END,NE,R=permanent]
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    

Обратите внимание на то, что я установил libapache2-mod-jk. Содержание моего /etc/hosts ниже.

127.0.0.1       localhost
127.0.1.1       erick-ASRock-N68C-GS4-FX
192.168.1.70    zethanath.tk

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Для следующих адресов в Firefox я получаю эти результаты. Они корректны?

  1. http://zethanath.tk
    enter image description here

  2. http://www.zethanath.tk

    http://192.168.1.70:8080/index/
    
  3. http://servlet.zethanath.tk

    http://servlet.zethanath.tk
    Unable to Connect
    
  4. То, что я действительно хочу сделать, должно позволить Apache2 вручить мой сертификат, и он должен перенаправить меня к серверу TomEE. Я не позволил бы Apache2 служить любому содержанию вообще около сертификата. Остальная часть содержания должна быть подана через GWT (набор Веб-инструмента Google) приложения только. Я думаю, что GWT ожидал бы установку как ниже, но я не знаю, как сделать это.

Из документов GWT:

Your Apache server is running on www.example.com
Your Tomcat server is running on servlet.example.com:8080
Your GWT module has a `<rename-to="myapp">`
You have one RPC servlet, mapped into /myapp/myService 

Идея состоит в том, чтобы иметь запросы прокси Apache к сервлету к другому серверу, таким образом что:

(http)://www.example.com/MyApp/myapp/myService-> (http)://servlet.example.com:8080/MyApp/myapp/myService

Следующие конфигурации модели Apache такое правило с помощью Прокси:

ProxyPass /MyApp/myapp/myService (http)://servlet.example.com:8080/MyApp/myapp/myService 
ProxyPassReverse /MyApp/myapp/myService (http)://servlet.example.com:8080/MyApp/myapp/myService 

Для проверки это работает, используйте веб-браузер для удара обоих (http)://www.example.com/MyApp/myapp/myService и (http)://servlet.example.com:8080/MyApp/myapp/myService.

Необходимо получить тот же результат в обоих случаях (обычно 405: метод HTTP ДОБИРАЕТСЯ, не поддерживается этим URL, который хорош). Если Вы получаете что-то другое поражающее второй URL, у Вас может быть проблема конфигурации.

0
задан 10 August 2017 в 08:35

2 ответа

Я могу прогрессировать немного далее. Однако я все еще не понимаю определенные вещи. Я вставил свои вопросы в конце этой регистрации.

Вот шаги, которые я только что сделал.

  1. я реконфигурировал "000-default-le-ssl.conf".

$ sudo нано/etc/apache2/sites-enabled/000-default-le-ssl.conf

    <IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerName  zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #DocumentRoot /var/www/html

        JKMount /* ajp13_worker

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

        SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost> 
    <VirtualHost *:443>
        ServerName (www).zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #DocumentRoot /var/www/html

        JKMount /* ajp13_worker

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

        SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
    <VirtualHost *:443>
        ServerName  servlet.zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #DocumentRoot /var/www/html

        JKMount /* ajp13_worker

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

        SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
    </IfModule>
  1. я реконфигурировал "значение-по-умолчанию-ssl.conf". $ sudo нано/etc/apache2/sites-enabled/default-ssl.conf

    <IfModule mod_ssl.c>
    <VirtualHost _default_:443>
            ServerAdmin erick9.hi5@gmail.com
            ServerName  zethanath.tk
            ServerAlias zethanath.tk
    
            ProxyPreserveHost On
            ProxyPass / (http)://192.168.1.70:8080/Index//
            ProxyPassReverse / (http)://192.168.1.70:8080/Index//
    
            #DocumentRoot /var/www/html
            JKMount /* ajp13_worker
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            SSLEngine on
    
            SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
            Include /etc/letsencrypt/options-ssl-apache.conf
    
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
    </VirtualHost>
    
    <VirtualHost _default_:443>
            ServerAdmin erick9.hi5@gmail.com
            ServerName  (www).zethanath.tk
            ServerAlias zethanath.tk
    
            ProxyPreserveHost On
            ProxyPass / (http)://192.168.1.70:8080/Index//
            ProxyPassReverse / (http)://192.168.1.70:8080/Index//
    
            #DocumentRoot /var/www/html
            JKMount /* ajp13_worker
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            SSLEngine on
    
            SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
            Include /etc/letsencrypt/options-ssl-apache.conf
    
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
    </VirtualHost>
    <VirtualHost _default_:443>
            ServerAdmin erick9.hi5@gmail.com
            ServerName  servlet.zethanath.tk
            ServerAlias zethanath.tk
    
            ProxyPreserveHost On
            ProxyPass / (http)://192.168.1.70:8080/Index//
            ProxyPassReverse / (http)://192.168.1.70:8080/Index//
    
            #DocumentRoot /var/www/html
            JKMount /* ajp13_worker
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            SSLEngine on
    
            SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
            Include /etc/letsencrypt/options-ssl-apache.conf
    
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
        </VirtualHost>
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  2. я реконфигурировал "000-default.conf".

$ sudo нано/etc/apache2/sites-enabled/000-default.conf

    <VirtualHost *:80 >
        ServerName  zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #ServerAdmin erick9.hi5@gmail.com
        #DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        #JKMount /* ajp13_worker

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =zethanath.tk
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

    </VirtualHost>

    <VirtualHost *:80 >
        ServerName  (www).zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #ServerAdmin erick9.hi5@gmail.com
        #DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        #JKMount /* ajp13_worker

        RewriteEngine on
        RewriteCond %{SERVER_NAME} =(www).zethanath.tk
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

    </VirtualHost>

    <VirtualHost *:80 >
        ServerName  servlet.zethanath.tk
        ServerAlias zethanath.tk

        ProxyPreserveHost On
        ProxyPass / (http)://192.168.1.70:8080/Index//
        ProxyPassReverse / (http)://192.168.1.70:8080/Index//

        #ServerAdmin erick9.hi5@gmail.com
        #DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        #JKMount /* ajp13_worker

        RewriteEngine on
        RewriteCond %{SERVER_NAME} =zethanath.tk
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

    </VirtualHost>

    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  1. я проверил их синтаксис конфигурации.

синтаксис sudo apache2ctl configtest OK

  1. $ я перезапустил свой сервер.

$ sudo systemctl перезапускают apache2

  1. Теперь, когда я ввел (http)://zethanath.tk, я получил бы следующее.

вводят описание изображения здесь

  1. Теперь, когда я ввел (http)://(www) .zethanath.tk, я получил бы (https) сайт, который является тем, что я хочу.

вводят описание изображения здесь

  1. Теперь, когда я ввел (http)://servlet.zethanath.tk, я также получил бы (https) сайт, который является тем, что я хочу также.

Мои вопросы Вам.

  1. , Что, я должен сделать для получения https, когда я ввел (http)://zethanath.tk в браузере?

  2. , Что является надлежащим способом служить (http/https)://servlet.zethanath.tk позади моего маршрутизатора только? Я не хочу, чтобы это показало вне моего маршрутизатора.

Спасибо.

0
ответ дан 2 November 2019 в 19:49

Следующие шаги решили мою проблему.

  1. sudo нано/etc/apache2/sites-enabled/000-default.conf

    <VirtualHost *:80 >
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    
    ServerName  www.zethanath.tk
    ServerAlias servlet.zethanath.tk zethanath.tk
    
    Redirect permanent "/" "https://www.zethanath.tk/"
    
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.70:8080/Index/
    ProxyPassReverse / http://192.168.1.70:8080/Index/
    
    #ServerAdmin erick9.hi5@gmail.com
    #DocumentRoot /var/www/html
    
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    #JKMount /* ajp13_worker
    
    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    #JKMount /* ajp13_worker
    
    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
    
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.zethanath.tk
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  2. sudo нано/etc/apache2/sites-enabled/000-default-le-ssl.conf

    <IfModule mod_ssl.c>
    <VirtualHost *:443>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    
    ServerName  www.zethanath.tk
    ServerAlias servlet.zethanath.tk zethanath.tk
    
    Redirect permanent "/" "https://www.zethanath.tk/"
    
    ProxyPreserveHost On
    ProxyPass / http://192.168.1.70:8080/Index/
    ProxyPassReverse / http://192.168.1.70:8080/Index/
    
    #DocumentRoot /var/www/html
    
    #JKMount /* ajp13_worker
    
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn
    
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
    
    SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
    
    </VirtualHost>
    
    </IfModule>
    
  3. sudo нано/etc/apache2/sites-available/default-ssl.conf

    <IfModule mod_ssl.c>
            <VirtualHost _default_:443>
            ServerAdmin erick9.hi5@gmail.com
            ServerName  www.zethanath.tk
            ServerAlias servlet.zethanath.tk zethanath.tk
    
            Redirect permanent "/" "https://www.zethanath.tk/"
    
            ProxyPreserveHost On
            ProxyPass / http://192.168.1.70:8080/Index/
            ProxyPassReverse / http://192.168.1.70:8080/Index/
    
            #DocumentRoot /var/www/html
            #JKMount /* ajp13_worker
    
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
    
            #   SSL Engine Switch:
            #   Enable/Disable SSL for this virtual host.
            SSLEngine on
    
            #   A self-signed (snakeoil) certificate can be created by installing
            #   the ssl-cert package. See
            #   /usr/share/doc/apache2/README.Debian.gz for more info.
            #   If both key and certificate are stored in the same file, only the
            #   SSLCertificateFile directive is needed.
            SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem
            Include /etc/letsencrypt/options-ssl-apache.conf
    
            #   Server Certificate Chain:
            #   Point SSLCertificateChainFile at a file containing the
            #   concatenation of PEM encoded CA certificates which form the
            #   certificate chain for the server certificate. Alternatively
            #   the referenced file can be the same as SSLCertificateFile
            #   when the CA certificates are directly appended to the server
            #   certificate for convinience.
            #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
    
            #   Certificate Authority (CA):
            #   Set the CA certificate verification path where to find CA
            #   certificates for client authentication or alternatively one
            #   huge file containing all of them (file must be PEM encoded)
            #   Note: Inside SSLCACertificatePath you need hash symlinks
            #                to point to the certificate files. Use the provided
            #                Makefile to update the hash symlinks after changes.
            #SSLCACertificatePath /etc/ssl/certs/
            #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
    
            #   Certificate Revocation Lists (CRL):
            #   Set the CA revocation path where to find CA CRLs for client
            #   authentication or alternatively one huge file containing all
            #   of them (file must be PEM encoded)
            #   Note: Inside SSLCARevocationPath you need hash symlinks
            #                to point to the certificate files. Use the provided
            #                Makefile to update the hash symlinks after changes.
            #SSLCARevocationPath /etc/apache2/ssl.crl/
            #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
    
            #   Client Authentication (Type):
            #   Client certificate verification type and depth.  Types are
            #   none, optional, require and optional_no_ca.  Depth is a
            #   number which specifies how deeply to verify the certificate
            #   issuer chain before deciding the certificate is not valid.
            #SSLVerifyClient require
            #SSLVerifyDepth  10
    
            #   SSL Engine Options:
            #   Set various options for the SSL engine.
            #   o FakeBasicAuth:
            #        Translate the client X.509 into a Basic Authorisation.  This means that
            #        the standard Auth/DBMAuth methods can be used for access control.  The
            #        user name is the `one line' version of the client's X.509 certificate.
            #        Note that no password is obtained from the user. Every entry in the user
            #        file needs this password: `xxj31ZMTZzkVA'.
            #   o ExportCertData:
            #        This exports two additional environment variables: SSL_CLIENT_CERT and
            #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
            #        server (always existing) and the client (only existing when client
            #        authentication is used). This can be used to import the certificates
            #        into CGI scripts.
            #   o StdEnvVars:
            #        This exports the standard SSL/TLS related `SSL_*' environment variables.
            #        Per default this exportation is switched off for performance reasons,
            #        because the extraction step is an expensive operation and is usually
            #        useless for serving static content. So one usually enables the
            #        exportation for CGI and SSI requests only.
            #   o OptRenegotiate:
            #        This enables optimized SSL connection renegotiation handling when SSL
            #        directives are used in per-directory context.
            #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>
    
            #   SSL Protocol Adjustments:
            #   The safe and default but still SSL/TLS standard compliant shutdown
            #   approach is that mod_ssl sends the close notify alert but doesn't wait for
            #   the close notify alert from client. When you need a different shutdown
            #   approach you can use one of the following variables:
            #   o ssl-unclean-shutdown:
            #        This forces an unclean shutdown when the connection is closed, i.e. no
            #        SSL close notify alert is send or allowed to received.  This violates
            #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
            #        this when you receive I/O errors because of the standard approach where
            #        mod_ssl sends the close notify alert.
            #   o ssl-accurate-shutdown:
            #        This forces an accurate shutdown when the connection is closed, i.e. a
            #        SSL close notify alert is send and mod_ssl waits for the close notify
            #        alert of the client. This is 100% SSL/TLS standard compliant, but in
            #        practice often causes hanging connections with brain-dead browsers. Use
            #        this only for browsers where you know that their SSL implementation
            #        works correctly.
            #   Notice: Most problems of broken clients are also related to the HTTP
            #   keep-alive facility, so you usually additionally want to disable
            #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
            #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
            #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
            #   "force-response-1.0" for this.
            # BrowserMatch "MSIE [2-6]" \
            #               nokeepalive ssl-unclean-shutdown \
            #               downgrade-1.0 force-response-1.0
    
    </VirtualHost>
    
    </IfModule>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
  4. $ OK

  5. синтаксиса sudo apache2ctl configtest $ sudo systemctl перезапускают apache2

0
ответ дан 2 November 2019 в 19:49

Другие вопросы по тегам:

Похожие вопросы: