How to change the user tomcat runs, to www-data?
I tried the same thing as How to run tomcat6 on ubuntu as root? but it doesnt cause any changes.
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Here is how I just did it with tomcat6 installed..
I first stopped tomcat from running
Changed the following in
To be the following
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the # default of tomcat6. TOMCAT6_USER=www-data # Run Tomcat as this group ID. Not setting this or leaving it blank will use # the default of tomcat6. TOMCAT6_GROUP=www-data
Then I had to change ownership of the log directory
chown -R www-data: /var/log/tomcat6 chown -R www-data: /usr/lib/tomcat6 chown -R www-data: /etc/tomcat6
Then I was able to run tomcat6
See the results
# ps aux | grep tomcat www-data 26436 11.3 0.7 559552 58464 ? Sl 05:34 0:01 /usr/lib/jvm/java-6-openjdk/bin/java -Djava.util.logging.config.file=/var/lib/tomcat6/conf/logging.properties -Djava.awt.headless=true -Xmx128M -XX:+UseConcMarkSweepGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/share/tomcat6/endorsed -classpath /usr/share/tomcat6/bin/bootstrap.jar -Dcatalina.base=/var/lib/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.io.tmpdir=/tmp/tomcat6-tmp org.apache.catalina.startup.Bootstrap start