使用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值