Sign inSign up

davyinsa/cloudrup-static-server

By davyinsa

•Updated almost 2 years ago

Image
0

8.4K

davyinsa/cloudrup-static-server repository overview

⁠介绍

站群系统使用的webserver的docker镜像,基于ubuntu 18.04,安装配置了apache/php/ssh等。

⁠docker-compose example

version: '3'
services:
  static-server:
    image: davyinsa/cloudrup-static-server
    container_name: static-server
    hostname: cloudrup-static-server.docker
    restart: always
    environment:
      - APACHE_MAX_THREAD=100
      - APACHE_MPM_PREFORK_START_SERVERS=30
      - APACHE_MPM_PREFORK_MIN_SPARE_SERVERS=10
      - APACHE_MPM_PREFORK_MAX_SPARE_SERVERS=30
      - APACHE_MPM_PREFORK_MAX_REQUEST_WORKERS=200
      - APACHE_MPM_PREFORK_MAX_CONNECTIONS_PER_CHILD=10000
      - APACHE_MPM_PREFORK_SERVER_LIMIT=300
    volumes:
      - ./aegir:/var/aegir
    ports:
      - "8080:80"
      - "8022:22"
⁠apache config
NameDesciption
APACHE_MPM_PREFORK_START_SERVERSThe config for mpm_prefork module StartServers, default value: 10
APACHE_MPM_PREFORK_MIN_SPARE_SERVERSThe config for mpm_prefork module MinSpareServers, default value: 10
APACHE_MPM_PREFORK_MAX_SPARE_SERVERSThe config for mpm_prefork module MaxSpareServers, default value: 30
APACHE_MPM_PREFORK_MAX_REQUEST_WORKERSThe config for mpm_prefork module MaxRequestWorkers, default value: 200
APACHE_MPM_PREFORK_MAX_CONNECTIONS_PER_CHILDThe config for mpm_prefork module MaxConnectionsPerChild, default value: 2000
APACHE_MPM_PREFORK_SERVER_LIMITThe config for mpm_prefork module ServerLimit, default value: 200
⁠日志处理

默认安装了logrotate.

如果期望使用自定义的方式进行日志处理,建议如下:

运行容器的时候,hosting_log:/etc/logrotate.d/hosting_log

hosting_log内容如下:

  • 按照大小(超过10M进行分割,保留4个文件):
/var/log/aegir/*.log {
         size 10M
         create 644 aegir aegir
         rotate 4
	 dateext
         compress
         copytruncate
}
  • 按照日期(每天一个,保留30天):
/var/log/aegir/*.log {
        daily
        missingok
        rotate 30
        compress
        delaycompress
        notifempty
        create 644 aegir aegir
        sharedscripts
        postrotate
                /etc/init.d/apache2 reload > /dev/null
        endscript
}

Tag summary

Content type

Image

Digest

sha256:0e3518843…

Size

159.2 MB

Last updated

almost 2 years ago

docker pull davyinsa/cloudrup-static-server