-
-
Save drmzio/8f10608bab19ea47fae3ea99d47162a2 to your computer and use it in GitHub Desktop.
CentOS 7 LEMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Nginx | |
sudo yum install epel-release | |
sudo yum install nginx | |
sudo systemctl start nginx | |
sudo systemctl enable nginx | |
# Install MySQL (MariaDB) | |
sudo yum install mariadb-server mariadb | |
sudo systemctl start mariadb | |
sudo systemctl enable mariadb | |
sudo mysql_secure_installation | |
# Install PHP 7.x | |
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm | |
sudo yum install php70w php70w-fpm php70w-opcache php70w-bcmath php70w-cli php70w-common php70w-devel php70w-gd php70w-intl php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-pdo php70w-pecl-imagick php70w-xml php70w-json | |
sudo systemctl start php-fpm | |
sudo systemctl enable php-fpm | |
sudo vi /etc/php-fpm.d/www.conf | |
# Find and change listen = 127.0.0.1:9000 to below | |
listen = /run/php-fpm/www.sock | |
# Find and uncomment for listen.owner & listen.group. It should look like after update | |
listen.owner = nobody | |
listen.group = nobody | |
# Lastly, find the lines that set the user and group and change their values from "apache" to "nginx": | |
user = nginx | |
group = nginx | |
# Save it | |
# Configure Nginx Server Block | |
sudo vi /etc/nginx/nginx.conf | |
# Add these lines to the end of the http {} block: | |
include /etc/nginx/sites-enabled/*.conf; | |
# Save it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment