zoukankan      html  css  js  c++  java
  • linux下安装nginx+php

    参考:http://blog.csdn.net/ihelloworld/article/details/7029796

    http://blog.chinaunix.net/uid-21374062-id-2951960.html
    http://www.cnblogs.com/mchina/archive/2012/05/17/2507102.html
    http://blog.sina.com.cn/s/blog_505bf9af010137gf.html

    安装php:
    yum install libxml2
    yum install libxml2-devel -y
    yum -y install freetype freetype-devel
    yum -y install pcre*

    1. 下载 php-5.2.13.tar.gz 和 php-5.2.13-fpm-0.5.13.diff.gz
    2. 安装
    # tar zxvf php-5.2.13.tar.gz
    # gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1
    # cd php-5.2.13
    # ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --with-mysql=/usr/local/mysql
    # make
    # make install
    # cp php.ini-dist /usr/local/lib/php.ini
    启动php-cgi:
    /usr/local/php/sbin/php-fpm start

    1 安装nginx
    #tar -zxvf nginx-0.8.33.tar.gz
    #cd nginx-0.8.33
    #./configure --prefix=/usr/local/nginx

    (安装Nginx时报错
    ./configure: error: the HTTP rewrite module requires the PCRE library.
    执行安装下面的yum
    )

    #yum -y install openssl openssl-devel
    #yum -y install pcre-devel openssl openssl-devel

    #./configure --prefix=/usr/local/nginx
    #make
    #make install

    修改nginx.conf配置文件:
    server {
    listen 80;
    server_name testlink.conversant.com.cn;
    location / {
    root /usr/local/nginx/html;
    index index.php index.html index.htm;
    }
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ .php$ {
    root /usr/local/nginx/html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
    fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
    include fastcgi_params;
    }
    }

    3
    启动php-cgi:/usr/local/php/sbin/php-fpm start

    (报错: (没有分组什么的...)
    修改php-fpm.conf, 放开注释
    <!-- <value name="user">nobody</value> -->
    <!-- <value name="group">nobody</value> -->
    )
    4 启动nginx
    /usr/local/nginx/sbin/nginx start
    或者
    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

    5 关闭防火墙
    1)永久性生效,重启后不会复原
    开启: chkconfig iptables on 关闭: chkconfig iptables off
    2)即时生效,重启后复原
    开启: service iptables start 关闭: service iptables stop
    3)查看防火墙状态
    chkconfig iptables --list
    [@more@]

  • 相关阅读:
    Django简介和安装
    CVE-2011-0104:Microsoft Office Excel 中的栈溢出漏洞调试分析
    Struts2漏洞
    JSONP跨域资源共享的安全问题
    如何以最简单的方式安装 KALI 渗透测试框架系统
    CVE-2010-3333:Microsoft RTF 栈溢出漏洞调试分析
    CVE-2010-2883:基于样本分析 PDF SING表字符溢出漏洞
    针对缓冲区保护技术(ASLR)的一次初探
    利用 ROP 技术绕过 DEP 保护的一次简单尝试
    缓冲区溢出之栈溢出利用(手动编写无 payload 的 Exploit)
  • 原文地址:https://www.cnblogs.com/xiaozhuan/p/6040500.html
Copyright © 2011-2022 走看看