在这个文章, 我们展示了在 CentOS 7 上如何去下载、安装和使用基本配置来设置 LAMP 以及 Drupal 8。 -- Aaron Kili
本文导航
-步骤 1:安装 Apache Web 服务器 …… 09%
-步骤 2: 安装 Apache PHP 支持 …… 22%
-步骤 3: 安装和配置 MariaDB 数据库 …… 33%
-步骤 4: 在 CentOS 中安装和配置 Drupal 8 …… 46%
编译自: http://www.tecmint.com/install-drupal-in-centos-rhel-fedora/
作者: Aaron Kili
译者: imxieke
# yum install httpd
------------- 通过 SystemD - CentOS/RHEL 7 和 Fedora 22+ -------------------
# systemctl start httpd
# systemctl enable httpd
------------- 通过 SysVInit - CentOS/RHEL 6 和 Fedora ----------------------
# service httpd start
# chkconfig --level 35 httpd on
------------ 通过 Firewalld - CentOS/RHEL 7 and Fedora 22+ -------------
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload
------------ 通过 IPtables - CentOS/RHEL 6 and Fedora 22+ -------------
# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
# service iptables save
# service iptables restart
# yum install php php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache
------------- Install PHP 7 in CentOS/RHEL and Fedora -------------
# 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
# yum install php70w php70w-opcache php70w-mbstring php70w-gd php70w-xml php70w-pear php70w-fpm php70w-mysql php70w-pdo
# echo "<?php phpinfo(); ?>" > /var/www/html/info.php
# systemctl restart httpd
或
# service httpd restart
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# yum install mariadb-server mariadb
------------- 通过 SystemD - CentOS/RHEL 7 and Fedora 22+ -------------
# systemctl start mariadb
# systemctl enable mariadb
------------- 通过 SysVInit - CentOS/RHEL 6 and Fedora -------------
# service mysqld start
# chkconfig --level 35 mysqld on
# mysql_secure_installation
# yum install wget gzip
# wget -c https://ftp.drupal.org/files/projects/drupal-8.2.6.tar.gz
# tar -zxvf drupal-8.2.6.tar.gz
# mv drupal-8.2.6 /var/www/html/drupal
# cd /var/www/html/drupal/sites/default/
# cp default.settings.php settings.php
# chown -R apache:apache /var/www/html/drupal/
# chcon -R -t httpd_sys_content_rw_t /var/www/html/drupal/sites/
# mysql -u root -p
Enter password:
MySQL Shell
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type &#x27;help;&#x27; or &#x27;\h&#x27; for help. Type &#x27;\c&#x27; to clear the current input statement.
**MySQL [(none)]> create database drupal;**
Query OK, 1 row affected (0.00 sec)
**MySQL [(none)]> create user ravi@localhost identified by &#x27;tecmint123&#x27;;**
Query OK, 0 rows affected (0.00 sec)
**MySQL [(none)]> grant all on drupal.* to ravi@localhost;**
Query OK, 0 rows affected (0.00 sec)
**MySQL [(none)]> flush privileges;**
Query OK, 0 rows affected (0.00 sec)
**MySQL [(none)]> exit**
Bye
# vi /etc/httpd/conf/httpd.conf
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/) | Powered by Discuz! X3 |