文档章节

CentOS7 安装 Nginx + Apache + MySQL||MariaDB + PHP7

liasica
 liasica
发布于 2016/03/02 11:44
字数 520
阅读 58
收藏 0
  1. 安装依赖包:

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    MySQL:yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
    MariaDB:rpm -Uvh https://downloads.mariadb.com/archives/MariaDB/mariadb-10.1.13/yum/rhel/7/x86_64/rpms/MariaDB-10.1.13-centos7-x86_64-server.rpm
  2. 安装包:

    yum --enablerepo=remi,remi-php70 install httpd php php-common php-pecl-apcu php-cli php-pear php-opcache php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-devel php-bcmath -y
    MySQL:
    yum -y install mysql-community-server mysql-community-client mysql-community-devel
    MariaDB:
    yum -y install MariaDB-server MariaDB-client MariaDB-devel
  3. 启动、添加开机启动:

    systemctl start|restart|stop|status mysqld|httpd||mariadb
    systemctl enable httpd|mysqld||mariadb
  4. 查看MySQL默认密码:

    grep 'A temporary password is generated for root@localhost' /var/log/mysqld.log |tail -1
  5. 初始化MySQL:

    /usr/bin/mysql_secure_installation

    Securing the MySQL server deployment.

    Enter password for user root:

    The existing password for the user account root has expired. Please set a new password.

    New password:

    Re-enter new password:
    The 'validate_password' plugin is installed on the server.
    The subsequent steps will run with the existing configuration
    of the plugin.
    Using existing password for root.

    Estimated strength of the password: 100
    Change the password for root ? ((Press y|Y for Yes, any other key for No) : Y

    New password:

    Re-enter new password:

    Estimated strength of the password: 100
    Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
    By default, a MySQL installation has an anonymous user,
    allowing anyone to log into MySQL without having to have
    a user account created for them. This is intended only for
    testing, and to make the installation go a bit smoother.
    You should remove them before moving into a production
    environment.

    Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
    Success.


    Normally, root should only be allowed to connect from
    'localhost'. This ensures that someone cannot guess at
    the root password from the network.

    Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

    ... skipping.
    By default, MySQL comes with a database named 'test' that
    anyone can access. This is also intended only for testing,
    and should be removed before moving into a production
    environment.


    Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
    - Dropping test database...
    Success.

    - Removing privileges on test database...
    Success.

    Reloading the privilege tables will ensure that all changes
    made so far will take effect immediately.

    Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
    Success.

    All done!

    修改密码:

    mysqladmin -u root password [your_password_here]
  6. 创建数据库并且允许远程连接:

    ## CREATE DATABASE ##
    mysql> CREATE DATABASE webdb;
     
    ## CREATE USER ##
    mysql> CREATE USER 'webdb_user'@'%' IDENTIFIED BY 'password123';
     
    ## GRANT PERMISSIONS ##
    mysql> GRANT ALL ON webdb.* TO 'webdb_user'@'%';
     
    ##  FLUSH PRIVILEGES, Tell the server to reload the grant tables  ##
    mysql> FLUSH PRIVILEGES;

© 著作权归作者所有

liasica
粉丝 1
博文 2
码字总数 680
作品 0
程序员
私信 提问
在 CentOS 7 中安装 Nextcloud

导读 Nextcloud 是一款自由 (开源) 的类 Dropbox 软件,由 ownCloud 分支演化形成。它使用 PHP 和 JavaScript 编写,支持多种数据库系统,比如 MySQL/MariaDB、PostgreSQL、Oracle 数据库和 ...

问题终结者
2017/11/05
186
0
阿里云centos7 LNMP开发环境搭建

最近新买了阿里的云服务器,准备自己搞点事情,分享一波阿里云的红包. 阿里云的购买入口 我购买的阿里云是centos7.3的.在Linux下,搭建服务最好当然是LNMP了,毕竟PHP是世界上最好的语言(开玩笑了...

紫葡萄0
01/17
0
0
OneinStack 1.2 发布,一键 PHP/JAVA 安装工具

这个脚本是使用 shell编写,为了快速在生产环境上部署lnmp/lamp/lnmpa/lnmt(Linux、Nginx/Tengine、 MySQL/MariaDB/Percona、PHP、Apache、Tomcat),适用于CentOS 5~7(包括redhat)、Deb...

lj2007331
2016/03/03
2.8K
10
zabbix3.0之server端部署详解

yum 配置 下载yum配置 rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm 安装依赖包 [root@localhost conf]# yum install zabbix-......

凛冬一壶酒
2018/06/26
0
0
Centos7 wordpress4.8.2

VM 安装centos7 -1611,过程略。。。 部署流程: 1、安装epel 2、安装基本组件(Apache、MariaDB、PHP) 3、配置数据库 4、下载wordpress安装包到服务器,解压安装包 5、给文档赋权限 命令:...

hnzzck
2018/06/26
0
0

没有更多内容

加载失败,请刷新页面

加载更多

golang-字符串-地址分析

demo package mainimport "fmt"func main() {str := "map.baidu.com"fmt.Println(&str, str)str = str[0:5]fmt.Println(&str, str)str = "abc"fmt.Println(&s......

李琼涛
今天
4
0
Spring Boot WebFlux 增删改查完整实战 demo

03:WebFlux Web CRUD 实践 前言 上一篇基于功能性端点去创建一个简单服务,实现了 Hello 。这一篇用 Spring Boot WebFlux 的注解控制层技术创建一个 CRUD WebFlux 应用,让开发更方便。这里...

泥瓦匠BYSocket
今天
6
0
从0开始学FreeRTOS-(列表与列表项)-3

FreeRTOS列表&列表项的源码解读 第一次看列表与列表项的时候,感觉很像是链表,虽然我自己的链表也不太会,但是就是感觉很像。 在FreeRTOS中,列表与列表项使用得非常多,是FreeRTOS的一个数...

杰杰1号
今天
4
0
Java反射

Java 反射 反射是框架设计的灵魂(使用的前提条件:必须先得到代表的字节码的 Class,Class 类 用于表示.class 文件(字节码)) 一、反射的概述 定义:JAVA 反射机制是在运行状态中,对于任...

zzz1122334
今天
5
0
聊聊nacos的LocalConfigInfoProcessor

序 本文主要研究一下nacos的LocalConfigInfoProcessor LocalConfigInfoProcessor nacos-1.1.3/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java p......

go4it
昨天
9
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部