I have gotten myself wrapped around the axle with permissions and such. Here's the deal:
I have created a jail and I installed Tomcat 9 into the jail. As far as I can tell it is working as it should (I can start tomcat and get to the manager application).
What I'm trying to do is figure out the easiest way to move a .war file into the webapps directory (/mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps).
I already had an ftp user and was able to ftp the .war file to a dataset and then move the file to the webapps directory with a command like this (from inside the FreeNAS shell):
But then based on some googling I think I need to also do the following:
I'm wondering two things:
1. Can I FTP directly to /mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps/ so I can skip the step of moving the file? Using FileZilla I can navigate to that directory, but I get permission denied if I try to move a file into it.
2. Is it possible to write a shell script that would do everything for me once I get the .war file on the server? It would stop tomcat. Remove the current .war file from the webapps directory, copy the new .war file to the webapps directory, change any permissions necessary, and then start tomcat?
I have created a jail and I installed Tomcat 9 into the jail. As far as I can tell it is working as it should (I can start tomcat and get to the manager application).
What I'm trying to do is figure out the easiest way to move a .war file into the webapps directory (/mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps).
I already had an ftp user and was able to ftp the .war file to a dataset and then move the file to the webapps directory with a command like this (from inside the FreeNAS shell):
mv /mnt/FreeNASPool1/dataset1/documents/mywar.war /mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps
But then based on some googling I think I need to also do the following:
chown www:www /mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps/mywar.war
I'm wondering two things:
1. Can I FTP directly to /mnt/FreeNASPool1/iocage/jails/tomcat/root/usr/local/apache-tomcat-9.0/webapps/ so I can skip the step of moving the file? Using FileZilla I can navigate to that directory, but I get permission denied if I try to move a file into it.
2. Is it possible to write a shell script that would do everything for me once I get the .war file on the server? It would stop tomcat. Remove the current .war file from the webapps directory, copy the new .war file to the webapps directory, change any permissions necessary, and then start tomcat?