apache2 下的子域名 tomcat 被忽略(Ubuntu)

apache2 下的子域名 tomcat 被忽略(Ubuntu)

我的问题看起来很简单,但我不知道问题出在哪里我有 apache2、mod_jk 和两个应用程序 tomcat、main 和 test 我想使用 main 作为“主域”(因此,如果我有 url www.mysite.com,我会找到这个 main),如果我发送 test.mysite.com,我会继续测试

为了模拟这个(我现在只有一个域),我将主路径更改为 www.mysite.com/Main,将测试路径更改为 test.mysite.com/Test 问题是,如果我继续 test.mysite.com/Test,它找不到它。

我使用提供商来处理子域名的存在问题,我认为他们正确地创建了子域名。然而,他们给我发送了一个我可以 ping 的 ipv6 地址

我 100% 在 https 下工作,因此如果用户请求 http,它会将所有内容重定向到 https 下

问题:我如何知道问题出在哪里(我的配置还是提供商)?如何解决它!

非常感谢你的帮助

这是我的 000-default.conf 文件:

<VirtualHost *:80>
ServerName www.mysite.com
JkMount /Main* ajp13_worker
Redirect /   https://www.mysite.com/

RewriteEngine  on
RewriteCond %{HTTP_HOST} ^.*?(?:www\.)?mysite\.[\w\.]+.*$
RewriteRule ^(.*?)(?:|www\.)mysite\.[\w\.]+(.*)$ https://www.mysite.com$2
        # 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.example.com

        ServerAdmin webmaster@localhost
        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

        # 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

</VirtualHost>
<VirtualHost *:80>
ServerName test.mysite.com
JkMount /Test* ajp13_worker
Redirect /   https://test.mysite.com/
RewriteEngine  on
RewriteRule ^(.*?)test\.mysite\.[\w\.]+(.*)$ https://test.mysite.com$2
        # 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.example.com

        ServerAdmin webmaster@localhost
        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

        # 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

</VirtualHost>

答案1

答案很简单:我在 000-defaults 中定义了所有内容,而不是 default-ssl 文件中。现在,它可以正常工作了

相关内容