我有一个生成self-signed证书的 bash 脚本并且运行良好:
#! /bin/bash
# Generate self signed root CA cert
openssl req -nodes -x509 -days 358000 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=IR/ST=TEH/L=Torento/O=CTO/OU=root/CN=es.example.com/emailAddress=info@example.com"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -days 358000 -keyout server.key -out server.csr -subj "/C=IR/ST=TEH/L=Torento/O=CTO/OU=server/CN=es.example.com/emailAddress=info@example.com"
# Sign the server cert
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
# Create server PEM file
cat server.key server.crt > server.pem
# Generate client cert to …Run Code Online (Sandbox Code Playgroud) 我有一个服务器块,我的站点所在的位置。在该块内,我添加了一个location块,如下所示:
server {
...
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
...
}
Run Code Online (Sandbox Code Playgroud)
当我用 Y 检查过期标头时!慢什么都没有缓存!
注意:我在测试之前重新加载了我的配置文件。
编辑 1:
我注意到更改任何静态文件不会反映浏览器的新更改。这个缓存是指服务器端缓存吗?我们不能在客户端浏览器上缓存吗?
编辑2:
HTTP/1.0 200 OK
Server: nginx
Date: Tue, 23 Sep 2014 07:41:20 GMT
Content-Type: image/png
Content-Length: 5597
Last-Modified: Wed, 30 Jul 2014 22:50:19 GMT
ETag: "53d976ab-15dd"
Accept-Ranges: bytes
Age: 30396
Connection: close
Run Code Online (Sandbox Code Playgroud)
编辑 3:
完整的 nginx 配置:
# You may add here your
# server {
# ...
# …Run Code Online (Sandbox Code Playgroud) 这些问题没有帮助:
https://askubuntu.com/questions/172030/how-to-allow-bind-in-app-armor
无法启动 BIND9
我想开始bind9并看到它给出了syslog以下拒绝的许可:
Feb 8 09:37:24 aname named[27278]: automatic empty zone: A.E.F.IP6.ARPA
Feb 8 09:37:24 aname named[27278]: automatic empty zone: B.E.F.IP6.ARPA
Feb 8 09:37:24 aname named[27278]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Feb 8 09:37:24 aname named[27278]: command channel listening on 127.0.0.1#953
Feb 8 09:37:24 aname named[27278]: command channel listening on ::1#953
Feb 8 09:37:24 aname named[27278]: isc_stdio_open '/var/log/bind9/query.log' failed: permission denied
Feb 8 09:37:24 aname named[27278]: configuring logging: permission denied
Feb 8 09:37:24 aname named[27278]: …Run Code Online (Sandbox Code Playgroud) 问题有点长!让我用下面的例子来解释。一世
有一个/etc/logrotate.d/用于 uwsgi的日志轮换配置文件:
"/var/log/uwsgi/*.log" "/var/log/uwsgi/*/*.log" {
copytruncate
daily
rotate 5
compress
delaycompress
missingok
notifempty
}
Run Code Online (Sandbox Code Playgroud)
假设我有大约 12 个 uwsgi 模块,我想保留一个 uwsgi 应用程序日志文件比其他模块多,所以我有如下配置:
/var/log/uwsgi/app/MY_APP.log {
daily
missingok
rotate 60
compress
delaycompress
notifempty
create 0640 www-data adm
}
Run Code Online (Sandbox Code Playgroud)
现在的问题是我应该如何像上面那样创建日志轮换并保留*其他 11 个模块。我不想用相同的配置创建 11 个日志轮换,我应该怎么做才能只覆盖一个模块?