Aplicativos HTTPS GWT no Apache e Tomcat EE

0

Eu gostaria de aprender como configurar corretamente o Apache2 e o Tomcat (TomEE) /8.5.6 (7.0.2) para o aplicativo GWT HTTPS na nova instalação do Ubuntu Server 16.04.3.

Aqui estão os passos que eu usei.

  1. Configurei meus registros de DNS.

  2. VerificaçãodaconfiguraçãodoApache.

    $sudoapache2ctl-SVirtualHostconfiguration:*:80zethanath.tk(/etc/apache2/sites-enabled/000-default.conf:1)*:443isaNameVirtualHostdefaultserverzethanath.tk(/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)port443namevhostzethanath.tk(/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)aliaswww.zethanath.tkaliasservlet.zethanath.tkport443namevhostzethanath.tk(/etc/apache2/sites-enabled/default-ssl.conf:2)port443namevhostwww.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. Configurou meu /etc/apache2/sites-enabled/default-ssl.conf

    <IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin [email protected]
                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 [email protected]
                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. Configurou meu /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. Configurou meu /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
    

Por favor, note que instalei libapache2-mod-jk . O conteúdo do meu /etc/hosts está abaixo.

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

Para os seguintes endereços no Firefox, obtenho estes resultados. Eles estão corretos?

  1. http://zethanath.tk

  2. http://www.zethanath.tk

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

    http://servlet.zethanath.tkUnabletoConnect
  4. OqueeurealmentequerofazerédeixaroApache2servirmeucertificadoeeledevemeredirecionarparaoservidorTomEE.EunãodeixariaoApache2exibirnenhumconteúdo,alémdocertificado.OrestantedoconteúdodeveserservidoapenaspormeiodeaplicativosGWT(kitdeferramentasdoGoogleWeb).EuachoqueoGWTesperariaaconfiguraçãocomoabaixo,maseunãoseicomofazerisso.

Em os documentos do 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 

The idea is to have Apache proxy requests to the servlet to the other server such that:

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

The following Apache configuration sets up such a rule using a Proxy:

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

To verify this is working, use a web browser to hit both (http)://www.example.com/MyApp/myapp/myService and (http)://servlet.example.com:8080/MyApp/myapp/myService.

You should get the same result in both cases (typically a 405: HTTP method GET is not supported by this URL, which is good). If you get something different hitting the second URL, you may have a configuration issue.

    
por Sethanath 10.08.2017 / 17:22

2 respostas

0

Eu posso progredir um pouco mais. No entanto, ainda não entendo certas coisas. Eu colei minhas perguntas no final desta postagem.

Aqui estão os passos que acabei de fazer.

  1. Eu reconfigurei "000-default-le-ssl.conf".

$ sudo nano /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. Eu reconfigurei o "default-ssl.conf". $ sudo nano /etc/apache2/sites-enabled/default-ssl.conf

    <IfModule mod_ssl.c>
    <VirtualHost _default_:443>
            ServerAdmin [email protected]
            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 [email protected]
            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 [email protected]
            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. Eu reconfigurei o "000-default.conf".

$ sudo nano /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 [email protected]
        #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 [email protected]
        #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 [email protected]
        #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. Eu verifiquei esta sintaxe de configuração.

$ sudo apache2ctl configtest Sintaxe OK

  1. reiniciei meu servidor.

$ sudo systemctl reinicia o apache2

  1. Agora, quando eu digitei (http): //zethanath.tk, eu receberia o seguinte.

insira a descrição da imagem aqui

  1. Agora, quando eu digitei (http): // (www) .zethanath.tk, eu receberia o site (https), que é o que eu quero.

insira a descrição da imagem aqui

  1. Agora, quando eu digitei (http): //servlet.zethanath.tk, também recebi o site (https), que é o que eu quero também.

Minhas perguntas para você são.

  1. O que devo fazer para obter os https, quando eu digitei (http): //zethanath.tk no navegador?

  2. Qual é a maneira correta de servir (http / https): //servlet.zethanath.tk apenas atrás do meu roteador? Eu não quero mostrar fora do meu roteador.

Obrigado.

    
por Sethanath 14.08.2017 / 20:42
0

Os passos seguintes resolveram o meu problema.

  1. sudo nano /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 [email protected]
    #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 nano /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 nano /etc/apache2/sites-available/default-ssl.conf

    <IfModule mod_ssl.c>
            <VirtualHost _default_:443>
            ServerAdmin [email protected]
            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. $ sudo apache2ctl configtest Sintaxe OK

  5. $ sudo systemctl reinicia o apache2

por Sethanath 17.08.2017 / 20:43