logo 1
  • Anasayfa
  • Nedir?
  • Nasıl Yapılır?
  • Seo
  • WordPress
  • Kategoriler
    • Gündem
    • Kitap
    • Yazılım
    • WordPress Tema
    • Siber Güvenlik
    • Teknoloji
Reading: CentOS 7 Üstüne LEMP Kurulumu
Share
Site Kur
Taha Mumcu Kişisel BlogTaha Mumcu Kişisel Blog
Font ResizerAa
  • Complaint
  • Advertise
Search
  • Homepage
  • Features
    • Post Headers
    • Layout
  • Categories
    • Lifestyle
    • Wellness
    • Healthy
    • Nutrition
  • More Foxiz
    • Complaint
    • Sitemap
    • Advertise
  • Contacts
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.
Taha Mumcu Kişisel Blog > Blog > Genel > CentOS 7 Üstüne LEMP Kurulumu
Genel

CentOS 7 Üstüne LEMP Kurulumu

CentOS LEMP Install
CentOS LEMP Install
Taha Mumcu
By Taha Mumcu
Last updated: 26 Aralık 2020
6 Min Read
SHARE

Linux sistem üstünde bir web uygulaması yayınlayacaksanız kesinlikle tavsiyem Nginx’tir. Nginx oldukça süratli basit ve stabil bir web sunucusudur. Oldukca fazla esnek konfigürasyon girişlerine izin veriyor. Performas ayarlarından güvenlik yapılandırmalarına kadar birçok ayarı yapabiliyorsunuz. Ek olarak SPDY ve HTTP2 desteğide mevcut.

Başlıklar
  • 1. İlk öce sistem güncellemesi
  • 2. Veritabanı Kurulumu MariaDB(MySQL)
  • 3. Nginx Kurulumu
  • 4. PHP7.1-FPM Kurulumu
  • 5. Nginx Konfigürasyonu

Bu kurulumu CentOS 7 üstüne kuracagız base server kurulumu yapmış olup internete bağlı olduğunuzu varsayıyorum.

1. İlk öce sistem güncellemesi

İlk ilkin sunucunuzu “Vmware olsun yada cloud VPS olsun” güncelliyoruz :

# yum update

2. Veritabanı Kurulumu MariaDB(MySQL)

CentOS 7 (RHEL) Mysql kurulumu yapıyoruz.

# yum -y install mariadb mariadb-server

Kurulumdan derhal sonrasında konfigurasyon için “/etc/my.cnf.d/server.cnf” dosyasında “bind-address” kısmını aşağıdaki şeklinde düzenliyoruz yada denetim ediyoruz :

# nano /etc/my.cnf.d/server.cnf

[mysqld]
bind-address = 127.0.0.1

Şimdi Mysql i başlatıp otomatik açılması için enable ediyoruz :

# systemctl start mariadb
# systemctl enable mariadb

Güvenlik ayarları için scriptimizi çalıştırıyoruz mysql_secure_installation :

# mysql_secure_installation

Enter current password for root (enter for none): ENTER
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove kontrol database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

3. Nginx Kurulumu

Centos EPEL kütüphanesinde default olarak Nginx bulunmaz bu yüzden eklemeniz gerekiyor :

# yum install epel-release

Sonrasında Nginx kurulunumu başlatıyoruz :

# yum -y install nginx

Kurulum tamamlandıktan sonrasında Nginx i start edip otomatik açılması için enable ediyoruz :

# systemctl start nginx
# systemctl enable nginx

Nginx kurulumumuzun çalışıp çalışmadığını denetim ediyoruz:

# systemctl status nginx

The output of the command above should be similar to this:

● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running)
 Main PID: 10092 (nginx)
   CGroup: /system.slice/nginx.service
           ├─10092 nginx: master process /usr/sbin/nginx
           ├─10093 nginx: worker process
           └─10094 nginx: worker process

Nginx’in çalışıp çalışmadığını web broowser’ınızın adres satırına http://ip_adresiniz i yazarak ta denetim edebilirsiniz.

4. PHP7.1-FPM Kurulumu

Sıra geldi PHP7.1-FPM kurulumuna. Ilk olarak gene CentOS repository’sine bir ilave daha yapıyoruz zira default olarak PHP-7.1 CentOS repository’sinde yok.

# wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm && rpm -Uvh remi-release-7.rpm

PHP7.1-FPM Kurulumu için aşağıdaki komutu girip kurulumu başlatıyoruz :

# yum --enablerepo=remi-safe -y install php71-php-fpm

PHP7.1-FPM kuruldu, açılışta başlaması içi enable edip start ediyoruz :

# systemctl start php71-php-fpm
# systemctl enable php71-php-fpm

PHP7.1-FPM çalışıp çalışmadığını denetim ediyoruz :

# systemctl status php71-php-fpm

The output of the command above should be similar to this:

● php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php71-php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running)
 Main PID: 10792 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/php71-php-fpm.service
           ├─10792 php-fpm: master process (/etc/opt/remi/php71/php-fpm.conf)
           ├─10793 php-fpm: pool www
           ├─10794 php-fpm: pool www
           ├─10795 php-fpm: pool www
           ├─10796 php-fpm: pool www
           └─10797 php-fpm: pool www

Not : PHP-7.1 konfigürasyon dosyaları bu klasördedir. “/etc/opt/remi/php71”

PHP7.1-FPM ayarlarını denetim ediyoruz :

# nano /etc/opt/remi/php71/php-fpm.d/www.conf
===========================================================
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;                            a specific port;
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php/php7.1-fpm.sock

===========================================================

Dosyayı kaydedip PHP7.1-FPM servisini tekrardan başlatıyoruz :

# systemctl restart php71-php-fpm

5. Nginx Konfigürasyonu

Son olarak nginx ayarlarımızı web sitemizin adına gore düzenliyoruz.

Dosyalarımızın bulunacağı klasörü oluturuyoruz :

# mkdir -p /var/www/teknolojik-blog.com

Nginx Server bloğu ve PHP-7.1 için ayarlarımızı giriyoruz :

# nano /etc/nginx/conf.d/teknolojik-blog.com.conf

server 
        listen 80;
        
        root /var/www/teknolojik-blog.com;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name teknolojik-blog.com;

        location / 
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        

        # pass the PHP scripts to FastCGI server using the /run/php/php7.1-fpm.sock socket
        #
        location ~ .php$ 
                include fastcgi.conf;
                fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /.ht 
                deny all;
        

Kolayca ayarlarımız bitti dosyamızı kaydedip kontrol ediyoruz :

# nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf kontrol is successful

Eğer hata alırsanız “/var/www/teknolojik-blog.com”  klasörünün yetkilerini düzenleyin :

# chown -R nginx:nginx /var/www/teknolojik-blog.com
# systemctl restart nginx

Sever bloğunuz PHP 7 ile çalışmaya başladı.

Kontrol etmek için root klasörünüze phpinfo.php isminde bir dosya oluturup içine :

<?php phpinfo(); ?>

satırını ekleyip kaydedin ve browser’a :

http://ip-addres/phpinfo.php

yazın sunucunuzun PHP detayları ekrana gelecektir.

Doğal olarak güvenli bir sunucu yapısı için birçok ayar yapmak gerekiyor burada rahat bir kurulum yapılmıştır.

Share This Article
Facebook Copy Link Print
ByTaha Mumcu
Follow:
Ben Taha Mumcu, Bilişim sektöründe uzun süreden beri tecrübe edinerek bir yerlere gelmek için çalışmalarına devam eden ve sektörü yakından takip ederek hiç bir veriden geri kalmayan, girişimci ruhu ile tüm işlere elinden geldiğinde çalışma yapan bir girişimciyim. Henüz genç yaşta birçok tecrübeye ulaşan ve koyulan engelleri aşarak bir yerlere gelmek için çaba göstermekten çekinmiyorum.
Previous Article Raid Diskler RAID Diskler Nasıl Çalışır ?
Next Article 20180920 cs header 1 840x500 1 Siber Güvenlik Nedir?
Son Yazılar
kdogrselleri (49)
Google Ads Kampanyalarında Başarıyı Etkileyen Faktörler
11 Şubat 2026
iso 9001.jpg (2)
Meb 9001 Belgesi İçin Öğrenci Kayıt ve Takip Sistemi
8 Şubat 2026
Image fx (23) (1)
Hızlı Okuma Eğitimleri Hangi Yaş Grupları İçin Uygundur?
7 Şubat 2026
hyundai tucson hayal kirikligi 1
Hyundai Motor Türkiye Satış Sonrası Hizmetlerde Eleştirilerin Odağında
7 Şubat 2026
Kocaeli ve Darıca’da Taşınmayı Kolaylaştıran Modern Nakliyat Hizmetleri
1 Aralık 2025
Popüler Yazılar
sebeke sorunlari
Şebeke Problemi ,Telefon Çekmiyor Sorunlarının Çözümü
3 Ocak 2023
bimber
WordPress Viral Tema – Bimber
19 Kasım 2020
blognasilacilir
Kişisel Blog Nasıl Açılır? Kişisel Blog Nedir?
5 Ocak 2021
laptop 3706810 1280
En İyi Hosting Firmaları 2023
14 Ekim 2023
Binance vs OKX kripto borsasında kim önde
21 Ekim 2025

You Might Also Like

open source code software security 1
Genel

2025’te Açık Kaynak Kodlu Yazılımlar ve Güvenlik Riskleri

10 Min Read
2024'te Bilgisayar Korsanlarına Karşı Alınacak Yeni Önlemler
Genel

2024’te Bilgisayar Korsanlarına Karşı Alınacak Yeni Önlemler

13 Min Read
2025'te Sanal Ofisler ve Çalışma Alanlarının Dönüşümü
Genel

2025’te Sanal Ofisler ve Çalışma Alanlarının Dönüşümü

14 Min Read
debian gorsel yeni fhd
Genel

Debian 10 Üzerine PHP 8.0 Kurulum

0 Min Read
logo 1

Bilişim sektöründe uzun süreden beri tecrübe edinerek bir yerlere gelmek için çalışmalarına devam eden ve sektörü yakından takip ederek hiç bir veriden geri kalmayan, girişimci ruhu ile tüm işlere elinden geldiğinde çalışma yapan bir girişimciyim.

Başlıklar

  • Gündem
  • Teknoloji
  • Karşılaştırma
  • WordPress
  • Seo
  • Internet
  • Nasıl Yapılır?
  • Nedir?

Sponsor Bağlantılar

  • Kocaeli Web Tasarım
  • VDS Satın Al
  • Hosting

Web Tasarım Teklifi Alın

Kocaeli Dijital ile tanışın ve hemen web sitesi veya seo teklifi alın!
Ziyaret Et
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?