“Lnmp”的版本间的差异
跳到导航
跳到搜索
小 (导入1个版本) |
|||
(未显示同一用户的6个中间版本) | |||
第1行: | 第1行: | ||
=start= | =start= | ||
+ | =How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10 debinalnmp = | ||
+ | <pre> | ||
+ | # for zabbix | ||
+ | apt install php7.3-bcmath php7.3-mbstring php7.3-gd php7.3-xml libxml++2.6-dev | ||
+ | |||
+ | #kali | ||
+ | apt install php7.4-bcmath php7.4-mbstring php7.4-gd php7.4-xml libxml++2.6-dev #apt install php7.4-bcmath php7.4-mbstring php7.4-gd php7.4-xml libxml++2.6-dev | ||
+ | |||
+ | sudo apt update | ||
+ | sudo apt install nginx | ||
+ | |||
+ | |||
+ | sudo apt install mariadb-server | ||
+ | sudo mysql_secure_installation #可能不生效? | ||
+ | |||
+ | sudo apt install php-fpm php-mysql | ||
+ | your_domain=za.com | ||
+ | sudo mkdir /var/www/${your_domain} | ||
+ | |||
+ | sudo chown -R $USER:$USER /var/www/${your_domain} | ||
+ | |||
+ | sudo vi /etc/nginx/sites-available/${your_domain} | ||
+ | |||
+ | /etc/nginx/sites-available/your_domain | ||
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | |||
+ | root /var/www/your_domain; | ||
+ | index index.php index.html index.htm; | ||
+ | |||
+ | server_name your_domain; | ||
+ | |||
+ | location / { | ||
+ | try_files $uri $uri/ =404; | ||
+ | } | ||
+ | |||
+ | location ~ \.php$ { | ||
+ | include snippets/fastcgi-php.conf; | ||
+ | fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/ | ||
+ | |||
+ | nginx -t && systemctl reload nginx | ||
+ | |||
+ | |||
+ | vi /var/www/your_domain/info.php | ||
+ | |||
+ | |||
+ | /var/www/your_domain/info.php | ||
+ | <?php | ||
+ | phpinfo(); | ||
+ | ?> | ||
+ | |||
+ | http://your_domain/info.php | ||
+ | |||
+ | |||
+ | |||
+ | </pre> | ||
+ | |||
+ | |||
+ | [https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mariadb-php-lemp-stack-on-debian-10 How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10] | ||
=参考= | =参考= | ||
+ | 改ng.conf 要记得重启 | ||
+ | |||
[http://www.wdlinux.cn/lanmp/install.html wdlinux phps.sh] | [http://www.wdlinux.cn/lanmp/install.html wdlinux phps.sh] | ||
[[category:ops]] [[category:linux]] [[category:shell]] | [[category:ops]] [[category:linux]] [[category:shell]] |
2021年7月20日 (二) 03:44的最新版本
start
How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10 debinalnmp
# for zabbix apt install php7.3-bcmath php7.3-mbstring php7.3-gd php7.3-xml libxml++2.6-dev #kali apt install php7.4-bcmath php7.4-mbstring php7.4-gd php7.4-xml libxml++2.6-dev #apt install php7.4-bcmath php7.4-mbstring php7.4-gd php7.4-xml libxml++2.6-dev sudo apt update sudo apt install nginx sudo apt install mariadb-server sudo mysql_secure_installation #可能不生效? sudo apt install php-fpm php-mysql your_domain=za.com sudo mkdir /var/www/${your_domain} sudo chown -R $USER:$USER /var/www/${your_domain} sudo vi /etc/nginx/sites-available/${your_domain} /etc/nginx/sites-available/your_domain server { listen 80; listen [::]:80; root /var/www/your_domain; index index.php index.html index.htm; server_name your_domain; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; } } sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/ nginx -t && systemctl reload nginx vi /var/www/your_domain/info.php /var/www/your_domain/info.php <?php phpinfo(); ?> http://your_domain/info.php
How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10
参考
改ng.conf 要记得重启