Skip to content

Instantly share code, notes, and snippets.

@mrgarymartin
Last active February 13, 2018 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgarymartin/6b807efc6d237a72503e50b858dbd86f to your computer and use it in GitHub Desktop.
Save mrgarymartin/6b807efc6d237a72503e50b858dbd86f to your computer and use it in GitHub Desktop.
build centos 7.4 with php7 mysql 5.7 and nginx nodejs composer
#!/usr/bin/env bash
# update system
sudo yum update -y
# install basic items
sudo yum install -y vim wget git epel-release
#set timezone
timedatectl set-timezone America/Chicago
#install ntp
sudo yum install ntp -y
/bin/systemctl start ntp
/bin/systemctl enable ntp
# install nginx
yum install nginx -y
/bin/systemctl start nginx
/bin/systemctl enable nginx
# Update Firewall rules
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
#install MySql Yum
# get password: grep 'temporary password' /var/log/mysqld.log
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm -y
yum install mysql-community-server -y
/bin/systemctl enable mysqld.service
/bin/systemctl start mysqld.service
#install PHP7
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
sudo yum install -y yum-utils
sudo yum-config-manager --enable remi-php71
sudo yum install -y php
sudo yum install -y php php-bcmath php-cli php-common php-devel php-gd php-mbstring php-mcrypt php-mysql php-pdo php-pear php-pecl-apcu
sudo yum install -y php-pecl-memcache php-soap php-xml php-xmlrpc php-intl
sudo yum install -y php-fpm php-mysqlnd php-opcache php-pecl-igbinary php-pecl-memcached php-process php-json
# Install NodeJS
sudo yum install nodejs -y
sudo yum install npm -y
# Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
## Install Lets Encrypt https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-7
sudo yum install certbot-nginx -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment