Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Tomcat Address on my localhost

On my Tomcat, I have an HTML page.

I need to type the following address to make it run:

http://127.0.0.1:8080/BiddingSystem/BiddingSystem.html

but I want it to be accessed using this address: www.moribiz.com

Is this possible just by changing some setting on Tomcat?

like image 264
Noor Avatar asked Feb 27 '11 11:02

Noor


2 Answers

You can configure the host properties in Tomcat's server.xml, and can make an alias to the default localhost host:

<Host name="localhost" appBase="webapps" unpackWARs="true" 
            autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
    <Alias>www.moribiz</Alias>
</Host>

For more information, see Tomcat's configuration manual.

like image 144
khotyn Avatar answered Oct 18 '22 10:10

khotyn


I have Eclipse EE and Tomcat7, and I need to run my servlets not at localhost:8080, but on a pretty domain :)

I have made it this way:

  1. In file %windows%\system32\drivers\etc\hosts add:

    127.0.0.10 tomcat
    
  2. In file %workspace%\Servers\Tomcat 7 at localhost-config\Server.xml

    <Connector port="80" address="127.0.0.10" connectionTimeout="20000"
               protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8" />
    <Engine defaultHost="tomcat" name="Catalina">
        <Host name="tomcat" appBase="webapps" autoDeploy="true" unpackWARs="true">
        ...
        </Host>
    </Engine>

Now my Apache Tomcat works fine (I hope) at http://tomcat/ and at same time my Apache2+PHP works at http://localhost/.

like image 30
Олег Всильдеревьев Avatar answered Oct 18 '22 10:10

Олег Всильдеревьев