rakesh73 Posted March 20, 2018 Posted March 20, 2018 How to set the context path of my war to "/". Currently my home page shows this: Index of / Name Last modified Size Description cgi-bin/ 2018-02-07 18:21 - test.jsp 2018-03-16 18:43 40 I would like the home page of my java app to show up in place of the default index page
wolstech Posted March 20, 2018 Posted March 20, 2018 You can't. WAR files cannot be assigned as the default page for a domain. You'll instead need to create an index file or other redirect and point users to the virtual folder where the WAR file is deployed. Place that file in the document root so when users visit http://beepr.heliohost.org/ they're redirected to your WAR file. Any redirect script would work, for instance an HTML file with a Javascript on it, an .htaccess file, or a PHP script with a header("Location: ..."); would all work fine for this.
rakesh73 Posted March 20, 2018 Author Posted March 20, 2018 I forgot to mention: username: rakesh73server: tommy
rakesh73 Posted March 20, 2018 Author Posted March 20, 2018 I could do this in my local tomcat server so why it can't be done in my domain.
wolstech Posted March 20, 2018 Posted March 20, 2018 It's to do with the fact that the Tomcat installation is shared between numerous users on our servers. I'll pass this onto Krydos to be sure, but I've never known of this being done on our system. WARs typically have to be inside a folder prefixed with the account username.
rakesh73 Posted March 20, 2018 Author Posted March 20, 2018 I want my complete app to be deployed in a war package. I do not want to put anything in the document root for now.Tomcat supports multiple domains/applications through configurations in server.xmlFor my local application I could configure the context path as below. Can something similar be done on my domain. <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" deployOnStartup="false"><Context path="" docBase="Beepr-0.0.1-SNAPSHOT"></Context> ........ ........</Host> Thanks
claod Posted March 24, 2018 Posted March 24, 2018 (edited) Hi everyone ,I'll face the same problem...I just created my account, migrate to Tommy, Installed Tomcat and ... to upload my project and make it work properly I'll need an access to server.xml : the root of our site, the SSL conf, jdbc driver for ourconnection pool... (the connexion pool is better perf for your Tomcat server).I can see i'm not the only one asking for it, we need an indirect access to our virtual host inside the server.xml at least.An idea : a form in the cpanel to edit our virtual host conf. Your server will receive the request, find out virtual host with our account informations, modify the xml with the form values afterward.Just a simple send xml text to add xml lines, the server will put them in our virtual host.Or put a file via FTP that'll configure the virtual host... You may waste some time to build it but once it'll be in our cPanel : "Automatic process" = You can do anything else. (If you don't have the time I may dev this fonctionality for you if you tell me what server side language will edit the xml) The web.xml is in the .war for the url paths as I can see... And we can run .js images sounds json models normally ?Thank you Edited March 24, 2018 by claod
Recommended Posts