继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

搭建文件服务器

qq_小欢_1
关注TA
已关注
手记 43
粉丝 1
获赞 4

下载httpd

yum install -y httpd

看看成功了没有

配置监听端口和隐藏目录

vim /etc/httpd/conf/httpd.conf

修改端口

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the 
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 9090

去掉Indexes,这样页面就看不到目录结构了


    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options   FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted


systemctl restart httpd
netstat -nltp | grep 9090

指定目录

先到默认的映射地址下

cd /var/www/html/

接下来加一个软件映射存放文件的目录

ln -s /opt/file/ file

访问

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP