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.
- 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>
-
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
-
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
- Eu verifiquei esta sintaxe de configuração.
$ sudo apache2ctl configtest Sintaxe OK
- reiniciei meu servidor.
$ sudo systemctl reinicia o apache2
- Agora, quando eu digitei (http): //zethanath.tk, eu receberia o seguinte.
insira a descrição da imagem aqui
- 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
- 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.
-
O que devo fazer para obter os https, quando eu digitei (http): //zethanath.tk no navegador?
-
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.