Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Docker installing and running apache2 Server as Picture Server

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Installation

Docker pull httpd

two。 Create a folder

Mkdir-p / usr/docker_data/statics / / usr/docker_data/httpd/logs/ / usr/docker_data/httpd/conf/

Explanation: statics folder mapping picture file storage path logs mapping log file path conf mapping configuration file path

3. Trial operation of httpd

Docker run-it-- name test-httpd httpd bash

4. Go to the conf folder and copy the httpd.conf file to / usr/docker_data/httpd/conf/

5. Modify httpd.conf

Replace Options Indexes FollowSymLinks with Options FollowSymLinks

The purpose is to set that path information is not accessible and can only be accessed through the file name

6. Stop and delete the container test-httpd you just tested

7. Officially run httpd

Docker run-- restart=always-- privileged=true-- name httpd-p 98:80-v / usr/docker_data/statics/:/usr/local/apache2/htdocs/-v / usr/docker_data/httpd/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf-v / usr/docker_data/httpd/logs/:/usr/local/apache2/logs/-v / etc/localtime:/etc/localtime:ro-d httpd

8. Externally access pictures through the path of http:IP:98/ picture file

The above is the editor to introduce to you the method of Docker installation and running apache2 server to do picture server, hope to help you, if you have any questions, please leave me a message, the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report