apache文件服务器

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 -DFOREGROUND

Apr 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/

  • 16
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SilentCodeY

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值