-
tomcat服务
项目目录:/usr/local/tomcat(01,02,03…)
配置:
关于自动启动待续
-
nginx 服务(静态页面)
项目目录:/usr/share/nginx/html
配置:/etc/nginx下面的nginx.conf文件
还有一个conf.d下面的:defau.conf文件(include)
server {
#监听端口
listen 80;
#服务名称:www.baidu.com
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
#默认访问
location / {
root /usr/share/nginx/html/XXX/;
index index.html;
}
##XXX项目(localhost/XXX):项目访问的nginx静态页面
###结果是:当你浏览器输入:localhost/XXX时,访问了nginx目录是:/usr/share/nginx/html/XXX/index.html
location /XXX {
root /usr/share/nginx/html;
index /XXX/index.html;
}
##项目后端映射:FileTransfer是后端项目配置的context,这样你设计到的tomcat动态调用就会映射到10010端口
location /FileTransfer/{
proxy_pass http://localhost:10010;
}
##出错处理#####
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}