๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
์„œ๋ฒ„/Linux

[Linux] fail - deploy upload failed, exception : permission denied

by yunamom 2022. 10. 1.
๋ฐ˜์‘ํ˜•

fail - deploy upload failed, exception : permission denied

ubuntu ๊ธฐ์ค€

~$ sudo chmod 755 /var/lib/tomcat9/webapps
~$ ls -al /var/lib/tomcat9
ํ•ฉ๊ณ„ 20
.
.
drwxr-xr-x  8 tomcat tomcat 4096 10์›”  1 11:34 webapps

chmod (change mode์˜ ์•ฝ์ž) ๋ช…๋ น์–ด๋Š” ํŒŒ์ผ๋“ค์ด๋‚˜ ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ ํŒŒ์ผ ์‹œ์Šคํ…œ ๋ชจ๋“œ๋“ค์„ ๋ฐ”๊พผ๋‹ค. 

 

ํŒŒ์ผ ๊ถŒํ•œ ๋ฐ”๊พผ๋’ค์—๋„ permission denied ๋‚ ๊ฒฝ์šฐ ์•„๋ž˜ ์ฐธ์กฐ ( ์ถœ์ฒ˜ : StackExchange )

#setting up tomcat as the webapps group
~$ chgrp -R tomcat /var/lib/tomcat9/webapps

#deploy new applications, add write permissions 
~$ chmod -R g+w /var/lib/tomcat9/webapps

#which you remove again after deployment
~$ chmod -R g-w /var/lib/tomcat9/webapps

 

chgrp (Change Group์˜ ์•ฝ์ž) ๋ช…๋ น์–ด๋Š” ํŒŒ์ผ์ด๋‚˜ ๋””๋ ‰ํ† ๋ฆฌ์˜ ๊ทธ๋ฃน์„ ๋ณ€๊ฒฝํ• ๋•Œ ์‚ฌ์šฉ ๋ฉ๋‹ˆ๋‹ค.

์˜ต์…˜ ์„ค๋ช…
-c ํŒŒ์ผ์˜ ๊ทธ๋ฃน๋ช…์„ ๋ณ€๊ฒฝํ• ๋•Œ ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ๋งŒ ์ถœ๋ ฅํ•œ๋‹ค
-f ๊ทธ๋ฃน์ด ๋ณ€๊ฒฝ๋˜์ง€ ์•Š๋Š” ํŒŒ์ผ๋“ค์— ๋Œ€ํ•œ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ์ง€ ์•Š๋Š”๋‹ค
-v ์ž‘์—… ์ง„ํ–‰ ์ƒํƒœ๋ฅผ ์ž์„ธํ•˜๊ฒŒ ์„ค๋ช…ํ•ด์ค€๋‹ค
-R ์ง€์ •ํ•œ ๋””๋ ‰ํ† ๋ฆฌ์˜ ํ•˜์œ„์— ์žˆ๋Š” ๋ชจ๋“  ํŒŒ์ผ๋„ ํ•จ๊ป˜ ์ง€์ •ํ•œ ๊ทธ๋ฃน์œผ๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค.

 

300x250

์ฝ”๋“œ