CentOs7 LAMP Drupal安装记录

CentOs7 LAMP Drupal安装记录1.重设IP先使用DHCP在/etc/sysconfig/network-scripts/ifcfg-eno***中加入 ONBOOT=YESBOOTPROTO=DHCP#systemctlrestartnetwork2.更新yum的源为国内源wgethttp://mirrors.163.com/.help/CentOS7-Base-163.repo

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

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.增加防火墙

firewallcmdpermanentzone=publicaddservice=http

firewallcmdpermanentzone=publicaddservice=https

firewallcmdreload

firewall-cmd –list-all

6.安装MariaDB

更新epel

rpmimport /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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

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

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Spring Cloud Eureka详解

    Spring Cloud Eureka详解SpringCloudEureka详解一Eureka服务治理体系1.1服务治理服务治理是微服务架构中最为核心和基础的模块,它主要用来实现各个微服务实例的自动化注册和发现。SpringCloudEureka是SpringCloudNetflix微服务套件中的一部分,它基于NetflixEureka做了二次封装。主要负责完成微服务架构中的服务治理功能。E…

    2022年6月27日
    26
  • windows Netstat命令详解

    windows Netstat命令详解Netstat用于显示与IP、TCP、UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况。如果你的计算机有时候接收到的数据报导致出错数据或故障,你不必感到奇怪,TCP/IP可以容许这些类型的错误,并能够自动重发数据报。但如果累计的出错情况数目占到所接收的IP数据报相当大的百分比,或者它的数目正迅速增加,那么你就应该使用…

    2022年5月29日
    218
  • WebGrid 在asp.net mvc中的使用和理解(译)

    WebGrid 在asp.net mvc中的使用和理解(译)1:思路webgrid就是表格,一行行记录,代表一个个模型,因此,我们只需要在models文件夹建立模型,在控制器生成模型列表,把列表作为模型传入视图(或者绑定强类型视图,这个类型至少大于等于此模型列

    2022年7月3日
    21
  • 云服务器和虚拟主机的区别

    云服务器和虚拟主机的区别云服务器和虚拟主机的区别:1、技术原理:云服务器是基于庞大的服务器资源池,是在一组集群主机上虚拟出多个类似独立主机的部分,集群中每个主机上都有云服务器的一个镜像;虚拟主机是服务器划分出的一部分,因此也叫做虚拟空间,在服务器当中划分出一定的磁盘空间放置web程序组件,提供数据的存放和传输功能。2、可用资源:云服务器是独享资源,具有独立的CPU、内存、硬盘和ip等;虚拟主机则是众多网站空间共享一台物理服务器的资源。3、主机费用:由于虚拟主机是多个空间分享一台服务器的带宽、IP等资源,费用低廉,价格比云服

    2022年6月25日
    32
  • 总结thinkphp快捷查询getBy、getField、getFieldBy用法及场景

    总结thinkphp快捷查询getBy、getField、getFieldBy用法及场景

    2021年10月19日
    67
  • pycharm2021.4.2激活码(破解版激活)

    pycharm2021.4.2激活码(破解版激活),https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
    75

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号