使用nginx部署Yii 2.0\yii-basic-app-2.0.5

nginx.conf

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
# ‘$status $body_bytes_sent "$http_referer" ‘
# ‘"$http_user_agent" "$http_x_forwarded_for"‘;

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

#root E:/xampp/htdocs/html5/php/yii2-rest-master/rest/web;
root E:/xampp/htdocs/html5/php/yii-basic-app-2.0.5/basic/web;
index index.php;

location / {
try_files $uri $uri/ /index.php?$args;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

}

说明:启动php、nginx之后,使用浏览器访问http://localhost/即可

参考:安装 Yii - Yii 2.0 权威指南 - 文档 - Yii Framework 中文社区

   PHP For Windows/php-5.6.11-Win32-VC11-x64启动脚本

时间: 2024-12-11 11:54:25

使用nginx部署Yii 2.0\yii-basic-app-2.0.5的相关文章

yii-basic-app-2.0.5/basic/config/web.php

<?php $params = require(__DIR__ . '/params.php'); $config = [ 'id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this i

基于Centos7.2的nginx部署

基于Centos7.2的nginx部署 部署背景:使用Nginx作为Tomcat的负载平衡器. 部署步骤: 安装zlib-devel.pcre-devel等依赖包 [[email protected] ~]#  yum install -y gcc gcc-c++ make libtool zlib zlib-devel pcre pcre-devel openssl openssl-devel 注:结合proxy和upstream模块实现后端web负载均衡 结合nginx默认自带的ngx_ht

nginx 部署

nginx服务器部署 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行.Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日.其将源代码以类BSD许可证的形式发布,因它的稳定性.丰富的功能集.示例配置文件和低系统资源的消耗而闻名. 部署环境: 环境系统:red hat 5 内核版本:2.6.18-371.el5 ng

Django+uWSGI+Nginx 部署网站

Django 1.11设置 保证Django在本地调试没有问题: 当然这是前提^_^ 收集静态文件至指定文件夹 Django静态文件设置具体参考:https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/ 在myproject/settings.py中设置静态文件STATIC_URL和STATIC_ROOT设置: 如: STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE

使用nginx部署网站

前面的话 如果服务器只需要放置一个网站程序,解析网站到服务器的网站,网站程序监听80端口就可以了.如果服务器有很多应用,借助nginx不仅可以实现端口的代理,还可以实现负载均衡.本文将详细介绍前端及nodeJS项目在服务器配置时需要用到的nginx配置 安装 [卸载nginx] 在介绍如何安装nginx之前,先要介绍如何卸载nginx.因为nginx不正确的安装,导致无法正常运行,所以需要卸载nginx sudo apt-get remove nginx nginx-common # 卸载删除除

django+uwsgi+nginx部署(非常详细)

django+uwsgi+nginx部署 1.介绍: 在网上看了很多教程,但自己部署了很久都没有成功,这篇博文记录自己所踩过得坑. 2.环境: 1 Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-130-generic x86_64) 3.下载uwsgi以及nginx 1 apt-get install uwsgi 2 apt-get install nginx (注:如果下载异常出现权限问题,在命令前添加sudo) 4.创建Django项目 例如:项目名为mysite

【Nginx】Nginx部署Windows设置80端口

Nginx部署在Windows端口做负载均衡时,配置其监听80端口.Start时会发现无法启动,原因为其80端口已被占用. 即使IIS中关闭全部80端口的网站后访问此80端口出现的是404,而非网络断开连接.可以推断出IIS或相关容器一直监听 导致Nginx无法启动的.通过CMD->netstat -ano | findstr "80"发现PID为4的System进程占用. 目前找到的解决方案是修改注册表,重启服务器可以解决此问题:\HKEY_LOCAL_MACHINE\SYST

CentOS使用nginx部署https服务

nginx安装参考:https://www.cnblogs.com/taiyonghai/p/6728707.html 自签证书生成参考:https://gmd20.github.io/blog/openssl%E7%94%9F%E6%88%90RSA%E5%92%8C%E6%A4%AD%E5%9C%86%E6%9B%B2%E7%BA%BF%E5%8A%A0%E5%AF%86%E5%85%AC%E9%92%A5%E5%AF%86%E9%92%A5%E5%88%9B%E5%BB%BA%E6%A0%

Nginx 部署 Ant Design pro

利用Ant Design pro开发的项目,如何用Nginx部署呢? 第一步:把项目打包,打包命令如下: npm run build 运行完毕会在项目目录下生成dist文件夹. 第二步:想要测试打包好的代码是否可以正常运行,安装serve,如下命令 npm i serve -g serve安装完毕,利用serve运行打包好的代码,运行命令: serve dist 测试完毕,代码可以正常运行. 第三步:用Nginx进行部署. 1.下载Nginx:http://nginx.org/en/downlo