Quick LEMP


Fresh CentOS 7 Install

yum install screen epel-release -y
yum install nginx -y
mkdir /etc/nginx/sites-available/
systemctl start nginx
systemctl enable nginx


wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
rm -f mysql57-community-release-el7-8.noarch.rpm
yum clean all -y
yum install mysql-server -y
systemctl restart mysqld
systemctl enable mysqld

Secure MySQL

grep "temporary password" /var/log/mysqld.log
A temporary password is generated for [email protected]: PaSSwORd

Set new password and the rest is usually answered ‘Y’


curl 'https://setup.ius.io/' -o setup-ius.sh
sh setup-ius.sh
yum remove php-cli mod_php php-common -y
yum install php70u-fpm-nginx php70u-cli php70u-mysqlnd -y
rm setup-ius.sh
sed -i -e 's/listen\ \=\ 127/\;listen\ \=\ 127/g' /etc/php-fpm.d/www.conf
sed -i -e 's/\;listen\ \=\ \/run/listen\ \=\ \/run/g' /etc/php-fpm.d/www.conf
sed -i -e 's/\;listen\.acl\_users\ \=\ nginx/listen\.acl\_users\ \=\ nginx/g' /etc/php-fpm.d/www.conf
sed -i -e 's/server\ 1/\#server\ 1/g' /etc/nginx/conf.d/php-fpm.conf
sed -i -e 's/\#server\ unix/\server\ unix/g' /etc/nginx/conf.d/php-fpm.conf
systemctl start php-fpm
systemctl enable php-fpm
systemctl restart nginx
echo -e '' > /usr/share/nginx/html/info.php
curl -I http://localhost/info.php

Is it working? Did you see “X-Powered-By: PHP/7.0.9” in the cURL output? Good, it works. It didn’t? I dunno then, google it, this is just a dump with extra from after reading the digital ocean article.