我已经为 logrotate 设置了新的 conf,但我无法让它工作。
这是我的 logrotate:
/home/deployer/abc/shared/log/*.log {
daily
missingok
rotate 30
compress
delaycompress
size 5M
copytruncate
}
Run Code Online (Sandbox Code Playgroud)
这是我尝试过的:
删除状态文件:
deployer@qapp01:~/abc/current/log$ cat /var/lib/logrotate/status
logrotate state -- version 2
Run Code Online (Sandbox Code Playgroud)
使用调试模式运行 logrotate
deployer@qapp01:~/abc/current/log$ /usr/sbin/logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apt
reading config file aptitude
reading config file dpkg
reading config file fail2ban
reading config file monit
reading config file mysql-server
reading config file newrelic-sysmond
reading config file nginx
reading config file ppp
reading config file abc …
Run Code Online (Sandbox Code Playgroud) 服务器重新启动后,该命令均无效。请帮忙。
development@q1:~$ ls
-bash: ls: command not found
development@q1:~$ ECHO $PATH
-bash: ECHO: command not found
development@q1:~$ echo $PATH
/usr/lib/ruby/gems/1.8
development@q1:~$ sudo apt-get update
-bash: sudo: command not found
development@q1:~$
Run Code Online (Sandbox Code Playgroud) 我有两个域:staging.abc.com
并www.example.com
指向我 DNS 中的同一个服务器 IP。我没有为 启用/可用的站点staging.abc.com
,但我有一个用于www.example.com
. 但是,每当我访问时staging.abc.com
,它都指向www.example.com
.
这是我conf
的。我的/etc/nginx/nginx.conf
是默认的。我没有改变任何东西。
我没有sites-available/default
。它已被移除。
# sites-available/example
server {
listen 80;
server_name example.com;
return 301 http://www.example.com$request_uri;
}
server {
listen 80;
listen [::]:80;
root /home/deployer/example;
index index.php index.html index.htm;
server_name www.example.com;
location ~* .(jpg|jpeg|png|gif|ico|css|js|woff)$ {
expires 30d;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html { …
Run Code Online (Sandbox Code Playgroud) 我一直有一些机器人试图通过大规模攻击/sertup/scripts.php
各种数据库程序来控制我的数据库。我想禁止此类活动。
我找到的最接近的是这个:http : //www.rubyrobot.org/article/protect-your-web-server-from-spambots
最好的方法是什么,或者有什么脚本可以禁止机器人攻击?
谢谢。