使用LAMP搭建私有云储存
-
关闭防火墙和SeLinux
创建配置文件,将原来 的配置重命名
[root@server ~]# mv /etc/httpd/conf.d/xiao.conf /etc/httpd/conf.d/xiao.conf.bak
[root@server ~]# vim /etc/httpd/conf.d/xiao.conf
<Virtualhost 192.168.145.128:80>
DocumentRoot /luntan
ServerName 192.168.145.128
</Virtualhost>
<Directory /luntan>
AllowOverride none
Require all granted
</Directory>
[root@server ~]# mkdir /luntan
[root@server ~]# cd /luntan
[root@server luntan]#
用xftp传输文件包
查看压缩包,并解压
[root@server luntan]# ll
total 11492
-rw-r--r-- 1 root root 11766137 Jul 11 18:00 Discuz_X3.5_SC_UTF8_20230316.zip
[root@server luntan]# unzip Discuz_X3.5_SC_UTF8_20230316.zip #解压
[root@server luntan]# ll
total 11616
-rw-r--r-- 1 root root 11766137 Jul 11 18:00 Discuz_X3.5_SC_UTF8_20230316.zip
-rw-r--r-- 1 root root 8181 Mar 17 09:42 LICENSE
-rw-r--r-- 1 root root 33294 Dec 21 2022 qqqun.png
drwxr-xr-x 2 root root 124 Mar 17 09:52 readme
-rw-r--r-- 1 root root 70226 Mar 16 19:54 readme.html
drwxr-xr-x 12 root root 4096 Mar 17 09:52 upload
-rw-r--r-- 1 root root 140 Feb 12 15:13 utility.html
[root@server luntan]# cd upload/
[root@server upload]# systemctl restart httpd
安装php*所有文件
[root@server upload]# yum install php*
下载数据库
[root@server upload]# yum install mariadb-server -y
[root@server upload]# systemctl restart mariadb #启动
[root@server upload]# mysql_secure_installation #数据库提供默认用户密码初始化命令
[root@server upload]# mysql -uroot -predhat
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.5.16-MariaDB MariaDB Server
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)]> create database luntan;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> use luntan;
Database changed
MariaDB [luntan]> show tables;
Empty set (0.000 sec)
MariaDB [luntan]> exit
Bye
[root@server upload]# systemctl restart mariadb.service
搜索192.168.145.128/upload
修改上图权限
[root@server upload]# chmod 777 config data uc_* -R
刷新后出现如图
完成搭建
二、搭建一个动态网站步骤
1.关闭防火墙和seLinux
[root@server ~]# systemctl stop firewalld
[root@server ~]# vim /etc/httpd/conf.d/xiao.conf
[root@server ~]# curl http://192.168.145.130
this is 130
[root@server ~]# yum install php -y
[root@server ~]# rm -rf /www/130/index.html
[root@server ~]# vim /www/130/index.php
<?php phpinfo(); ?>
[root@server ~]# systemctl restart httpd