前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOs7 LAMP Drupal安装记录

CentOs7 LAMP Drupal安装记录

作者头像
全栈程序员站长
发布2022-09-09 12:32:49
4350
发布2022-09-09 12:32:49
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

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

代码语言:javascript
复制
yum -y install mariadb-server mariadb
代码语言:javascript
复制
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

代码语言:javascript
复制
$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

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162287.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 MariaDB
腾讯云数据库 MariaDB(TencentDB for MariaDB) 让您轻松在云端部署、使用 MariaDB 数据库。MariaDB 是在 MySQL 版权被 Oracle 收购后,由 MySQL 创始人 Monty 创立,其版权授予了“MariaDB基金会(非营利性组织)”以保证 MariaDB 永远开源,良好的开源策略,是企业级应用的最优选择,主流开源社区系统/软件的数据库系统,均已默认配置 MariaDB。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档