阿里云 ecs 配置 typecho wordpress多站点

来源:互联网 发布:python 声明 日期 编辑:程序博客网 时间:2024/05/21 22:44


1.cd /alidata/www/ 放typecho安装包  chmod 755

2.cd /alidata/server/nginx/conf/vhost/    vim  typecho.conf

server {
        listen       80;                         //端口
        server_name  localhost;     //域名
index index.html index.htm index.php;
root /alidata/www/typecho;    //typecho 安装目录
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#α¾²̬¹畲
include /alidata/server/nginx/conf/rewrite/typecho.conf; //伪静态规则
access_log  /alidata/log/nginx/access/typecho.log;              //日志
}

cd /alidata/server/nginx/conf/rewrite  vim typecho.conf

location / { 
        index index.html index.php; 
        if (-f $request_filename/index.html){ 
            rewrite (.*) $1/index.html break; 
        } 
        if (-f $request_filename/index.php){ 
            rewrite (.*) $1/index.php; 
        } 
        if (!-f $request_filename){ 
            rewrite (.*) /index.php; 
        } 
}


然后 重启nginx

 /alidata/server/nginx/sbin/nginx -s reload


多站点 很简单

server_name 写不同的域名即可

0 0