Tutorial Install server nginx, php, mysql, phpmyadmin on centos 7 | Install lemp server on centos 7



Tutorial Install server nginx, php, mysql, phpmyadmin on centos 7 | Install lemp server on centos 7

Tutorial Install server nginx, php, mysql, phpmyadmin on centos 7 | Install lemp server on centos 7

Tutorial Install server nginx, php, mysql, phpmyadmin on centos 7 | Install lemp server on centos 7

Tanks for watching, dont forget like and subcribe…
#centos #nginx #server #linux #lemp

yum install epel-release -y
yum install nginx -y
systemctl start nginx
systemctl enable nginx
yum install mariadb-server mariadb -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
yum install yum-utils
yum install php php-mysql php-xml php-imap php-fpm php-cli php-curl php-xmlrpc php-common php-gd php-devel php-intl php-process php-zts -y
yum -y install phpmyadmin
nano /etc/nginx/conf.d/default.conf :
server {
listen 80;
server_name your_server_ip;

# note that these lines are originally from the “location /” block
root /usr/share/nginx/html;
index index.php index.html index.htm;

location / {
index index.php index.html index.htm;
try_files $uri $uri/ =404;
}

location /fileweb {
index index.php index.html index.htm;
}

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

sudo ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
if error php/sesion phpmyadmin = chown -R nginx:nginx /var/lib/php/session
systemctl restart nginx
nano /etc/php-fpm.d/www.conf
user = apache to user = nginx
group = apache to group = nginx
listen.owner = nobody to listen.owner = nginx
listen.group = nobody to listen.group = nginx
listen = 127.0.0.1:9000 to listen = /var/run/php-fpm/php-fpm.sock

sudo firewall-cmd –permanent –zone=public –add-service=http
sudo firewall-cmd –permanent –zone=public –add-service=https
sudo firewall-cmd –reload

systemctl start php-fpm.service
systemctl enable php-fpm.service
systemctl restart nginx

Comments are closed.