1. 安裝Tomcat8
pacman -S tomcat8
2. 配置tomcat-users.xml
nano /etc/tomcat8/tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="tomcat, admin-gui,manager-gui"/>
</tomcat-users>
3. 測試Tomcat8
在瀏覽器中輸入http://localhost:8080
4. 安裝Nginx
pacman -S nginx
5. 配置nginx.conf
upstream local_tomcat {
server localhost:8080;
}
server{
location / {
proxy_pass http://local_tomcat;
}
}