I am deploying my Java application with Ant. Unfortunately my test deployment on the local machine doesn't work because of Vista. The Program Files directionaries are protected and i don't want to start Ant or Eclipse as an Admin. So i had the idea to move my webapps folder to a workspace subfolder, so i can use relative paths in Ant as well.
The solutions seems to be to modify the Host element in the server.xml. With Linux it isn't such a deal:
<Host name="localhost" appBase="/path/to/webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
But with Windows i don't get it right. I tried every possible combinations i could imagine, like:
C://Users//maerch//Workspaces//Tomcat6.0_webapps
C:/Users/maerch/Workspaces/Tomcat6.0_webapps
C:\Users\maerch\Workspaces\Tomcat6.0_webapps
C:\\Users\\maerch\\Workspaces\\Tomcat6.0_webapps
C://Users//maerch//Workspaces//Tomcat6.0_webapps\\
C:/Users/maerch/Workspaces/Tomcat6.0_webapps/
C:\Users\maerch\Workspaces\Tomcat6.0_webapps\
C:\\Users\\maerch\\Workspaces\\Tomcat6.0_webapps\\
The path is also correct, but it doesn't work. There are also no error messages in the log files neither the browser shows a 404 message or anything else. Just a white page without title and so on. Can anyone help?
The Tomcat configuration files, in XML format, are located in the " conf " sub-directory of your Tomcat installed directory, e.g. " c:\myWebProject\tomcat\conf " (for Windows) or " ~/myWebProject/tomcat/conf " (for macOS). The important configuration files are: server. xml.
The simple answer is that the java language and the java virtual machine don't provide a way to change the working directory of the JVM process. You won't be able to change the working directory after tomcat has started. Tomcat's startup scripts (bin/startup.sh and so on) don't set a working directory.
Open the web. xml file of the Tomcat manager application, for example TomcatInstallDir /webapps/manager/WEB-INF/web. xml. Save and close the web.
I have very the same security issue with Vista and I resolve it by providing "Full control" access level for "Users" group on "Program Files\Apache Software Foundation\Tomcat XYZ" folder.
It resolved deployment issues with tomcat for me as well as question on starting tomcat as a service. Of course you can assign permissions more strictly (per deployment user group or per user). IMO it's more quicker way then reconfigure the tomcat.
Regarding your original question how to change path outside of ${catalina.home} under Windows:
It's very the same as you have to accomplish it on *nix:
<Host name="localhost" appBase="/c:/webapps2"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
Did you have ROOT folder in you folder mentioned in appBase? The approach is tested under Tomcat 6.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With