静安8280 发表于 2016-4-24 14:00:57

jetty+nginx在ubuntu上的配置


[*]下载编译安装nginx  sudo apt-get install nginx 安装

[*]下载jetty到当前目录  

wget http://dist.codehaus.org/jetty/jetty-6.1.20/jetty-6.1.20.zip
unzip *.zip




  至此,安装jetty完成,启动jetty

apt/jetty/bin/jetty.sh start



  jetty目录结构如下

* contexts 热部署目录
* etc jetty配置文件目录
* examples jetty示例
* extras jetty可选扩展
* lib 包含jetty所需的jar文件
* LICENSES 就是LICENSES
* modules 子模块
* patches 补丁patches
* pom.xml is jetty的maven2构建文件
* project-website jetty6网站
* README.txt readme.txt
* start.jar is jetty6主程序
* VERSION.txt
* webapps应用路径,发布的引用基本都放这里
* webapps-plus webapps中引用的一些扩展属性



  

[*]在nginx.conf中配置虚拟主机
server {
listen          80;
server_name   yousite.com www.yousite.com;
access_log      /var/log/your_website_log main;
location / {
proxy_pass      http://127.0.0.1:8080;
proxy_redirectoff;
proxy_set_header      Host            $host;
proxy_set_header      X-Real-IP       $remote_addr;
proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
}
}



  重启nginx

/etc/init.d/nginx restart



  

页: [1]
查看完整版本: jetty+nginx在ubuntu上的配置