apache文件服务器
#案例
[root@cloud ~]# yum install -y httpd
[root@cloud ~]# mkdir /cloud
[root@cloud ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)[root@cloud ~]# cd /cloud/
[root@cloud cloud]# touch file{1..10}
[root@cloud cloud]# ls
file1 file10 file2 file3 file4 file5 file6 file7 file8 file9
[root@cloud cloud]# mkdir folder{1..10}
[root@cloud cloud]# ls
file1 file2 file4 file6 file8 folder1 folder2 folder4 folder6 folder8
file10 file3 file5 file7 file9 folder10 folder3 folder5 folder7 folder9[root@cloud cloud]# cp -rf /cloud /var/www/html/
[root@cloud cloud]# ls /var/www/html/
cloud
#文件服务器启动
[root@cloud cloud]# systemctl enable httpd --now
[root@cloud cloud]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2024-04-14 02:31:32 EDT; 9min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 2149 (httpd)
Status: "Total requests: 31; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─2149 /usr/sbin/httpd -DFOREGROUND
├─2150 /usr/sbin/httpd -DFOREGROUND
├─2151 /usr/sbin/httpd -DFOREGROUND
├─2152 /usr/sbin/httpd -DFOREGROUND
├─2153 /usr/sbin/httpd -DFOREGROUND
├─2163 /usr/sbin/httpd -DFOREGROUND
├─2164 /usr/sbin/httpd -DFOREGROUND
├─2165 /usr/sbin/httpd -DFOREGROUND
├─2166 /usr/sbin/httpd -DFOREGROUND
├─2167 /usr/sbin/httpd -DFOREGROUND
└─2168 /usr/sbin/httpd -DFOREGROUNDApr 14 02:31:31 cloud systemd[1]: Starting The Apache HTTP Server...
Apr 14 02:31:32 cloud httpd[2149]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::... message
Apr 14 02:31:32 cloud systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.[root@cloud cloud]# netstat -ntlp | grep 80
tcp6 0 0 :::80 :::* LISTEN 2149/httpd
网页登录IP: http://192.168.31.112/cloud/