歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS 7.x 安裝drupal 8

CentOS 7.x 安裝drupal 8

日期:2017/3/6 9:46:10   编辑:學習Linux

CentOS 7.x 安裝drupal 8


CentOS 7.x 安裝drupal 8


1.drupal 8.x 需求


類型需求Database1.MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine,

2.PostgreSQL 9.1.2 or higher with PDO,

3.SQLite 3.6.8 or higherPHPPHP 5.5.9 or higher

官方需求鏈接


2.部署LAMP(Linux+Apache+Mysql+PHP)


更新系統安裝包(CentOS)[Option]

# yum update

安裝Apache

# yum install httpd

apache設置默認啟動[Option]

# systemctl start httpd# systemctl enable httpd 

apache浏覽器訪問

在浏覽器中輸入網址後可以看到測試頁面. Testing…….

安裝MariaDB

# yum install mariadb-server mariadb 

設置MariaDB自動運行

# systemctl start mariadb# systemctl enable mariadb 

初始化MariaDB

# /usr/bin/mysql_secure_installation 

【以上參考:CentOS 7 install LAMP】

安裝PHP


drupal 8.x要求php在5.5.9以上,默認的centOS 7 安裝5.4,5.5的版本放在webtatic上【referrence】

安裝擴展包

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安裝php相關包

# yum install php55w php55w-opcache php55w-gd php55w-mbstring php55w-mysqlnd php55w-pdo php55w-opcache php55w-xml

上述為drupal必須安裝的包:

類型說明php55w必須,版本5.5.35php55w-cli必須php55w-common必須php55w-gd必須,drupal 8要求php55w-mbstring必須,drupal 8要求,處理unicode字符php55w-mysqlnd必須,drupal 8要求,鏈接mariadbphp55w-opcache必須,緩存php55w-pdo必須,drupal 8要求,數據庫php55w-xml必須

測試php安裝

# php -vPHP 5.5.35 (cli) (built: May  1 2016 11:44:25)Copyright (c) 1997-2015 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

測試apache

##重啟apache# systemctl restart httpd

3.下載安裝drupal 8.x


下載

## 1.wget下載# wget https://ftp.drupal.org/files/projects/drupal-8.1.1.tar.gz## 2.解壓縮到apache# tar xvfz drupal-8.1.1.tar.gz -C /var/www/html### 3.重命名# cd /var/www/html# mv drupal-8.1.1 drupal## 4.修改權限# chown -R apache:apache /var/www/html/drupal/## 5.復制配置文件# cd /var/www/html/drupal/sites/default# cp -p default.settings.php settings.php

新建數據庫

# mysql -u root -p>create database drupal_db;>CREATE USER db_user@localhost IDENTIFIED BY 'Durpal@123#';>GRANT ALL PRIVILEGES ON drupal_db.* TO db_user@localhost;>FLUSH PRIVILEGES;>exit;

打開浏覽器http://your.ip/drupal

【Referrence】 1.http://www.linuxtechi.com/how-to-install-drupal-8-on-centos-7 2.https://www.linode.com/docs/websites/cms/install-and-configure-drupal-8


常見FAQ:


clean URL配置:

## 查看apache是否有rewrite_module# apachectl -M |grep rewrite>rewrite_module (shared)## 配置 /etc/httpd/conf/httpd.conf# vim /etc/httpd/conf/httpd.conf## 在最後添加:LoadModule rewrite_module modules/mod_rewrite.so## 修改AllowOverride<Directory "/var/www/html/drupal">       AllowOverride All    Require all granted</Directory>##保存退出

重啟apache服務:

systemctl restart httpd

http://xxxxxx/Linuxjc/1134299.html TechArticle

Copyright © Linux教程網 All Rights Reserved