0

Hi I have a eclipse servlet project running on tomcat. My package name is com.gmail.ianlim224.web.test

So I will need to type this url to get to my index page:http://localhost:8080/com.gmail.ianlim224.web.test/

How can I do so that:
1) I do not need to specify the port(8080)
2) I do not need to specify the package name

This is what I am aiming to achive: http://localhost/

Ian Lim
  • 47
  • 9

1 Answers1

0

You need to configure tomcat server to listen to port 80. But you also need to look if port 80 in use or not. You may also need to configure Linux OS to allow port 80 How to change tomcat port number

Here is the quick solution to remove app name from url, rename you war file as root.war and then deploy (don't forget to remove previous root folder in tomcat deploy directory)

How to remove the application name in URL? tomcat + httpd

Umar Hussain
  • 3,461
  • 1
  • 16
  • 38
  • How about the package name? – Ian Lim Sep 02 '17 at 05:36
  • During deployment you have to set the default directory in tomcat server configuration to your project so that instead of going to tomcat web portal it goes to your application – Umar Hussain Sep 02 '17 at 05:39
  • Thanks but can you explain more about the servlet war files and the directories im confused – Ian Lim Sep 02 '17 at 06:09
  • which OS are you using? – Umar Hussain Sep 02 '17 at 06:16
  • Im using windows 8.1 – Ian Lim Sep 02 '17 at 06:47
  • got to the tomcat installation folder, there you will find the webapps folder there you will see the folders of all apps you have deployed to server and a root folder, the root folder is by default served at `domain.com/` now delete this and rename the war file generated by eclipse to root.war, when that file is deployed root folder will be created. and your app will be served directly. – Umar Hussain Sep 02 '17 at 06:56