Drupal部署

编程入门 行业动态 更新时间:2024-10-25 01:21:52

<a href=https://www.elefans.com/category/jswz/34/1721548.html style=Drupal部署"/>

Drupal部署

下载

Download Drupal | Drupal

解压到:xxx/drupal-9.2.9/

配置nginx

location的配置关系到安装的结果是否正确(不正确的情况,页面上的链接路径会多出/index.php/)

server {listen 8080;server_name _;
​root xxx/drupal-9.2.9;index index.html index.htm index.php;
​rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;location / {if (!-e $request_filename){rewrite (.*) /index.php last;}}
​location ~ \.php($|/){#fastcgi_pass    127.0.0.1:9000;fastcgi_index   index.php;fastcgi_pass    unix:/tmp/php-cgi.sock;fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;include         fastcgi_params;}
}

重启nginx后访问:http://xxxx:8080,开始安装。

如果要重新安装,要删除掉xxx/drupal-9.2.9/sites/default/setting.php和数据库。

安装 SMTP 模块

composer require drupal/smtp

参考:SMTP Authentication Support | Drupal

新建站点

参考文档:Multi-site - Sharing the same code base | Multisite Drupal 7 | Drupal Wiki guide on Drupal

此处不采用域名=>目录的对应方式(具体可参考官方文档),使用sites.php来建立对应关系。

在xxx/drupal-9.2.9/sites/目录下新建目录:

cd xxx/drupal-9.2.9/sites/

mkdir a.drupal/

复制setting.php文件

cp default/default.settings.php a.drupal/settings.php

添加允许访问的域名:

$settings['trusted_host_patterns'] = [ 'a.drupal', ];

复制sites.php

cp example.sites.php sites.php

在sites.php中添加:

$sites = [ '域名'=>'目录名', // 域名对应的 sites/ 中的目录 '8080.a.drupal'=>'a.drupal', // 精确匹配(规则:端口号在前),如果目录名写的不对则会匹配到下一条 'a.drupal'=>'a.drupal', // 如果没有上一条有端口的则会匹配这一条(有写精确匹配可以不要这一条) ];

修改hosts文件

1.2.3.4 a.drupal

访问::8080 新站点开始安装。

更多推荐

Drupal部署

本文发布于:2024-03-08 17:01:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1721539.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Drupal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!