[JAVA] SCP transfer War file to Tomcat

Tomcat folder permission settings

Last time, I was able to install Tomcat on my VPS, so when I tried to export and deploy a War file like Hello World in Eclipse, I stumbled a bit.

/opt/tomcat/webapps/

I should be able to do it just by scpping directly under it, but I was told that permission was denied.

When I checked the authority, it was only reading other than root, so

cd /opt/tomcat
chmod -R 766 webapps

You can go with this because you just specify and start over and write it, right? I thought, but permission denied. why?

So, let's add the tomcat group attribute to the user account. permission denied.

・ ・ Hmm? ?? Ah, maybe the programmer just copies it, but it's automatically unzipped, and the person who copies it also has execute permission?

so,

cd /opt/tomcat
chmod -R 777 webapps

When I tried it, I was able to copy it safely, and even when I accessed it with a browser, it worked fine.

However, as it is, anyone can write to this folder, so I wonder if I should set the deploy user of the application to the tomcat group and set it to 770.

Supplement

Since tomcat has a mechanism to deploy with a web console, it seems better to set it and start from there. I tried it, but I couldn't enter it with 403 because the setting part was not enough, so I deployed it with SCP for the time being.

Recommended Posts

SCP transfer War file to Tomcat
To manually deploy Struts2 as a war file
Access the war file in the root directory of Tomcat
Port tomcat to MAMP
How to download a file (Servlet, HTML, Apache, Tomcat)
Create a Java Servlet and JSP WAR file to deploy to Apache Tomcat 9 in Gradle
Output javadoc to word file
Introduce Maven to Tomcat project
Output XML tree to file
How to create a jar file or war file using the jar command
Fix the file name of war to the one set in Maven