环境:服务环境:centos7.4

说明:搭建Apache文件服务器,下载路径为/opt/ymyg(下载路径根据实际需要自己定义)

Centos7.4系统    httpd模式搭建文件服务器

 

 

 

步骤:

1、安装httpd服务

  [root@localhost ~]# yum -y install httpd

2、启动服务并查看服务状态

[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl status httpd

3、修改端口和访问路径(根据实际需求进行)

[root@localhost ~]# vi /etc/httpd/conf/httpd.conf 

Listen 21288         #修改端口,默认80端口。

DocumentRoot "/opt/ymyg"  #修改路径
#修改路径
<Directory "/opt/ymyg">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/opt/ymyg">
    #
...略

Centos7.4系统    httpd模式搭建文件服务器

 

 Centos7.4系统    httpd模式搭建文件服务器

 

4、重启服务

[root@localhost ~]# systemctl restart httpd

5、查看页面是否正常

Centos7.4系统    httpd模式搭建文件服务器

 

 

 6、删除或备份apache的欢迎页面

[root@localhost ~]# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf-bak

7、重启服务

[root@localhost ymyg]# systemctl restart httpd

8、再次访问页面

Centos7.4系统    httpd模式搭建文件服务器

 

 

结束

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-06-05
  • 2021-06-15
  • 2021-05-14
  • 2022-02-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-10-27
  • 2021-05-09
  • 2021-05-30
  • 2021-12-29
相关资源
相似解决方案