S U N U C U Ç Ö Z Ü M L E R İ

Contact Info

+90 (850) 885 0656

[email protected]

Nginx MariaDB 10 ve PHP 5.5/5.6 RHEL/CentOS 7/6 & Fedora 20-24 Kurulumu
Category
Linux
Posted on
Eylül 5, 2022

Nginx MariaDB 10 ve PHP 5.5/5.6 RHEL/CentOS 7/6 & Fedora 20-24 Kurulumu

Merhabalar, makalemizde LEMP (Linux, Nginx, MariaDB, PHP)
Centos ve Fedora için
Nginx Kurulumu
MariaDB 10 Kurulumu
PHP 5.6 ve PHP5.5 Kurulumuna ilişkin bilgi paylaşımı gerçekleştireceğiz.

Nginx Nedir ?
HTTP, SMTP, POP3 ve IMAP protokolleri için açık kaynak, hafif ve yüksek performanslı Web sunucusu, ters proxy sunucu ve ayrıca posta proxy sunucusudur. Daha fazla ayrıntı için http://wiki.nginx.org/Overview adresini ziyaret edebilirsiniz.

PHP-FPM Nedir ?
PHP-FPM, FastCGI İşlem Yöneticisi anlamına gelir. Aşırı kaynak kullanan veya trafiği yoğun olan web siteleri için ek yararlı özellikler içeren alternatif bir PHP FastCGI uygulamasıdır. Daha fazla bilgi için http://php-fpm.org/ adresini ziyaret edin.

Kurulum

1. Adım Repo Tanıtımları
Centos 7 İçin

# yum update && yum install epel-release  
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm  
--------- For RHEL Only --------- 
# subscription-manager repos --enable=rhel-7-server-optional-rpms

Centos 6 İçin

# yum update && yum install epel-release   
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm  
--------- For RHEL Only --------- 
# subscription-manager repos --enable=rhel-6-server-optional-rpms  


Fedora 24 için

# wget http://rpms.remirepo.net/fedora/remi-release-24.rpm 
# dnf install remi-release-24.rpm 

Fedora 23 için

# wget http://rpms.remirepo.net/fedora/remi-release-23.rpm 
 
# dnf install remi-release-23.rpm 

Fedora 22 İçin

wget http://rpms.remirepo.net/fedora/remi-release-22.rpm   
dnf install remi-release-22.rpm

Fedora 20 İçin

wget http://rpms.remirepo.net/fedora/remi-release-20.rpm  
yum install remi-release-20.rpm

2. Adım Nginx ve MariaDB için Repo Tanıtımı

nano -w /etc/yum.repos.d/nginx.repo

RHEL 7/6:

 

 
[nginx] 
name=nginx repo  
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/  
gpgcheck=0  
enabled=1  

 

CentOS 7/6:

 

[nginx]  
name=nginx repo  
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/  
gpgcheck=0  
enabled=1 

3. Adım Kurulması gereken paketleri aktif edelim.

nano -w /etc/yum.repos.d/remi.repo

PHP 5.5 CentOS/RHEL 7 ve Fedora İçin

 

[remi-php55]
name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php55/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php55/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

 

PHP 5.6 CentOS/RHEL 7 ve Fedora İçin

 

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

4. Paketlerimizi Yükleyelim. (Nginx, MariaDB, PHP-FPM)

----------- Installing on RHEL/CentOS 7/6 ----------- 
yum --enablerepo=remi install nginx MariaDB-client MariaDB-server php php-common php-fpm 
----------- Installing on Fedora 22-24 ----------- 
dnf --enablerepo=remi install nginx MariaDB-client MariaDB-server php php-common php-fpm 
----------- Installing on Fedora 20-21 ----------- 
yum --enablerepo=remi install nginx MariaDB-client MariaDB-server php php-common php-fpm 



5. Adım PHP çalışılabilir modülleri yükleyelim.

----------- Installing on RHEL/CentOS 7/6 ----------- 
# yum --enablerepo=remi install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache 
php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo 
----------- Installing on Fedora 22-24 ----------- 
# dnf --enablerepo=remi install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache
 php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo 
----------- Installing on Fedora 20-21 ----------- 
# yum --enablerepo=remi install php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache
 php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-pecl-apc php-cli php-pear php-pdo

6. Adım Servisleri Aktif Edelim.

# systemctl start nginx 
# systemctl start mariadb 
# systemctl start php-fpm

service nginx restart

service php-fpm restart

service mysqld restart

7. Adım Nginx ayarlarını yapalım

sunucucozumleri.com için hesap açtığımızı düşünelim ve bu hesap, /home/sunucu/ klasorunu kullanacağını varsayıyoruz.

# mkdir -p /home/sunucu/public_html 
# mkdir /home/sunucu/logs 
# chown -R nginx:nginx /home/sunucu/

 

# mkdir /etc/nginx/sites-available 
# mkdir /etc/nginx/sites-enabled

nano -w /etc/nginx/nginx.conf

Dosyasını açıyoruz ve aşağıda ki komutu ekliyoruz.

## Load virtual host conf files. ## 
include /etc/nginx/sites-enabled/*; 


nano -w /etc/nginx/sites-available/sunucucozumleri.conf

Dosyasını oluşturduktan sonra aşağıda bulunan komutları girelim.

server { 
listen 80 default; 
server_name sunucucozumleri.com; 
access_log /home/sunucu/logs/access.log; 
error_log /home/sunucu/logs/error.log; 
root /home/sunucu/public_html; 
location ~* \.php$ { 
fastcgi_index   index.php; 
fastcgi_pass    127.0.0.1:9000; 
include         fastcgi_params; 
fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name; 
fastcgi_param   SCRIPT_NAME        $fastcgi_script_name; 
} 
}

 

ln -s /etc/nginx/sites-available/sunucucozumleri.conf 
/etc/nginx/sites-enabled/sunucucozumleri.conf
nginx -t

İşlemlerimiz bu kadar, Bol trafikli günler dileriz.

Share this Post