最常被要的默认配置
大家都用得到的 config,直接复制就行。
Apache HTTP Server 配置
Apache HTTP Server 最常被要的默认配置
Apache HTTP Server
Ubuntu 24.04
<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server …
<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redir…
Apache HTTP Server
Red Hat Enterprise Linux 9
# Note that logs are not compressed unless "compress" is configured, # which can be done either here or globa…
# Note that logs are not compressed unless "compress" is configured,
# which can be done either here or globally in /etc/logrotate.conf.
/var/log/httpd/*log {
missin…
Apache HTTP Server
Ubuntu 24.04
# Depends: cache LoadModule cache_disk_module /usr/lib/apache2/modules/mod_cache_disk.so
# Depends: cache LoadModule cache_disk_module /usr/lib/apache2/modules/mod_cache_disk.so
APT 配置
APT 最常被要的默认配置
APT
Debian 9
/var/log/apt/term.log { rotate 12 monthly compress missingok notifempty } /var/log/apt/history.log…
/var/log/apt/term.log {
rotate 12
monthly
compress
missingok
notifempty
}
/var/log/apt/history.log {
rotate 12
monthly
compress
missingok
notifempty…
APT
Debian 9
[Unit] Description=Daily apt download activities [Timer] OnCalendar=*-*-* 6,18:00 RandomizedDelaySec=12h Per…
[Unit] Description=Daily apt download activities [Timer] OnCalendar=*-*-* 6,18:00 RandomizedDelaySec=12h Persistent=true [Install] WantedBy=timers.target
APT
Debian 9
[Unit] Description=Daily apt download activities Documentation=man:apt(8) ConditionACPower=true After=network…
[Unit] Description=Daily apt download activities Documentation=man:apt(8) ConditionACPower=true After=network-online.target Wants=network-online.target [Service] Type=o…
MariaDB 配置
MariaDB 最常被要的默认配置
MariaDB
Debian 9
# # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) shou…
# # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/s…
MariaDB
Debian 9
# Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = root pas…
# Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = root password = socket = /var/run/mysqld/mysqld.sock [mysql_upgra…
MariaDB
Debian 9
#!/bin/bash # # This script is executed by "/etc/init.d/mysql" on every (re)start. # # Changes to this file w…
#!/bin/bash # # This script is executed by "/etc/init.d/mysql" on every (re)start. # # Changes to this file will be preserved when updating the Debian package. # # NOTE:…
MySQL 配置
MySQL 最常被要的默认配置
MySQL
Debian 9
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistri…
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Genera…
MySQL
Debian 9
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistri…
# Copyright (c) 2015, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Genera…
MySQL
Debian 9
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistri…
# Copyright (c) 2014, 2021, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Genera…
NGINX 配置
NGINX 最常被要的默认配置
NGINX
Debian 9
scgi_param REQUEST_METHOD $request_method; scgi_param REQUEST_URI $request_uri; scgi_param QUE…
scgi_param REQUEST_METHOD $request_method; scgi_param REQUEST_URI $request_uri; scgi_param QUERY_STRING $query_string; scgi_param CONTENT_TYPE …
NGINX
Debian 9
/var/log/nginx/*.log { daily missingok rotate 14 compress delaycompress notifempty create 0640 www-dat…
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/h…
NGINX
Debian 9
# Stop dance for nginx # ======================= # # ExecStop sends SIGSTOP (graceful stop) to the nginx proc…
# Stop dance for nginx # ======================= # # ExecStop sends SIGSTOP (graceful stop) to the nginx process. # If, after 5s (--retry QUIT/5) nginx is still running,…
Odoo 配置
Odoo 最常被要的默认配置
Odoo
Debian 9
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep …
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep = , ; db_maxconn = 64 ; db_name = False ; db_template = temp…
Odoo
Red Hat Enterprise Linux 9
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep …
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep = , ; db_maxconn = 64 ; db_name = False ; db_template = temp…
Odoo
CentOS Stream 9
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep …
[options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo ; admin_passwd = admin ; csv_internal_sep = , ; db_maxconn = 64 ; db_name = False ; db_template = temp…
OpenSSH 配置
OpenSSH 最常被要的默认配置
OpenSSH
Ubuntu 20.04
-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS 1z…
-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS 1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQTF/LMKK+jvjm8X8HVDmZkG…
OpenSSH
Debian 9
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAetYiDSxDS6ZZA1uUJlNVPiBfPvWKvBEUks3i4vcZaV root@5bb92bc4eb11
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAetYiDSxDS6ZZA1uUJlNVPiBfPvWKvBEUks3i4vcZaV root@5bb92bc4eb11
OpenSSH
Debian 9
-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW Qy…
-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW QyNTUxOQAAACAHrWIg0sQ0umWQNblCZTVT4gXz71irwRFJLN4uL3GWlQAAAJhA…
OpenSSL 配置
OpenSSL 最常被要的默认配置
OpenSSL
Alpine Linux 3.21
# # OpenSSL example configuration file. # See doc/man5/config.pod for more info. # # This is mostly being use…
# # OpenSSL example configuration file. # See doc/man5/config.pod for more info. # # This is mostly being used for generation of certificate requests, # but may be used …
OpenSSL
Debian 9
# # OpenSSL example configuration file. # This is mostly being used for generation of certificate requests. #…
# # OpenSSL example configuration file. # This is mostly being used for generation of certificate requests. # # This definition stops the following lines choking if HOM…
OpenSSL
Alpine Linux 3.21
# # OpenSSL example configuration file. # See doc/man5/config.pod for more info. # # This is mostly being use…
# # OpenSSL example configuration file. # See doc/man5/config.pod for more info. # # This is mostly being used for generation of certificate requests, # but may be used …
Postfix 配置
Postfix 最常被要的默认配置
Postfix
Debian 9
# # Postfix master process configuration file. For details on the format # of the file, see the master(5) ma…
# # Postfix master process configuration file. For details on the format # of the file, see the master(5) manual page (command: "man 5 master" or # on-line: http://www.…
Postfix
Debian 9
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying…
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be …
Postfix
Debian 9
[Unit] Description=Postfix Mail Transport Agent (instance %i) Documentation=man:postfix(1) PartOf=postfix.ser…
[Unit] Description=Postfix Mail Transport Agent (instance %i) Documentation=man:postfix(1) PartOf=postfix.service Before=postfix.service ReloadPropagatedFrom=postfix.ser…
PostgreSQL 配置
PostgreSQL 最常被要的默认配置
PostgreSQL
Debian 9
/var/log/postgresql/*.log { weekly rotate 10 copytruncate delaycompress co…
/var/log/postgresql/*.log {
weekly
rotate 10
copytruncate
delaycompress
compress
notifempty
missingok
su root roo…
PostgreSQL
Debian 9
# systemd service template for PostgreSQL clusters. The actual instances will # be called "postgresql@version…
# systemd service template for PostgreSQL clusters. The actual instances will # be called "postgresql@version-cluster", e.g. "postgresql@9.3-main". The # variable %i exp…
PostgreSQL
Debian 9
# systemd service for managing all PostgreSQL clusters on the system. This # service is actually a systemd ta…
# systemd service for managing all PostgreSQL clusters on the system. This # service is actually a systemd target, but we are using a service since # targets cannot be r…
Redis 配置
Redis 最常被要的默认配置
Redis
Debian 9
/var/log/redis/redis-server*.log { weekly missingok rotate 12 compress …
/var/log/redis/redis-server*.log {
weekly
missingok
rotate 12
compress
notifempty
}
Redis
Debian 9
[Unit] Description=Advanced key-value store After=network.target Documentation=http://redis.io/documentation,…
[Unit] Description=Advanced key-value store After=network.target Documentation=http://redis.io/documentation, man:redis-server(1) [Service] Type=forking ExecStart=/usr/…
Redis
Alpine Linux 3.21
/var/log/redis/*.log { notifempty missingok }
/var/log/redis/*.log {
notifempty
missingok
}