Failed to create directory error

I created a new subdomain and uploaded the WAR file to its directory, but the server returns the following error.

java.io.IOException: Unable to create the directory[/home/jack/public_html/WAR/MYWAR] ..... 

The permission of the WAR folder and the WAR file is 0755.

 drwxr-xr-x 4 jack jack 4096 Feb 2 02:43 ./ drwxr-xr-x 10 jack nobody 4096 Jan 25 01:48 ../ drwxr-xr-x 2 jack jack 4096 Jan 24 22:38 cgi-bin/ -rwxr-xr-x 1 jack jack 82135738 Feb 2 02:23 MYWAR.war* drwxr-xr-x 4 jack jack 4096 Jan 25 01:31 WEB-INF/ 

ps -aux | grep tomcat

 Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root 1239 0.0 0.0 103240 864 pts/2 S+ 04:38 0:00 grep tomcat root 1330 0.0 0.0 10436 352 ? Ss Feb01 0:00 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap start tomcat 1334 0.2 14.9 1566688 151852 ? Sl Feb01 1:38 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap start 
+6
source share
5 answers

0755 - rwxr-xr-x. If you do not own the directory (usually this is a user of anyone), you cannot write to the directory. You must be the owner of the directory or root to write to this location.

+5
source

to try:

 sudo chown -R tomcat:tomcat /home/jack/public_html/ 

You probably don't need to change public_html for everything, but you can try to see if it works, and then restrict the rights to the desired folder.

+2
source

We need to make sure that Tomcat has full folder access permission. First determine which Tomcat user or group is running. Ensure that the user and / or group owns it. For example, the following code will change the ownership of the test directories folder and everything under it:

 sudo chown -R owner:group /home/blabla/test 

This will give the owner and group ownership of the execution of teams. http://www.computerhope.com/unix/uchown.htm

Next, we use chmod to provide permissions that define permissions for the owner of the file ("user"), members of the group that owns the file ("group")

http://www.computerhope.com/unix/uchmod.htm

+1
source

looks like you need

give the group full access to the entry in the WAR directory

 sudo chmod 775 /home/jack/public_html/WAR/ 

then change the directory group to tomcat

 chown -R jack:tomcat /home/jack/public_html/WAR/ 
+1
source

If permission, user and group are correct. Maybe the answer is selinux.

+1
source

Source: https://habr.com/ru/post/981855/


All Articles