Kali配置LNMP环境

tomosak2年前Linux720

安装Nginx

└─$ sudo apt-cache policy nginx
nginx:
  已安装:(无)
  候选: 1.22.0-1
  版本列表:     1.22.0-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages                                                                                                                                  
└─$ sudo apt install nginx-full 
└─$ sudo nano /etc/nginx/sites-available/default      //nginx
      

└─$ sudo systemctl start nginx

安装PHP和PHP扩展

┌──(kele㉿Roonready)-[/]
└─$ sudo apt-cache policy php php-fpm
php:
  已安装:(无)
  候选: 2:8.1+92
  版本列表:     2:8.1+92 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
php-fpm:
  已安装:(无)
  候选: 2:8.1+92
  版本列表:     2:8.1+92 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
                                                                                                                                     
┌──(kele㉿Roonready)-[/]
└─$ sudo apt install php8.1 php8.1-fpm
└─$ sudo php -v                       
PHP 8.1.5 (cli) (built: May 16 2022 17:15:25) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies    with Zend OPcache v8.1.5, Copyright (c), by Zend Technologies

配置Nginx和PHP-FPM

└─$ sudo nano /etc/nginx/sites-available/default

        root /home/music;        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;
        server_name _;
        location / {                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }        # pass PHP scripts to FastCGI server
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;        #
        #       # With php-fpm (or other unix sockets):
                fastcgi_pass unix:/run/php/php8.1-fpm.sock;   //php这里注意版本        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        }

└─$ sudo nano /etc/php/8.1/fpm/pool.d/www.conf 
; Note: This value is mandatory.
listen = /run/php/php8.1-fpm.sock

┌──(kele㉿Roonready)-[/]
└─$ sudo systemctl restart nginx.service      
                                                                                                                                     
┌──(kele㉿Roonready)-[/]
└─$ sudo systemctl restart php8.1-fpm.service

测试

┌──(kele㉿Roonready)-[/home/music]
└─$ sudo nano test.php        


ctrl+x

localhost/test.php

安装mariadb

┌──(kele㉿Roonready)-[/]
└─$ sudo apt-cache policy mariadb-server mariadb-client
mariadb-server:
  已安装:(无)
  候选: 1:10.6.8-1
  版本列表:     1:10.6.8-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
mariadb-client:
  已安装:(无)
  候选: 1:10.6.8-1
  版本列表:     1:10.6.8-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages

┌──(kele㉿Roonready)-[/]
└─$ sudo apt install mariadb-server mariadb-client

//启动 mysql

┌──(kele㉿Roonready)-[/]
└─$ sudo systemctl start mariadb.service 

┌──(kele㉿Roonready)-[/]
└─$ sudo mysql                          
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 32Server version: 10.6.8-MariaDB-1 Debian buildd-unstable

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

安装PHP Mysql扩展连接数据库

┌──(kele㉿Roonready)-[/]
└─$ sudo apt-cache policy php8.1-mysql 
php8.1-mysql:
  已安装:(无)
  候选: 8.1.5-1+b1
  版本列表:     8.1.5-1+b1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages

┌──(kele㉿Roonready)-[/]
└─$ sudo apt install php8.1-mysql 

┌──(kele㉿Roonready)-[/]
└─$ sudo nano /home/music/mysql.php


标签: HIFILinux

相关文章

Linux系统中获取有线网卡MAC地址并转换为SHA1哈希值

ip -br link | grep -Ev '^(lo|br)' | awk '{print $3}' | awk 'NR==1...

kali添加Windows分区启动

1、备份grub配置文件sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak2、编辑grub配置文件sudo nano /boot/grub/grub.cfg### BEGIN /etc/grub.d/30_os_prober&n...

ARM系列Linux开发板安装moOde、LMS、RoonBridge、NAA变成HIFI播放器

ARM系列Linux开发板安装moOde、LMS、RoonBridge、NAA变成HIFI播放器推荐固件包下载网站:https://github.com/ophub/https://files.kos.org.cn/https://www.armbian.com/修改系统源nano /etc/apt...

数播网播Daphile系统开通ssh登录

目前,影响较大的数播/网播系统有roon、volumio、moode、daphile,此外还有一个AudioLinux,似乎是个大杂烩,有个开源的Audiophile Linux(AP Linux),很久不更新了。 Daphile是个定制的HIFI数播系统,底层是Gento...

正确看待音响器材的测试数据

正确看待音响器材的测试数据

如果懒得看长文,记住一个最基本的道理即可:用仪器测试音响器材,用的是简单的正弦波信号(THD等测试),而真正播放音乐是高度动态变化的,而功放/耳放所驱动的音箱、耳机,从阻抗到低频响应特性等等都是具有极大差别。所以唯数据论是很低级的行为,特别是某些人更幼稚到把THD失真数据来做音箱器材声音水平的“排名...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。