美文网首页
ArhLinux配置Tomcat + Nginx

ArhLinux配置Tomcat + Nginx

作者: ArcherWong | 来源:发表于2016-07-31 19:48 被阅读0次

    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;  
          }
        }
    
    参考文章

    相关文章

      网友评论

          本文标题:ArhLinux配置Tomcat + Nginx

          本文链接:https://www.haomeiwen.com/subject/hpqxsttx.html