sidre.eu online

Gönderen Konu: nginx php7 mariadb - Debian 9  (Okunma sayısı 108 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

sidre

  • Administrator
  • *****
  • İleti: 34
nginx php7 mariadb - Debian 9
« : Ekim 20, 2019, 09:03:29 ös »
Debian 10 (Buster) için İnglizce farklı bir yöntem, linke tıklayın: https://www.linuxbabe.com/debian/install-lemp-stack-debian-10-buster
Debian 10 (Buster) sürümünde denendi.



Alttaki bilgiler alıntıdır fakat başarılı olacağına dair garantisi yoktur.

Debian 8/9 için Gerekli komutlar:

NGINX Webserver
Kod: [Seç]
apt update
apt upgrade
apt install nginx

MariaDB
Kod: [Seç]
apt install mariadb-client mariadb-server
Kod: [Seç]
mysql_secure_installation
PHP 7
Kod: [Seç]
apt install php7.0
mcrypt
Kod: [Seç]
apt install libmcrypt-dev
NGINX Conf
Kod: [Seç]
cd /etc/nginx/sites-available/
Kod: [Seç]
mv default default.bak
Kod: [Seç]
touch <alanadı.com.tr>
ln -s /etc/nginx/sites-available/<alanadi.com.tr> /etc/nginx/sites-enabled/<alanadi.com.tr>
Kod: [Seç]
server {
    listen 80;
    listen [::]:80;
    server_name <alanadi.com.tr> www.<alanadi.com.tr> ;
   

    # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name <alanadi.com.tr>  www.<alanadi.com.tr>;

    ssl on;
    ssl_certificate /etc/letsencrypt/live/<alanadi.com.tr>/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/<alanadi.com.tr>/privkey.pem;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;

    # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
    ssl_dhparam /etc/letsencrypt/live/<alanadi.com.tr>/dh.pem;

    ssl_protocols TLSv1.2;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
    ssl_prefer_server_ciphers on;


    # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
   
    # OCSP Stapling ---
    # fetch OCSP records from URL in ssl_certificate and cache them
    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /etc/letsencrypt/live/<alanadi.com.tr>/chain.pem;
    resolver 8.8.8.8;

   
    root /var/www/html/;
    index index.html index.htm index.php;

    #X-Frame-Options
    add_header X-Frame-Options "SAMEORIGIN";

    #X-XSS-Protection
    add_header x-xss-protection "1; mode=block" always;

    #aktiviert X-Content-Type-Options
    add_header X-Content-Type-Options "nosniff" always;

   
    #PHP5
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

    #PHP7
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;

        }
}

Sunucuyu yeniden çalıştır:
Kod: [Seç]
service nginx restart

« Son Düzenleme: Ekim 20, 2019, 10:12:11 ös Gönderen: sidre »

sidre

  • Administrator
  • *****
  • İleti: 34

sidre

  • Administrator
  • *****
  • İleti: 34
SSL certbot on nginx Debian 10
« Yanıtla #2 : Ekim 21, 2019, 12:39:18 öö »