0% found this document useful (0 votes)
28 views

Nginx Dan PHP

This document outlines the steps to install and configure Nginx, MySQL, and PHP on a Linux server to set up a basic LAMP stack hosting a website called smkdt.com. It installs Nginx, MySQL, and PHP packages, creates a MySQL database, configures Nginx virtual hosts, adds PHP code files, and tests access to the website and info page.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Nginx Dan PHP

This document outlines the steps to install and configure Nginx, MySQL, and PHP on a Linux server to set up a basic LAMP stack hosting a website called smkdt.com. It installs Nginx, MySQL, and PHP packages, creates a MySQL database, configures Nginx virtual hosts, adds PHP code files, and tests access to the website and info page.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1 apt update

2 apt install nginx


3 apt remove apache2
4 ip addr show enp0s3 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
5 http://smkdt.com
6 http://192.168.100.2
7 apt install mysql-server
8 mysql_secure_installation
9 apt install php-fpm php-mysql
10 mkdir /var/www/smkdt
11 nano /etc/nginx/sites-available/smkdt
12 server {
13 listen 80;
14 listen [::]:80;
15
16 root /var/www/smkdt;
17 index index.php index.html index.htm;
18
19 server_name smkdt.com;
20
21 location / {
22 try_files $uri $uri/ =404;
23 }
24
25 location ~ \.php$ {
26 include snippets/fastcgi-php.conf;
27 fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
28 }
29 }
30
31 sudo ln -s /etc/nginx/sites-available/smkdt /etc/nginx/sites-enabled/
32 nginx -t
33 /etc/init.d/nginx restart
34 nano /var/www/smkdt/index.php
35 <?php
36 hai saya smkdt.com;
37 ?>
38
39 nano /var/www/smkdt/info.php
40 <?php
41 phpinfo();
42 ?>
43
44 http://smkdt.com
45 http://192.168.100.2
46
47 http://smkdt.com/index.php
48 http://192.168.100.2/info.php

You might also like