【发布时间】:2017-08-26 02:33:09
【问题描述】:
我不知道为什么我在访问我的 GWT 应用程序时不断收到“404 请求的资源不可用”。目前,我在家中的 TomEE/8.5.6 (7.0.2) 上托管我的 GWT 应用程序。
情况如下。
我可以将“TomEE Web 应用程序管理器”中的 GWT 应用程序用作 (http)://192.168.1.70:8080/Index
-
但是,当我在浏览器中键入 (http)://www.zethanath.tk 时,我会得到 (https)://www.zethanath.tk/ 和 HTTP 状态 404。
这是我的配置的详细信息。
Ubuntu:/opt/tomcat/webapps$ ls -l
total 20932
drwxrwxr-x 14 tomcat tomcat 4096 Aug 4 11:46 docs
drwxrwxr-x 5 tomcat tomcat 4096 Aug 4 11:46 host-manager
drwxrwxrwx 5 tomcat tomcat 4096 Aug 25 08:46 Index
-rwxrwxrwx 1 tomcat tomcat 21411520 Aug 25 08:46 Index.war
drwxrwxr-x 5 tomcat tomcat 4096 Aug 4 11:46 manager
drwxrwxr-x 3 tomcat tomcat 4096 Aug 8 17:30 ROOT
sudo nano 000-default.conf
<VirtualHost *:80 >
Protocols h2 http/1.1
ServerAdmin erick9.hi5@gmail.com
ServerName www.zethanath.tk
ServerAlias servlet.zethanath.tk zethanath.tk
DocumentRoot "/opt/tomcat/webapps/Index"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
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
sudo nano default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
Protocols h2 http/1.1
ServerAdmin erick9.hi5@gmail.com
ServerName www.zethanath.tk
ServerAlias servlet.zethanath.tk zethanath.tk
DocumentRoot "/opt/tomcat/webapps/Index"
JKMountCopy On
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
我一直在想我需要将端口 8080 与“DocumentRoot”/opt/tomcat/webapps/Index 相关联,但我不确定如何。
这是我的 UFW 的详细信息。我在路由器中有类似的设置。
sudo ufw status
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Apache Full ALLOW Anywhere
20/tcp ALLOW Anywhere
21/tcp ALLOW Anywhere
990/tcp ALLOW Anywhere
40000:50000/tcp ALLOW Anywhere
Apache Secure ALLOW Anywhere
8080 ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW Anywhere (v6)
20/tcp (v6) ALLOW Anywhere (v6)
21/tcp (v6) ALLOW Anywhere (v6)
990/tcp (v6) ALLOW Anywhere (v6)
40000:50000/tcp (v6) ALLOW Anywhere (v6)
Apache Secure (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)
非常感谢您的帮助。
【问题讨论】: