zoukankan      html  css  js  c++  java
  • mac nginx+ci ,lumen等网页开发环境配置

    mac下搭建 lumen ci环境

    mac基本配置,如php、redis、mysql、vim、chrome等软件安装这里不详细说明。

    1、设置/ete/hosts:

    把要访问的域名绑定到本地的端口

    这样能保证我们登陆域名的时候,可以重定向到本地。

    127.0.0.1       mobile.ymt360.com

    127.0.0.1       my-uc-test.ymt360.com

    127.0.0.1       localhost

    255.255.255.255 broadcasthost

    ::1             localhost

    ~                         

     

    2、nginx配置。

      安装nginx不细讲,mac  可用brew install 主要讲配置(域名引用到对应的文件目录)

       1、先在nginx.conf 里面配置一个include servers/*

       2、在servers里面自己新建一个*.conf ,如mobile.conf

    配置server

    server {

        listen 80;

        server_name mobile.ymt360.com;

        index index.php;

        root /data/www/website/mobile/public;

        access_log  /data/nginxlogs/mobile.ymt360.com.log;

        error_log /data/nginxlogs/mobile.ymt360.com.error;

        client_max_body_size 12m;

        error_page 502 /502.html;

     

        location / {

            index index.php;

            if (!-e $request_filename) {

                rewrite ^/(.+)$ /index.php/$1 last;

            }

        }

     

        location ~ ^/index.php {

            set $path_info "";

            set $real_script_name $fastcgi_script_name;

            if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {

                set $real_script_name $1;

                set $path_info $2;

            }

            charset utf-8;

            fastcgi_param PATH_INFO $path_info;

            include fastcgi.conf;

        }

     

        location ~ .*.php$ {

            deny all;

        }

    }

     

     

    3.  php-fastcgi配置

        主要配置 fastcgi.conf

         find / -name 找到 fastcgi.conf  在里面找到fastcgi_path把通信端口改成127.0.0.1:9000

        这里路径用9000端口

     4.php-pfm.conf 配置,可参考原环境自行配置。如uc-test。

    PS

       如果出现直接把index.php页面下载下来了,那么就在nginx.conf里面include fastcgi.conf里面包含了fastcpg路径。

        

     

  • 相关阅读:
    SpringCloud高可用和高并发
    时间重要性,我们需要如何利用极致
    Spring是什么 包括SpringBean SpringMVC SpringBoot SpringCloud
    Java 线程的基本使用
    JVM 内存模型
    Java 8 ArrayList 详解
    Java 8 HashMap 源码解析
    Docker 运行 MySQL,使用 docker-compose
    Spring Boot 主从读写分离
    Spring Boot 整合 MyBatis 实现乐观锁和悲观锁
  • 原文地址:https://www.cnblogs.com/zhezhong/p/5590443.html
Copyright © 2011-2022 走看看