简体   繁体   中英

How can I open my web application in localhost:8080 directly instead of tomcat home page

How can I open my web application in localhost:8080 instead of the tomcat home page For example I want mysite.com:8080/mywebapp to open in mysite.com:8080 Without using any reverse proxy

You can do this task without any reverse proxy. when you type http://localhost:8080 your website opens

Rename the war file to ROOT.war and put it tomcat webapps directory and restart tomcat

, Or using Reverse proxy

  1. Rename your website to ROOT.war in tomcat webapps directory

  2. Install Httpd

  3. Enable Load mod_proxy_http.so and mod_proxy.so in /etc/httpd/conf/httpd.conf

  4. Add file called example.config under /etc/httpd/conf.d/example.conf And add the following configuration

        <VirtualHost *:8080>
          ServerName exmple.com
          ServerAlias *exmple.com
          ServerAdmin user@gmail.com
          ProxyPreserveHost On
          ProxyRequests off
          AllowEncodedSlashes NoDecode

          <Proxy *>
             Order deny,allow
             Allow from all 
          </Proxy>

          ProxyPass / http://localhost:8080/mywebapp  nocanon
          ProxyPassReverse / http://localhost:8080/mywebapp 

          LogLevel debug
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
        </VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM