网络的搭建

发布于:2025-05-07 ⋅ 阅读:(16) ⋅ 点赞:(0)

1、rpm   rpm -ivh
2、yum仓库(rpm包):网络源    ----》网站       
                                         本地源   ----》/dev/sr0   光盘映像文件

3、源码安装
源码安装(编译)
1、获取源码
2、检测环境生成Makefile:   ./configure   
2、编译:make
3、安装:  make  install

-------------------------
4、搭建web页面
httpd    :服务器端的软件,提供web页面
端口:一台计算机上有多个软件,每个软件都有唯一的端口号
端口正在监听--》说明该服务正在工作

ip:99
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0

[root@localhost ~]# yum    install  httpd  -y 
[root@localhost ~]# systemctl  start  httpd
[root@localhost ~]# netstat -lntup | grep httpd

[root@localhost ~]# echo "test  page"  > /var/www/html/index.html
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
Listen 80
[root@localhost ~]# systemctl  restart  httpd
[root@localhost ~]# netstat -lntup | grep httpd

win测试:  http://192.168.50.128:99
C:\Users\TT>curl   192.168.50.130:99
test  page

开始搭建

项目一:网盘搭建

```bash

[root@localhost nextcloud]# mount  /dev/sr0   /mnt

[root@localhost nextcloud]# systemctl stop firewalld.service

[root@localhost nextcloud]# setenforce 0

[root@localhost nextcloud]# yum install httpd

[root@localhost nextcloud]# yum install php php-fpm

[root@localhost nextcloud]# systemctl start   httpd

[root@localhost html]# vim /etc/httpd/conf/httpd.conf

[root@localhost /]# cd /var/www/html/

[root@localhost html]# tar -xf latest.tar.bz2

[root@localhost html]# chown apache:apache  /var/www/html/nextcloud/ -R

[root@localhost html]# yum install php-pecl-zip.x86_64 mariadb- server -y  php-gd.x86_64

[root@localhost html]# systemctl start mariadb.service

[root@localhost html]# mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 3

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)]> alter user root@localhost   identified by 'mypasswd123';

Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> create database wangpan;

Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> show databases;

[root@localhost html]# yum install php-mysqlnd.x86_64

#win浏览器测试:http://192.168.50.130:89/nextcloud

你添加的用户数据可以在数据库里查看到:

[root@localhost files]# mysql  -uroot -p

Enter password:

MariaDB [(none)]> show databases;

MariaDB [(none)]> use wangpan;

MariaDB [wangpan]> show TABLES;

最后出现这个页面:

```


网站公告

今日签到

点亮在社区的每一天
去签到