Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P portaldemo-deployment
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • 张永明
  • portaldemo-deployment
  • Wiki
  • 部署2 服务器部署

Last edited by 张永明 Jul 16, 2019
Page history
This is an old version of this page. You can view the most recent version or browse the history.

部署2 服务器部署

1,获取access token

由仓库管理人员创建仓库 access token;交付运维,以供运维使用。 另外,将提前准备好的仓库地址交给运维

2,运维部署服务器环境

  • git
  • composer
  • nginx
  • mariadb
  • php7 及模块 详细参阅运维部署服务器文档。 //TODO: 添加部署环境文档

3,配置 portal.conf

参考配置portal.conf

注意替换以下参数:
server_name  172.21.0.18;
root         /usr/share/nginx/portal/web/; 

4,下载代码及依赖

//参考3中配置项目目录位置(/usr/share/nginx/),
cd /usr/share/nginx/
// 注意替换仓库地址
git clone https://git.qtgl.com.cn/drupal/XXX.git portal
cd portal
//生产站点 忽略开发依赖 composer intall --no-dev
composer intall 

5, 配置portal目录及权限

5.1 配置sync目录:

 cd /usr/share/nginx/portal
 mkdir config
 cd config
 mkdir sync
 chmod 777 sync -R

5.2配置私有目录:

cd /usr/share/nginx/portal
mkdir private
chmod 777 private -R
vim web/sites/default/settings.php
找到约537行
# $settings['file_private_path'] = '';
之后添加私有目录(绝对路径):
$settings['file_private_path'] = '/usr/share/nginx/portal/private';

5.3 检查settings.php 文件权限

cd /usr/share/nginx/portal
chmod go-w web/sites/default
chmod go-w web/sites/default/settings.php
//清理缓存
./vendor/bin/drush cr

6.安装站点

访问网站,进入安装界面

Clone repository
  • Home
  • 部署1 创建项目仓库
  • 部署2 服务器部署
  • 部署3 本地开发参考