• 第五篇 Nginx的简单配置


    先安装:

    sudo apt-get install nginx php5-fpm

    我是在新安装的Ubuntu13上测试通过的,真的只安装这两个东西就够了。

    然后编辑配置文件。

    sudo gedit /etc/nginx/site-available/default

    找到location ~ .php$的地方,5行取消注释,变成这样:

    [plain] view plaincopy在CODE上查看代码片派生到我的代码片
     
    1. location ~ .php$ {  
    2. #   fastcgi_split_path_info ^(.+.php)(/.+)$;  
    3. #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini  
    4. #  
    5. #   # With php5-cgi alone:  
    6. #   fastcgi_pass 127.0.0.1:9000;  
    7. #   # With php5-fpm:  
    8.     fastcgi_pass unix:/var/run/php5-fpm.sock;  
    9.     fastcgi_index index.php;  
    10.     include fastcgi_params;  
    11. }  

    这就成了!

    启动nginx:

    sudo service nginx start

    扩展:

    1. default文件中,找到
    index index.html index.htm;

    这行,加入成

    index index.html index.htm index.php;

    这就可以用php文件做默认主页

    本博客的所有博文,大都来自自己的工作实践。希望对大家有用,欢迎大家交流和学习。 我的新站:www.huishougo.com
  • 相关阅读:
    python学习-3 字典
    python学习-3
    python学习-3
    python学习日记-2
    python学习日记
    FTP文件传输
    unity实现截屏功能
    使用C++来写数据库
    background使用
    一张图说明DIV盒子距离
  • 原文地址:https://www.cnblogs.com/zhouqingda/p/5087191.html
Copyright © 2020-2023  润新知