1、安装JDK
yum install java-1.8.0-openjdk
2、检测8080端口有没有被占用
netstat -tnlp | grep :8080
3、将上传的jar文件打包成服务
sudo ln -f -s /var/www/html/litemall/litemall.jar /etc/init.d/litemall
service litemall start
4、nginx反向代理
将所有访问www.example.com的请求反向代理到 localhost:8080
server {
listen 443;
server_name www.example.com;
ssl on;
ssl_certificate /etc/nginx/1_www.example.com_bundle.crt;
ssl_certificate_key /etc/nginx/2_www.example.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
4验证
打开浏览器,输入以下地址:
```
https://www.example.com/wx/index/index
https://www.example.com/admin/index/index
https://www.example.com/admin/index/index
```
此时,看到后端数据说明反向代理配置成功。