标签:
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不细讲,主要讲配置(域名引用到对应的文件目录)
1、配置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;
}
}
php-fastcgi配置
这里路径用9000端口
标签:
原文地址:http://www.cnblogs.com/zhezhong/p/5590443.html