• Drupal8 入门教程(一)安装部署


    一、Drupal简介

      Drupal 是使用PHP语言编写的开源内容管理框架(CMF),它由内容管理系统(CMS)和PHP开发框架(Framework)共同构成。连续多年荣获全球最佳CMS大奖,是基于PHP语言最著名的WEB应用程序。截止2011年底,共有13,802位WEB专家参加了Drupal的开发工作;228个国家使用181种语言的729,791位网站设计工作者使用Drupal。著名案例包括:联合国、美国白宫、美国商务部、纽约时报、华纳、迪斯尼、联邦快递、索尼、美国哈佛大学、Ubuntu等。

    二、安装之前环境部署

    • 服务器系统:Ubuntu 16.04.2 LTS
    • Web服务器: Openresty/1.13.6.1
    • 数据库:云数据库RDS(MySQL数据库)
    • PHP版本:7.1.8

    PHP版本支持列表

    三、详细步骤

    1、获取源码,github地址:https://github.com/drupal/drupal/releases

    2、这里下载最新稳定版本,Drupal核心8.4.2 2017年11月3日发布

    3、下载好后直接解压既可以,为了获得有效的代码库,您需要composer install从存储库的顶层运行。这将在目录中安装Symfony和Drupal所需的其他软件依赖包。

     wget https://github.com/drupal/drupal/archive/8.4.2.tar.gz
     tar zxvf 8.4.2.tar.gz 
     cd drupal-8.4.2/
     composer install

    4、安装MySQL数据库

    5、如果你在你自己的计算机上安装Drupal,那么你将不得不设置Web服务器(apache或其他)来使用PHP来为网站提供服务。这里采用Nginx配置

        server {
            server_name  drupal.tinywan.com;
            set $root_path /home/www/build/drupal-8.4.2;
            root $root_path;
            rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;
            location / {
                if (!-e $request_filename) {
                    rewrite  ^(.*)$  /index.php?s=/$1  last;
                    break;
                }
            }
    
            location ~ .php$ {
                fastcgi_pass   unix:/var/run/php7.1.9-fpm.sock;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
                fastcgi_buffer_size 128k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
            }
        }

    配置好后,重启Nginx服务

    sudo systemctl restart nginx.service

    6、运行安装程序,在网页浏览器中访问您的网站。你应该被重定向到安装页面。http://你的IP或者域名/core/install.php

    7、直接使用配置好的域名,输入域名则可以出现以下安装界面,域名:http://drupal.tinywan.com/core/install.php

     

     出现以下警告,按照以下操作

     

    php.ini中需要修改参数

    ;--drupal config
    zend_extension=opcache.so
    pcache.memory_consumption=128
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=4000
    opcache.revalidate_freq=60

    8、重启php-fpm

     sudo systemctl restart php-fpm.service

     返回继续安装

    9、开始配置数据库了,我这里直接是使用的远程数据库,请选择高级选项

     注:我这里直接是使用的阿里云的数据库,要在高级配置host,默认为本地

    10、开始安装

    11、配置站点

    注意:选择时区的时候选择:shanghai

    12、安装结束

    13: 访问网站域名:http://drupal.tinywan.com/

     

    四、遇到的问题

    安装主题遇到的问题403

    An AJAX HTTP error occurred.
    HTTP Result Code: 403
    Debugging information follows.
    Path: /problem/panels/ajax/editor/layout/new/settings/center
    StatusText: Forbidden
    ResponseText: 
    Access denied | Test Panels
    @import url("http://www.signwo.com/problem/modules/system/system.base.css?m2wmcz");
    ...

    解决办法,修改Nginx配置文件,以下红色部分不新添加的配置,重写刚才的位置,

        server {
            server_name  127.0.0.1;
            root www/var;
            rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;
            location / {
                if (!-e $request_filename) {
                    rewrite  ^(.*)$  /index.php?s=/$1  last;
                    break;
                }
            }
        }

    参照:http://blog.csdn.net/e_zhiwen/article/details/51487938

    返回继续安装

     错误提示:

    drupal 网站遇到了不可预知的错误。请稍后再试。!!!

    解决办法:清理数据库表:drupal_cachetags

     

  • 相关阅读:
    11
    TSP-test
    TSP-SA_TSP
    TSP-PathLength
    TSP-OutputPath
    TSP-NewAnswer
    TSP-
    TSp-dsxy2figxy
    TSP-DrawPath
    TSP-Distanse
  • 原文地址:https://www.cnblogs.com/tinywan/p/7965691.html
Copyright © 2020-2023  润新知