CentOs7 LAMP Drupal安装记录

1.重设IP

先使用DHCP

在/etc/sysconfig/network-scripts/ifcfg-eno***中加入 

ONBOOT=YES

BOOTPROTO=DHCP


# systemctl restart network

2.更新yum的源为国内源

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

# yum clean all 

# yum makecache


3.安装和更新一些必要工具

yum install net-tools make gcc kernel-devel ntsysv tree links wget


4.安装Apache

yum install httpd

修改配置文件

vi /etc/httpd/conf/httpd.conf

ServerSignature On#添加,在错误页中显示Apache的版本,Off为不显示

#AddHandler cgi-script .cgi #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)

AllowOverride None #修改为:AllowOverride All (允许.htaccess)

AddDefaultCharset UTF-8 #修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)

#Options Indexes FollowSymLinks #修改为 Options FollowSymLinks(不在浏览器上显示树状目录结构)

DirectoryIndex index.html#修改为:DirectoryIndex index.html index.htm Default.html Default.htm index.php(设置默认首页文件,增加index.php)

MaxKeepAliveRequests500#添加MaxKeepAliveRequests 500 (增加同时连接数)


重启httpd

systemctl restart httpd.service

增加自启动

systemctl enable httpd.service


5.增加防火墙

firewall-cmd--permanent--zone=public--add-service=http

firewall-cmd--permanent--zone=public--add-service=https

firewall-cmd--reload

firewall-cmd --list-all

6.安装MariaDB

更新epel

rpm--import /etc/pki/rpm-gpg/RPM-GPG-KEY*

yum-y install epel-release

yum -y install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb .service

mysql_secure_installation

7.安装PHP7

删除之前的旧版本

# yum remove php* php-common

设置yum 源:

# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

安装php7

# yum install php70w

# php -v

# systemctl restart httpd.service

获得支持

#yum install php70w-dba.x86_64 php70w-devel.x86_64 php70w-embedded.x86_64 php70w-enchant.x86_64 php70w-fpm.x86_64 php70w-gd.x86_64 php70w-imap.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysqlnd.x86_64 php70w-odbc.x86_64 php70w-opcache.x86_64 php70w-pdo.x86_64 php70w-pdo_dblib.x86_64 php70w-pear.noarch php70w-pecl-apcu.x86_64 php70w-pecl-apcu-devel.x86_64 php70w-pecl-imagick.x86_64 php70w-pecl-imagick-devel.x86_64 php70w-pecl-mongodb.x86_64 php70w-pecl-redis.x86_64 php70w-pecl-xdebug.x86_64 php70w-pgsql.x86_64 php70w-xml.x86_64 php70w-xmlrpc.x86_64 php70w-intl php70w-bcmath.x86_64 -y


8.安装 phpMyAdmin

#yum install phpMyAdmin

#vi /etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>

Options none

AllowOverrideLimit

Require all granted

</Directory>

将phpMyAdmin的认证cookie修改为http

# vi /etc/phpMyAdmin/config.inc.php

$cfg['Servers'][$i]['auth_type']     = 'http';

9安装Drupal

在安装时报文件和目录不可写,主是要selinux进行了控制,先查看下不可写目录与文件的值:

ls -lZ 

-rwxr--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 default.settings.php
drwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 files
-rwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 settings.php

需要增加以下命令:

 chcon -t httpd_sys_content_rw_t sites/default/
 chcon -t httpd_sys_content_rw_t sites/default/settings.php
 chcon -t httpd_sys_content_rw_t sites/default/files

注意修改完成后,改关闭selinux的权限。

参考https://www.drupal.org/docs/7/installing-drupal-7/step-3-create-settingsphp-and-the-files-directory

完成Drupal安装。

10.安装Drush


drush dl china_address entity entityreference profile2 field_collection field_collection_views ctools views color_field libraries pathauto token rules date links wysiwyg backup_migrate transliteration devel context smtp node_clone flag restws

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值