本文主要是介绍阿里云 ecs 配置 typecho wordpress多站点,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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 写不同的域名即可
这篇关于阿里云 ecs 配置 typecho wordpress多站点的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!