0
votes

We have VPS and domain name by go daddy . We have deployed java web application in tomcat installed on VPS. I am able to acccess appplication by ip address

for example : xxxx.xxxx:xxx:xxxx:8080/mysampleweb but i want to acccess the same application by my registered domain name i.e www.mysampleweb.com

what i did 1) I have added host entry in tomcat server.xml 2) map domain name with IP in DNS in godaddy account 3) Changed port from 8080 to 80 but no luck

Can any one share me details step to map/access tomcat deployed web application on VPS by registered domain name

1
I'm not familiar with tomcat, but did you restart the service after changing the port specification? - childofsoong
Yes i did restart tomcat - user5712181
Am getting this error : The requested URL /mysampleweb was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Server.xml changes <Host name="mysampleweb.com" appBase="webapps" <Context path="" docBase="/opt/apache-tomcat-8.0.28/webapps/mysampleweb"/> </Host> - user5712181
You're changing a lot at once. Is your tomcat still up with ip address? - Jan
Did you change the DNS settings? They might take a few hours to propagate, depending on the previous DNS settings (there's a timeout, can be up to a week). Try ping <your-ip-address> and ping <your-domain-name>. They should both display that they're pinging the same IP address. If they do: Try accessing tomcat again - the DNS propagation might have happened in the mean time. Otherwise: report back. - Olaf Kock

1 Answers

1
votes

Open the server.xml file

  <Alias>www.test.local</Alias>

  <Context path="" docBase="ExtractedWARName" debug="0" privileged="true" />

  <Valve className="org.apache.catalina.valves.AccessLogValve"
         directory="logs"   prefix="localhost_access_log." suffix=".txt"
         pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false" />

where ExtractedWARName is the war extracted folder name.