ubuntu 12.04 安装测试nginx
2014-08-08 15:19
381 查看
For online documentation and support please refer to nginx.org.
Commercial support is available at
nginx.com.
安装参考:installing nginx
测试:
1. 按照Beginner's Guide的serving static content,写出了一个nginx.conf(可以放到/usr/local/nginx/conf下,或在这个目录下链接到conf文件):
然后在任意文件夹下创建data/www和data/images文件夹(www下需要创建index.html,否则404),再在nginx安装目录(默认/usr/local/nginx)下创建到这个data的链接。
2. 在Setting Up a Simple Proxy Server中,配置了一个反向代理,将localhost 8080端口的转向访问80端口;并利用正则表达式地位图片文件:
在data文件夹下创建新文件夹upl,并copy index.html。
3. Setting up FastCGI Proxying,首先参看:
1)what is CGI和 what
is FastCGI ,FastCGI。重要的区别:Instead of creating a new process for each request, FastCGI uses persistent
processes to handle a series of requests. These processes are owned by the FastCGI server, not the web server.
2)nginx不支持CGI(不能直接实现一个脚本的执行),支持FastCGI,但需要另外搭建一个FastCGI server,比如流行的PHP环境:实战Nginx与PHP(FastCGI)的安装、配置与优化。也可以搭建perl-fcgi,复杂些:perl
+ fastcgi + nginx搭建。其他C/C++,Python,Lisp都可以类似搭建。
Commercial support is available at
nginx.com.
安装参考:installing nginx
测试:
1. 按照Beginner's Guide的serving static content,写出了一个nginx.conf(可以放到/usr/local/nginx/conf下,或在这个目录下链接到conf文件):
events { # 不能省,否则报错 } http { server { location / { root data/www; # 此处不能是“/data/www”,下同 index index.html; # 可以不加此句,因为默认如此 } location /images/ { # nginx采用最长匹配原则 root data; index yq.jpg; # 这个无效,似乎nginx不能将index设为非页面文件。但不报错 } } }
然后在任意文件夹下创建data/www和data/images文件夹(www下需要创建index.html,否则404),再在nginx安装目录(默认/usr/local/nginx)下创建到这个data的链接。
2. 在Setting Up a Simple Proxy Server中,配置了一个反向代理,将localhost 8080端口的转向访问80端口;并利用正则表达式地位图片文件:
events { } http { server { location / { proxy_pass http://localhost:8080; } location ~ \.(gif|jpg|png)$ { # 正则表达式前要加~,注意空格 root data/images; } } server { listen 8080; root data/upl; location / { } } }
在data文件夹下创建新文件夹upl,并copy index.html。
3. Setting up FastCGI Proxying,首先参看:
1)what is CGI和 what
is FastCGI ,FastCGI。重要的区别:Instead of creating a new process for each request, FastCGI uses persistent
processes to handle a series of requests. These processes are owned by the FastCGI server, not the web server.
2)nginx不支持CGI(不能直接实现一个脚本的执行),支持FastCGI,但需要另外搭建一个FastCGI server,比如流行的PHP环境:实战Nginx与PHP(FastCGI)的安装、配置与优化。也可以搭建perl-fcgi,复杂些:perl
+ fastcgi + nginx搭建。其他C/C++,Python,Lisp都可以类似搭建。
相关文章推荐
- ubuntu 12.04 编译安装nginx,php,mysql
- ubuntu 12.04 下nginx安装步骤
- ubuntu 12.04 编译安装 nginx
- 【精选】Ubuntu 14.04 安装Nginx、php5-fpm、ThinkPHP5.0(已经测试上线)
- ubuntu 12.04 LTS下安装phpunit测试环境
- Linux(Ubuntu 12.04)源码编译安装gcc-4.9.1(方法一)——亲自测试通过
- 在Ubuntu 14.04 上安装 Nginx-RTMP 流媒体服务器,并Android真机测试
- ubuntu 12.04 server 安装nginx
- ubuntu 12.04安装部署环境nginx,tomcat,mysql以及开机启动备忘
- Ubuntu 12.04 LTS 安装 Nginx 1.6.0
- Ubuntu 12.04上安装Nginx, PHP,Mysql及配置
- ubuntu 12.04 下nginx安装步骤
- centos 6.2 ubuntu 12.04 上安装apache(httpd2.4) nginx1.2 php5.3.10 mysql5.3
- Ubuntu 12.04 安装最新版本的Nginx
- 如何在Ubuntu 12.04 LTS上安装nginx?
- Ubuntu 12.04 Nginx 安装记录
- ROS 在ubuntu 12.04 下的安装及测试
- Gstreamer学习历程(一):Ubuntu 12.04安装Gstreamer开发环境并测试
- ubuntu 12.04 server编译安装nginx
- [今日记录] PHP安装 & wordpress部署, Nginx 1.7.3, Ubuntu 12.04