CENTOS 6.8 + NGINX + PHP-FPM + MYSQL + PHPMYADMIN ************************************************* KURULMUŞ İSE APACHE, PHP VE MYSQL'IN KALDIRILMASI ------------------------------------------------- # service httpd stop && chkconfig httpd off && service mysqld stop # yum remove mysql mysql* php php* -y NGINX KURULUM ------------- # vi /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 # wget http://nginx.org/keys/nginx_signing.key # rpm --import nginx_signing.key # yum install nginx -y # service nginx start && chkconfig nginx on # lscpu | grep '^CPU(s)' CPU(s): 1 # vi /etc/nginx/nginx.conf worker_processes 1; keepalive_timeout 60; gzip on; # service nginx restart WEB TEST: http://192.168.0.220 MYSQL SERVER KURULUM -------------------- # yum install mysql mysql-server -y # service mysqld start && chkconfig mysqld on # mysql_secure_installation PHP-FPM KURULUM --------------- # yum install php php-fpm php-mysql php-pecl-memcache php-pecl-apc -y # vi /etc/php.ini cgi.fix_pathinfo=0 # vi /etc/php-fpm.d/www.conf listen = /var/run/php-fpm/php-fpm.sock # service php-fpm start && chkconfig php-fpm on NGINX'IN PHP İLE ÇALIŞMASI -------------------------- # cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default_yedek.conf # vi /etc/nginx/conf.d/default.conf server { listen 80; server_name 192.168.1.220; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } 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; } } # vi /usr/share/nginx/html/info.php # service nginx restart WEB TEST: http://192.168.0.220/info.php PHPMYADMIN KURULUM ------------------ # wget ftp://ftp.linux.org.tr/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm # yum install phpmyadmin -y # ln -s /usr/share/phpMyAdmin /usr/share/nginx/html # mv /usr/share/nginx/html/phpMyAdmin /usr/share/nginx/html/dbadmin # service php-fpm restart WEB TEST: http://192.168.0.220/dbadmin