Apache2-浏览器共享文件夹

1,修改/etc/apache2/sites-enabled目录下软连接内容
增加标签virtualhost标签

<VirtualHost *:8888>
    ServerName ip地址

    # 设置共享文件的根目录
    DocumentRoot 文件路径

    # 允许显示目录内容
    <Directory 文件路径>
        Options +Indexes
        AllowOverride None
        Require all granted
        <FilesMatch "\.(zip|txt|jpg|png|img)$">
            Header set Content-Disposition "attachment"
        </FilesMatch> 
    </Directory>

    # 日志文件配置
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

2,修改上一级目录port.config的监听端口,增加8888端口

posted @ 2025-04-09 14:17  东岸  阅读(22)  评论(0)    收藏  举报