Today, I tried to set up tomcat in Ubuntu, because some things were deleted in the middle, and then I wanted to reinstall it.
chmod: cannot access `/etc/tomcat7/tomcat-users.xml‘: No such file or directory
As a result, the installation could not be properly performed. Later, Google found a solution. Original: http://askubuntu.com/questions/228888/installing-tomcat-7-using-apt-get-fails
In fact, some dependency packages are not deleted when you use the built-in apt-GET command to delete them.
Dpkg-L | grep-I <package name> # command to check whether any dependency packages have been deleted dpkg-P <package name> # Delete the dependent packages above
After deletion, you can install it through apt-Get normally.
In addition, do not forget the apt-Get installation method.
1. Download and unzip Tomcat
2. Set Environment Variables
$ echo "export CATALINA_HOME=\"/<YOURPATH>/tomcat7\"" >> ~/.bashrc$ source ~/.bashrc
3. Start and access Tomcat
In the Tomcat directory
cd binsudo ./startup.sh
4. Add a user account
Edit the Tomcat directoryConf/tomcat-users.xml and add according to commentsFor accounts with Manager-Gui and admin-Gui permissions, see:
<Tomcat-users> <User Username = "admin" Password = "admin" roles = "Manager-Gui, admin-Gui"/> </tomcat-users>