Debian 7.1 下配置各种WEB环境
来源:互联网 发布:编程笔记本配置要求 编辑:程序博客网 时间:2024/05/18 02:01
一、NGINX
(一)发布NODEJS示例:
1、在/etc/nginx/conf.d目录下,新建站点名配置,如:sitename.conf
2、在sitename.conf加入如下内容:
server {
listen 80;
server_name sitename.com www.sitename.com;
location / {
root html;
index index.html;
proxy_pass http://127.0.0.1:8070; ##nodejs的端口
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
}
(二)发布jsp示例:
同(一)发布NODEJS示例
(三)发布php5示例:
1、将/etc/php5/fpm/pool.d目录的www.conf文件listen = /var/run/php5-fpm.sock替换listen = 127.0.0.1:9000(端口号自定义)
2、在/etc/nginx/conf.d目录下,新建站点名配置,如:sitename.conf
3、在sitename.conf加入如下内容:
server {
listen 80;
server_name npesp.com www.npesp.com npesp.cn www.npesp.cn;
access_log /var/log/nginx/npesp.access.log;
## Default location
location / {
root /home/www;
index index.php;
}
## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
root /home/www;
}
## Parse all .php file in the /var/www directory
location ~ .php$ {
root /home/www;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www$fastcgi_script_name;
include fastcgi_params;
}
## Disable viewing .htaccess & .htpassword
location ~ /\.ht {
deny all;
}
}
- Debian 7.1 下配置各种WEB环境
- Debian下配置LAMP环境
- Debian 7.1 安装各种运行环境
- Debian下安装配置Java环境
- Debian环境下apache2配置mod_perl
- debian系统下配置爬虫环境
- Java Web的各种环境配置
- debian环境配置
- debian 下 php + nginx 环境配置 for wordpress
- Myeclipse下Web环境配置
- linux下web环境配置
- debian下各种垃圾问题
- Linux下各种环境配置(表格)
- Debian 下MySQL配置
- debian 下配置SVN
- debian下配置网卡
- Debian下scim配置
- Debian下配置OpenGL
- k均值聚类(K-means)相异度计算
- 红黑树代码
- apache限制并发数 IP 带宽设置教程
- 安装ttf格式字体
- 用Matlab画柱状图
- Debian 7.1 下配置各种WEB环境
- 报错:toArray 不能转换为 String[]
- POJ 1004(累加)
- HTTP Server 'Bad Gateway' ( Android adt 或者 sdk 更想不了的解决方案)
- 学习网站整理之3——html5学习之简易音乐播放器制作
- Android基础——Activity生命周期
- linux 操作系统的认识
- 快速排序
- rqnoj-117-最佳课题选择-分组背包