我刚刚在Ubuntu 14.04 LTE上安装了Tomcat 9,当我运行sudo service tomcat start
,然后使用sudo service tomcat status
检查状态时,我获得状态:tomcat stop waiting
。
当我在8080端口访问localhost时,我得到Unable to connect
,即看起来服务器没有运行。
我按照https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-14-04上的教程使用了Tomcat 9文件而不是Tomcat 8。
这是我安装的方式: (所有命令都没有错误地执行)
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
cd ~
wget http://apache.mirror.serversaustralia.com.au/tomcat/tomcat-9/v9.0.0.M10/bin/apache-tomcat-9.0.0.M10.tar.gz
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
sudo chgrp -R tomcat conf
sudo chmod g+rwx conf
sudo chmod g+r conf/*
sudo chown -R tomcat work/ temp/ logs/
// set $JAVA_HOME in /etc/init/tomcat.conf: JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre"
// set in /etc/init/tomcat.conf: env CATALINA_OPTS="-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
sudo initctl reload-configuration
sudo initctl start tomcat
/ opt / tomcat的目录列表:
问题1:是否存在文件夹访问权限部分为root
并且只有部分文件夹用于tomcat
用户的问题?我完全按照步骤创建了tomcat用户并根据教程设置了权限。
vagrant@vagrant:/opt/tomcat$ ll
total 120
drwxr-xr-x 9 root root 4096 Sep 6 10:03 ./
drwxr-xr-x 4 root root 4096 Sep 6 10:02 ../
drwxr-x--- 2 root root 4096 Sep 6 10:03 bin/
drwxrwx--- 2 root tomcat 4096 Aug 31 15:02 conf/
drwxr-x--- 2 root root 4096 Sep 6 10:03 lib/
-rw-r----- 1 root root 57092 Aug 31 15:02 LICENSE
drwxr-x--- 2 tomcat root 4096 Aug 31 15:00 logs/
-rw-r----- 1 root root 1804 Aug 31 15:02 NOTICE
-rw-r----- 1 root root 6709 Aug 31 15:02 RELEASE-NOTES
-rw-r----- 1 root root 15946 Aug 31 15:02 RUNNING.txt
drwxr-x--- 2 tomcat root 4096 Sep 6 10:07 temp/
drwxr-x--- 7 root root 4096 Aug 31 15:01 webapps/
drwxr-x--- 2 tomcat root 4096 Aug 31 15:00 work/
我的/etc/init/tomcat.conf的内容:
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid tomcat
setgid tomcat
env JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
env CATALINA_HOME=/opt/tomcat
# Modify these options as needed
env JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urand$
env CATALINA_OPTS="-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
exec $CATALINA_HOME/bin/catalina.sh run
# cleanup temp directory after stop
post-stop script
rm -rf $CATALINA_HOME/temp/*
end script
我$JAVA_HOME
的目录列表:
vagrant@vagrant:/opt/tomcat$ ll /usr/lib/jvm/java-8-openjdk-amd64
total 28
drwxr-xr-x 7 root root 4096 Sep 5 10:36 ./
drwxr-xr-x 3 root root 4096 Sep 5 10:36 ../
lrwxrwxrwx 1 root root 22 Apr 22 13:29 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4096 Sep 5 10:36 bin/
lrwxrwxrwx 1 root root 41 Apr 22 13:29 docs -> ../../../share/doc/openjdk-8-jre-headless/
drwxr-xr-x 3 root root 4096 Sep 5 10:36 include/
drwxr-xr-x 5 root root 4096 Sep 5 10:36 jre/
drwxr-xr-x 3 root root 4096 Sep 5 10:36 lib/
drwxr-xr-x 4 root root 4096 Sep 5 10:36 man/
lrwxrwxrwx 1 root root 20 Apr 22 13:29 src.zip -> ../openjdk-8/src.zip
lrwxrwxrwx 1 root root 22 Apr 22 13:29 THIRD_PARTY_README -> jre/THIRD_PARTY_README
vagrant@vagrant:/opt/tomcat$
检查tomcat是否正在运行:
vagrant@vagrant:/opt/tomcat$ ps a | grep java
5724 pts/0 S+ 0:00 grep --color=auto java
vagrant@vagrant:/opt/tomcat$
vagrant@vagrant:/opt/tomcat$ ps -ef | grep tomcat
vagrant 5888 1277 0 10:41 pts/0 00:00:00 grep --color=auto tomcat
vagrant@vagrant:/opt/tomcat$
尝试访问日志(空):
root@vagrant:/opt/tomcat/logs# ll
total 8
drwxr-x--- 2 tomcat root 4096 Aug 31 15:00 ./
drwxr-xr-x 9 root root 4096 Sep 6 11:05 ../
root@vagrant:/opt/tomcat/logs# exit
logout
vagrant@vagrant:/opt/tomcat$
日志:
vagrant@vagrant:/opt/tomcat$ ll /var/log/
total 1652
drwxrwxr-x 10 root syslog 4096 Sep 6 11:04 ./
drwxr-xr-x 12 root root 4096 Sep 5 10:42 ../
-rw-r--r-- 1 root root 36983 Sep 5 11:29 alternatives.log
drwxr-x--- 2 root adm 4096 Sep 5 10:42 apache2/
drwxr-xr-x 2 root root 4096 Aug 1 15:48 apt/
-rw-r----- 1 syslog adm 37452 Sep 6 12:17 auth.log
-rw-r--r-- 1 root root 3851 Sep 5 10:41 boot.log
-rw-r--r-- 1 root root 61499 Jul 22 2014 bootstrap.log
-rw-rw---- 1 root utmp 0 Jul 22 2014 btmp
drwxr-xr-x 2 root root 4096 Apr 12 2014 dist-upgrade/
-rw-r----- 1 root adm 30426 Sep 5 10:41 dmesg
-rw-r----- 1 root adm 30966 Sep 5 05:31 dmesg.0
-rw-r----- 1 root adm 9701 Aug 1 15:53 dmesg.1.gz
-rw-r----- 1 root adm 9649 Aug 1 15:51 dmesg.2.gz
-rw-r----- 1 root adm 59 Jul 22 2014 dmesg.3.gz
-rw-r--r-- 1 root root 731982 Sep 6 11:04 dpkg.log
-rw-r--r-- 1 root root 32032 Sep 6 11:03 faillog
-rw-r--r-- 1 root root 644 Sep 5 10:36 fontconfig.log
drwxr-xr-x 2 root root 4096 Aug 1 15:48 fsck/
drwxr-xr-x 3 root root 4096 Aug 1 15:51 installer/
-rw-r----- 1 syslog adm 183208 Sep 6 11:04 kern.log
-rw-rw-r-- 1 root utmp 292292 Sep 6 11:03 lastlog
drwxr-s--- 2 mysql adm 4096 Sep 6 11:04 mysql/
-rw-r----- 1 mysql adm 0 Sep 6 11:04 mysql.err
-rw-r----- 1 mysql adm 0 Sep 6 11:04 mysql.log
-rw-r----- 1 syslog adm 225676 Sep 6 12:17 syslog
-rw-r--r-- 1 root root 146938 Sep 5 10:41 udev
drwxr-xr-x 2 root root 4096 Sep 5 10:40 unattended-upgrades/
drwxr-xr-x 2 root root 4096 Sep 6 11:04 upstart/
-rw-r--r-- 1 root root 1200 Sep 5 05:36 vboxadd-install.log
-rw-r--r-- 1 root root 73 Sep 5 05:36 vboxadd-install-x11.log
-rw-r--r-- 1 root root 1 Sep 5 05:35 VBoxGuestAdditions.log
-rw-r--r-- 1 root root 404 Sep 5 05:35 VBoxGuestAdditions-uninstall.log
-rw-rw-r-- 1 root utmp 22656 Sep 5 10:41 wtmp
vagrant@vagrant:/opt/tomcat$
日志:
vagrant@vagrant:/var/log$ grep -r 'tomcat' .
grep: ./upstart/network-interface-eth0.log: Permission denied
grep: ./upstart/network-interface-lo.log: Permission denied
grep: ./upstart/tomcat.log: Permission denied
grep: ./upstart/kmod.log: Permission denied
grep: ./upstart/systemd-logind.log: Permission denied
grep: ./upstart/mountall.log: Permission denied
grep: ./upstart/console-setup.log: Permission denied
grep: ./upstart/ureadahead.log: Permission denied
grep: ./upstart/mysql.log: Permission denied
grep: ./upstart/networking.log: Permission denied
grep: ./upstart/cryptdisks.log: Permission denied
grep: ./upstart/ureadahead-other.log: Permission denied
grep: ./upstart/gssd.log: Permission denied
grep: ./upstart/statd.log: Permission denied
grep: ./upstart/container-detect.log: Permission denied
grep: ./upstart/procps-virtual-filesystems.log: Permission denied
grep: ./upstart/procps-static-network-up.log: Permission denied
grep: ./upstart/procps.log: Permission denied
grep: ./upstart/rsyslog.log: Permission denied
grep: ./btmp: Permission denied
grep: ./installer/syslog: Permission denied
grep: ./installer/cdebconf/templates.dat: Permission denied
grep: ./installer/cdebconf/questions.dat: Permission denied
grep: ./installer/partman: Permission denied
./syslog:Sep 6 10:05:21 vagrant kernel: [35222.566154] init: /etc/init/tomcat.conf:1: Unknown stanza
./syslog:Sep 6 10:05:39 vagrant kernel: [35241.249677] init: /etc/init/tomcat.conf:1: Unknown stanza
./syslog:Sep 6 10:05:50 vagrant kernel: [35252.042988] init: /etc/init/tomcat.conf:1: Unknown stanza
./syslog:Sep 6 10:06:23 vagrant kernel: [35285.181441] init: /etc/init/tomcat.conf:1: Unknown stanza
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.204413] init: tomcat main process (5583) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.204420] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.213247] init: tomcat main process (5587) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.213254] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.224530] init: tomcat main process (5591) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.224537] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.232944] init: tomcat main process (5595) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.232951] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.240516] init: tomcat main process (5599) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.240524] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.249047] init: tomcat main process (5603) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.249055] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.256800] init: tomcat main process (5607) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.256807] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.264498] init: tomcat main process (5611) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.264526] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.272763] init: tomcat main process (5615) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.272770] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.280498] init: tomcat main process (5619) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.280506] init: tomcat main process ended, respawning
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.288651] init: tomcat main process (5623) terminated with status 126
./syslog:Sep 6 10:07:26 vagrant kernel: [35348.288659] init: tomcat respawning too fast, stopped
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.039889] init: tomcat main process (5654) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.039896] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.048627] init: tomcat main process (5658) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.048634] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.059579] init: tomcat main process (5662) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.059589] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.082366] init: tomcat main process (5666) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.082374] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.090163] init: tomcat main process (5670) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.090170] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.098647] init: tomcat main process (5674) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.098679] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.106639] init: tomcat main process (5678) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.106647] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.114743] init: tomcat main process (5682) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.114750] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.122404] init: tomcat main process (5686) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.122412] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.130457] init: tomcat main process (5690) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.130465] init: tomcat main process ended, respawning
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.138334] init: tomcat main process (5694) terminated with status 126
./syslog:Sep 6 10:24:09 vagrant kernel: [36351.138342] init: tomcat respawning too fast, stopped
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.764611] init: tomcat main process (5739) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.764619] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.773177] init: tomcat main process (5743) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.773184] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.786655] init: tomcat main process (5747) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.786663] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.794639] init: tomcat main process (5751) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.794646] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.802876] init: tomcat main process (5755) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.802884] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.810681] init: tomcat main process (5759) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.810689] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.818391] init: tomcat main process (5763) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.818430] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.826874] init: tomcat main process (5767) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.826882] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.834979] init: tomcat main process (5771) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.834986] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.843036] init: tomcat main process (5775) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.843044] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.850948] init: tomcat main process (5779) terminated with status 126
./syslog:Sep 6 10:38:41 vagrant kernel: [37222.850955] init: tomcat respawning too fast, stopped
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.342798] init: tomcat main process (5792) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.342805] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.351367] init: tomcat main process (5796) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.351374] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.364019] init: tomcat main process (5800) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.364026] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.371726] init: tomcat main process (5804) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.371734] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.379759] init: tomcat main process (5808) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.379768] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.387833] init: tomcat main process (5812) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.387842] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.396662] init: tomcat main process (5816) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.396673] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.408969] init: tomcat main process (5820) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.408978] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.418558] init: tomcat main process (5824) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.418567] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.437261] init: tomcat main process (5828) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.437269] init: tomcat main process ended, respawning
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.445168] init: tomcat main process (5832) terminated with status 126
./syslog:Sep 6 10:38:51 vagrant kernel: [37233.445175] init: tomcat respawning too fast, stopped
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.520457] init: tomcat main process (5842) terminated with status 126
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.520465] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.529569] init: tomcat main process (5846) terminated with status 126
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.529577] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.539636] init: tomcat main process (5850) terminated with status 126
./syslog:Sep 6 10:40:25 vagrant kernel: [37327.539643] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.549262] init: tomcat main process (5854) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.549270] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.557038] init: tomcat main process (5858) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.557046] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.565248] init: tomcat main process (5862) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.565262] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.574053] init: tomcat main process (5866) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.574061] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.582124] init: tomcat main process (5870) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.582132] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.590571] init: tomcat main process (5874) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.590579] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.598389] init: tomcat main process (5878) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.598397] init: tomcat main process ended, respawning
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.606201] init: tomcat main process (5882) terminated with status 126
./syslog:Sep 6 10:40:26 vagrant kernel: [37327.606208] init: tomcat respawning too fast, stopped
./auth.log:Sep 6 09:41:00 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/usr/sbin/groupadd tomcat
./auth.log:Sep 6 09:41:01 vagrant groupadd[5547]: group added to /etc/group: name=tomcat, GID=1000
./auth.log:Sep 6 09:41:01 vagrant groupadd[5547]: group added to /etc/gshadow: name=tomcat
./auth.log:Sep 6 09:41:01 vagrant groupadd[5547]: new group: name=tomcat, GID=1000
./auth.log:Sep 6 09:41:09 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/usr/sbin/useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
./auth.log:Sep 6 09:41:09 vagrant useradd[5552]: new user: name=tomcat, UID=1000, GID=1000, home=/opt/tomcat, shell=/bin/false
./auth.log:Sep 6 10:02:51 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/mkdir /opt/tomcat
./auth.log:Sep 6 10:03:18 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/tar xvf apache-tomcat-9.0.0.M10.tar.gz -C /opt/tomcat --strip-components=1
./auth.log:Sep 6 10:03:31 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chgrp -R tomcat conf
./auth.log:Sep 6 10:03:37 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chmod g+rwx conf
./auth.log:Sep 6 10:03:42 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chmod g+r conf/*
./auth.log:Sep 6 10:03:56 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chown -R tomcat work/ temp/ logs/
./auth.log:Sep 6 10:05:06 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/nano /etc/init/tomcat.conf
./auth.log:Sep 6 10:05:39 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/nano /etc/init/tomcat.conf
./auth.log:Sep 6 10:06:23 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/nano /etc/init/tomcat.conf
./auth.log:Sep 6 10:07:21 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/sbin/initctl reload-configuration
./auth.log:Sep 6 10:07:26 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/sbin/initctl start tomcat
./auth.log:Sep 6 10:23:58 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat7 status
./auth.log:Sep 6 10:24:03 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat status
./auth.log:Sep 6 10:24:09 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat start
./auth.log:Sep 6 10:24:37 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat status
./auth.log:Sep 6 10:28:32 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat status
./auth.log:Sep 6 10:31:22 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/nano /etc/init/tomcat.conf
./auth.log:Sep 6 10:38:33 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat stop
./auth.log:Sep 6 10:38:41 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat start
./auth.log:Sep 6 10:38:51 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/sbin/service tomcat restart
./auth.log:Sep 6 10:40:18 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/sbin/initctl reload-configuration
./auth.log:Sep 6 10:40:25 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/sbin/initctl start tomcat
./auth.log:Sep 6 10:56:48 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/apt-get update
./auth.log:Sep 6 10:57:28 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/apt-get install -y mysql-server
./auth.log:Sep 6 11:04:44 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/mysql_secure_installation
./auth.log:Sep 6 11:05:14 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/usr/bin/mysql_install_db
./auth.log:Sep 6 11:05:43 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/etc/init.d/mysql start
./auth.log:Sep 6 12:11:39 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chown root:root logs/
./auth.log:Sep 6 12:11:55 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/chown tomcat:root logs/
./auth.log:Sep 6 12:12:58 vagrant sudo: vagrant : TTY=pts/0 ; PWD=/opt/tomcat ; USER=root ; COMMAND=/bin/bash
vagrant@vagrant:/var/log$
答案 0 :(得分:6)
试试这个:
cd /opt
sudo chown -R tomcat:tomcat tomcat/
我有同样的问题,现在tomcat开始很好:)