zoukankan      html  css  js  c++  java
  • apt-get方式安装lnmp环境

    安装nginx
    sudo apt-get install nginx
    安装php和mysql
    sudo apt-get install php5-cli php5-cgi php5-curl php5-mysql php5-fpm mysql-server

    修改nginx配置文件
    /etc/nginx/nginx.conf

    添加 /etc/nginx/vhost/localhost.conf 文件
    server {
            listen 80;
            server_name localhost; #绑定域名
            index index.htm index.html index.php; #默认文件
            root /data/webroot; #网站根目录
            location ~ .php$ {
                    fastcgi_pass 127.0.0.1:9000;
                    fastcgi_index index.php;
                    include fastcgi_params;
            }
            access_log /data/logs/access.log;
            error_log /data/logs/error.log;
    }
    server {
            listen 80;
            server_name test.localhost; #绑定域名
            index index.htm index.html index.php; #默认文件
            root /data/webroot/testRoot; #网站根目录
                    location ~ .php$ {
                            fastcgi_pass 127.0.0.1:9000;
                            fastcgi_index index.php;
                            include fastcgi_params;
            }
            access_log /data/logs/test_access.log;
            error_log /data/logs/test_error.log;
    }

    检查nginx配置

    sudo /usr/sbin/nginx -t

    重启nginx

    sudo /usr/sbin/nginx -s reload

    启动php-cgi

    php-cgi -b 127.0.0.1:9000


  • 相关阅读:
    6-1面向对象
    5-1模块
    python随机数
    4-5目录
    4-4内置函数
    4-3迭代器和生成器
    4-1装饰器1
    4-2装饰器2
    3-4函数-全局变量
    3-5递归-函数
  • 原文地址:https://www.cnblogs.com/wangkongming/p/4622673.html
Copyright © 2011-2022 走看看