Linux development infrastructure construction

Server configuration

Password free login, configure public key connection

  1. Copy the local public key to the server

    $ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.100.80

Replace aliyum source

  1. Replace Centos-7.repo

    wget http://mirrors.aliyun.com/repo/Centos-7.repo
    # backups
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    
    mv Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
    yum makecache 
    yum update

Add CentOS 7 EPEL warehouse

  1. Install a third-party yum source, where Fedora's epel warehouse is used.

    $ sudo yum install epel-release

Compiling environment

  1. Install build environment

    yum groupinstall -y 'Development Tools'
    
    sudo yum install -y gcc gcc-c++ autoconf automake openssl openssl-devel curl curl-devel cmake cmake3 gdbm-devel re2c flex bison nano libtool libxml2-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel bzip2-devel libcurl-devel libicu-devel libwebp-devel libzip-dev zlib-devel

Install Git

  1. Install git

    $ yum install -y git

Install nginx

  1. Install Nginx

    yum install -y nginx
  2. Start Nginx

    sudo systemctl start nginx.service
  3. Start Nginx

    sudo systemctl enable nginx.service

Install Redis

  1. Install Redis

    $ yum install redis
  2. Start Redis

    $ service redis start
  3. Modify port number / password and other configurations

    $ vim /etc/redis.conf
  4. Test login

    $ redis-cli -h 127.0.0.1 -p 6379
  5. Set power on self start

    systemctl enable redis

Install MySQL

  1. install

    # Download mysql source installation package
    $ wget http://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
    
    # Install mysql source
    $ yum localinstall mysql80-community-release-el7-1.noarch.rpm
    
    # Install mysql
    $ yum install mysql-community-server
    
    # Start MySQL service
    $ systemctl start mysqld
    $ systemctl status mysqld
    
    # Boot up
    $ systemctl enable mysqld
    $ systemctl daemon-reload
    
    # View password
    $ grep 'temporary password' /var/log/mysqld.log
    # Generated password root @ localhost: kqeipri1pu dev
    
    # Sign in
    $ mysql -uroot -p
    # Change Password
    $ ALTER USER 'root'@'localhost' IDENTIFIED BY 'kqeIpRI1pU-Dev';

Install php

  1. Reference resources: https://webtatic.com/packages/php72/
  2. Install PHP

    yum install epel-release
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    yum install php72w-fpm php72w-opcache
    yum install php72w-zts php72w-cli php72w-mysql php72w-mbstring php72w-xml php72w-gd php72w-devel
    
    yum install php72w-bcmath php72w-soap php72w-amqplib 

Keywords: PHP yum MySQL Redis CentOS

Added by bfinucan on Tue, 15 Oct 2019 19:33:14 +0300