ファイルで暗号化されたコンテンツのみを提供し、プロキシサーバーの背後で実行するようにCentOS 7
Webサーバーを設定するにはどうすればよいですか?SSL
war
tomcat
私はこれがfirewalld
、https
およびを使用することを含むと思いますtomcat
。これはhttps
のラッパーですhttpd
。現在のポート8080に公開すると、war
ファイルは完全に実行されます。しかし、ポート8080へのすべての外部アクセスをブロックしたいと思います。この質問は-encryptedの後ろにラップする方法についてです。 tomcat
tomcat
tomcat
SSL
proxy server
これが私が今まで持っているものです。
大衆zone
はfirewalld
:
[root@xxx-xx-xxx-xx conf]# firewall-cmd --list-all
public (default, active)
interfaces: enp3s0
sources:
services: https ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
/usr/lib/firewalld/services/https.xml
次のようになります。
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>Secure WWW (HTTPS)</short>
<description>HTTPS is a modified HTTP used to serve Web pages when security is important. Examples are sites that require logins like stores or web mail. This option is not required for viewing pages locally or developing Web pages. You need the httpd package installed for this option to be useful.</description>
<port protocol="tcp" port="443"/>
</service>
/etc/httpd/conf/httpd.conf
ワンクリックで私の準備が完了することがあります。このリンク。httpd
私は.追加する必要がありますtomcat
か?そして、公開で追加したので自動的に呼び出されますか?virtualhost
httpd.conf
httpd
https
firewalld
zone
私は読むこと/opt/tomcat/conf/server.xml
ができます。このリンク。
編集する:
httpdを再起動しようとして失敗しました。結果は次のとおりです。
[[email protected] ~]# systemctl restart httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
[[email protected] ~]# systemctl status httpd.service -l
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Thu 2014-12-11 15:38:00 EST; 59s ago
Process: 31036 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 31034 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 31034 (code=exited, status=1/FAILURE)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Dec 11 15:38:00 server.ip.address.static.servdns.com httpd[31034]: AH00526: Syntax error on line 58 of /etc/httpd/conf/httpd.conf:
Dec 11 15:38:00 server.ip.address.static.servdns.com httpd[31034]: Invalid command '...///', perhaps misspelled or defined by a module not included in the server configuration
Dec 11 15:38:00 server.ip.address.static.servdns.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 11 15:38:00 server.ip.address.static.servdns.com systemd[1]: Failed to start The Apache HTTP Server.
Dec 11 15:38:00 server.ip.address.static.servdns.com systemd[1]: Unit httpd.service entered failed state.
編集#2:
virtualhost
タグを変更し、index.html
単純なファイルを追加してから、次のような /www/example1/index.html
ドキュメントタグを追加しました。httpd.conf
<VirtualHost *:443>
DocumentRoot /www/example1/
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/pki/tls/certs/some.crt
SSLCertificateChainFile /etc/pki/tls/certs/bundle.crt
SSLCertificateKeyFile /etc/pki/tls/private/some.key
# ProxyPass / http://local_host:8080/
# ProxyPassReverse / http://local_host:8080/
</VirtualHost>
<Directory "/www/example1/">
Options None
AllowOverride None
allow from all
</Directory>
しかし、今https://server.ip.address
ブラウザで結果を入力してみてください。Unable to connect. Firefox can't establish a connection to the server at server.ip.address
ベストアンサー1
その音で見てあなたは一つを追っているようですねreverse proxy
。クイックGoogleは、可能なさまざまなソリューションを示しています。
簡単なオプションは、インストールされているapache
Webサーバーをプロキシとして使用することです。
これを行うには、以下を変更して追加する必要がhttpd.conf
あります。
<VirtualHost your.domain.name:443>
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/pki/tls/certs/your_public.crt
SSLCertificateChainFile /etc/pki/tls/certs/bundle.crt
SSLCertificateKeyFile /etc/pki/tls/private/your_private.key
ProxyPass / http://ip.addr:8080/myappname
ProxyPassReverse / http://ip.addr:8080/myappname
</VirtualHost>
ノート:上記の下線を削除してくださいlocal_host
。 SEでは言葉で投稿できません!
残りの構成によっては若干の調整が必要になる場合がありますが、上記を始めるだけです。