当前位置:   article > 正文

LNMP搭建kodcloud个人私有网盘_lnmp+kod

lnmp+kod

本次实验基于Linux+Nginx+MySQL+Php搭建,除此以外需要搭建DNS服务器以及Redis服务器,除此以外服务器系统版本为rocky8.5版本。

拓扑图:

1.配置DNS-Server

  1. #注意我设置的域名为www.jason.org
  2. [root@dns-server ~]#yum -y install bind bind-utis
  3. [root@dns-server ~]#vim /etc/named.conf
  4. options {
  5. listen-on port 53 { localhost; }; #修改此内容
  6. allow-query { any; }; #修改此内容
  7. [root@dns-server ~]#vim /etc/named.rfc1912.zones #添加以下内容
  8. zone "jason.org" IN {
  9. type master;
  10. file "jason.org.zone";
  11. };
  12. [root@dns-server ~]#vim /var/named/jason.org.zone #添加以下内容
  13. $TTL 1D
  14. @ IN SOA master admin (
  15. 1 ; serial
  16. 1D ; refresh
  17. 1H ; retry
  18. 1W ; expire
  19. 3H ) ; minimum
  20. NS master
  21. master A 10.0.0.7
  22. www A 10.0.0.8
  23. [root@dns-server ~]#systemctl enable --now named #启动DNS服务
  24. [root@dns-server ~]#ss -ntl #出现53端口就ok
  25. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  26. LISTEN 0 10 10.0.0.7:53 *:*
  27. LISTEN 0 10 127.0.0.1:53 *:*
  28. LISTEN 0 128 *:22 *:*
  29. LISTEN 0 128 127.0.0.1:953 *:*
  30. LISTEN 0 100 127.0.0.1:25 *:*
  31. LISTEN 0 128 *:111 *:*
  32. LISTEN 0 10 [::1]:53 [::]:*
  33. LISTEN 0 128 [::]:22 [::]:*
  34. LISTEN 0 128 [::1]:953 [::]:*
  35. LISTEN 0 100 [::1]:25 [::]:*
  36. LISTEN 0 128 [::]:111 [::]:*

2.配置LNP

  1. #nginx可以yum安装或者编译安装,编译安装可以参考我之前写的关于nginx编译安装的教程
  2. [root@LNP-Server ~]#yum -y install php php-mysqlnd php-json php-xml php-gd php-mbstring
  3. [root@LNP-Server ~]#vim /apps/nginx/conf/nginx.conf
  4. # location / {
  5. # root html;
  6. # index index.html index.htm;
  7. # }
  8. #}
  9. include /apps/nginx/conf/conf.d/*.conf; #在最后一行添加以西内容
  10. }
  11. [root@LNP-Server ~]#mkdir /apps/nginx/conf/conf.d
  12. [root@LNP-Server ~]#ln -s /apps/nginx/sbin/nginx /usr/bin/
  13. [root@LNP-Server ~]#cd /apps/nginx/conf/conf.d/
  14. [root@LNP-Server conf.d]#vim pc.conf
  15. [root@LNP-Server conf.d]#vim pc.conf
  16. server {
  17. server_name www.jason.org;
  18. root /apps/nginx/html/;
  19. index index.html;
  20. }
  21. [root@LNP-Server ~]#cd /apps/nginx/html
  22. [root@LNP-Server html]#vim index.html
  23. <p> this is my websit </p>
  24. [root@LNP-Server html]#nginx -t
  25. nginx: the configuration file /apps/nginx/conf/nginx.conf syntax is ok
  26. nginx: configuration file /apps/nginx/conf/nginx.conf test is successful
  27. [root@LNP-Server html]#nginx -s reload
  28. [root@LNP-Server html]#mkdir -p /data/php
  29. [root@LNP-Server ~]#vim /apps/nginx/conf/conf.d/pc.conf
  30. server {
  31. listen 80;
  32. server_name www.jason.org;
  33. root /data/php/;
  34. client_max_body_size 200M;
  35. location / {
  36. index index.php index.html;
  37. }
  38. location ~ \.php$ {
  39. fastcgi_pass 127.0.0.1:9000;
  40. fastcgi_index index.php;
  41. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  42. include fastcgi_params;
  43. }
  44. location ~ ^/(ping|pm_status)$ {
  45. fastcgi_pass 127.0.0.1:9000;
  46. fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
  47. include fastcgi_params;
  48. }
  49. }
  50. [root@LNP-Server conf.d]#nginx -t
  51. nginx: the configuration file /apps/nginx/conf/nginx.conf syntax is ok
  52. nginx: configuration file /apps/nginx/conf/nginx.conf test is successful
  53. [root@LNP-Server conf.d]#nginx -s reload

3.配置MySQL

  1. [root@MySQL-Server ~]#yum -y install mysql-server
  2. [root@MySQL-Server ~]#systemctl enable --now mysql-server
  3. [root@MySQL-Server ~]#ss -ntl
  4. State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
  5. LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
  6. LISTEN 0 70 *:33060 *:*
  7. LISTEN 0 128 *:3306 *:*
  8. LISTEN 0 128 [::]:22 [::]:*
  9. [root@MySQL-Server ~]#mysql
  10. mysql> create database kodbox;
  11. Query OK, 1 row affected (0.00 sec)
  12. mysql> create user kodbox@'10.0.0.%' identified by '123456';
  13. Query OK, 0 rows affected (0.01 sec)
  14. mysql> grant all on kodbox.* to kodbox@'10.0.0.%';
  15. Query OK, 0 rows affected (0.01 sec)

4.配置redis

  1. [root@Redis-Server ~]#yum -y install redis
  2. [root@Redis-Server ~]#systemctl enable --now redis
  3. [root@Redis-Server ~]#ss -ntl
  4. State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
  5. LISTEN 0 128 127.0.0.1:6379 0.0.0.0:*
  6. LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
  7. LISTEN 0 128 [::]:22 [::]:*
  8. [root@Redis-Server ~]#vim /etc/redis.conf
  9. #bind 127.0.0.1 #修改为 bind 0.0.0.0
  10. [root@Redis-Server ~]#systemctl restart redis

5.配置php

  1. [root@LNP-Server ~]#vim /etc/php.ini
  2. upload_max_filesize = 200M
  3. #修改以下内容

[root@LNP-Server ~]#systemctl restart php-fpm.service

 

 

  1. [root@LNP-Server ~]#vim /etc/php-fpm.d/www.conf #修改文件
  2. user = nginx
  3. group = nginx
  4. listen = 127.0.0.1:9000
  5. pm.status_path = /fpm_status
  6. ping.path = /pong
  7. #安装模块包
  8. [root@LNP-Server ~]#wget https://pecl.php.net/get/redis-5.3.7.tgz
  9. [root@LNP-Server ~]#tar xf redis-5.3.7.tgz
  10. [root@LNP-Server ~]#cd redis-5.3.7/
  11. [root@LNP-Server redis-5.3.7]#yum -y install php-cli php-devel
  12. [root@LNP-Server redis-5.3.7]#phpize
  13. Configuring for:
  14. PHP Api Version: 20170718
  15. Zend Module Api No: 20170718
  16. Zend Extension Api No: 320170718
  17. [root@LNP-Server redis-5.3.7]#./configure
  18. [root@LNP-Server redis-5.3.7]#make -j 2 && make install
  19. .............................
  20. See any operating system documentation about shared libraries for
  21. ## more information, such as the ld(1) and ld.so(8) manual pages.
  22. Build complete.
  23. Don't forget to run 'make test'.
  24. Installing shared extensions: /usr/lib64/php/modules/
  25. [root@LNP-Server redis-5.3.7]#ll /usr/lib64/php/modules/
  26. [root@LNP-Server redis-5.3.7]#vim /etc/php.d/31-redis.ini
  27. ;listen = /run/php-fpm/www.sock
  28. extension=redis
  29. [root@LNP-Server redis-5.3.7]#systemctl enable --now php-fpm
  30. [root@LNP-Server redis-5.3.7]#ss -ntl
  31. State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
  32. LISTEN 0 128 127.0.0.1:9000 0.0.0.0:*
  33. LISTEN 0 128 0.0.0.0:111 0.0.0.0:*
  34. LISTEN 0 128 0.0.0.0:80 0.0.0.0:*
  35. LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
  36. LISTEN 0 128 [::]:111 [::]:*
  37. LISTEN 0 128 [::]:22 [::]:*
  38. #下载可到云
  39. [root@rocky8 ~]#wget https://static.kodcloud.com/update/download/kodbox.1.27.zip
  40. [root@rocky8 ~]#mv kodbox.1.27.zip /data/php/
  41. [root@rocky8 ~]#cd /data/php/
  42. [root@rocky8 php]#unzip kodbox.1.27.zip
  43. [root@rocky8 ~]#chown -R nginx.nginx /data/php

打开浏览器输入www.jason.org

 填写信息

 设置密码

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/59989
推荐阅读
相关标签
  

闽ICP备14008679号