Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to create the directory error

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

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

The permission of WAR folder and the WAR file are 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
like image 770
Jack Avatar asked Feb 02 '15 04:02

Jack


People also ask

Could not create directory while installing plugin in WordPress?

If your site's permissions settings are causing the “Installation failed: could not create directory error,” you can resolve it by resetting them. To do so, you'll need to connect to your server via File Transfer Protocol (FTP), using an FTP client.

How do I fix Windows folder access denied errors?

Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.


2 Answers

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

like image 67
Joao Vitorino Avatar answered Oct 01 '22 23:10

Joao Vitorino


try:

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

probably you shouldn't need to change for the entire public_html, but you can try to see if it works, and then restrict permissions to your desired folder.

like image 44
azbarcea Avatar answered Oct 01 '22 23:10

azbarcea