小编Cal*_*leb的帖子

在 puppet 中使用数组

我有一个变量$IP = [ "91" , "92" ]$IPPriveeInstance = "10.248.33.$IP".

你猜对了,我想使用这个变量 2 次,但是当我打印时IPPriveeInstance,我得到的输出为 10.248.33.9192。

puppet

3
推荐指数
1
解决办法
9134
查看次数

htaccess 拒绝访问当前目录?

我想拒绝访问目录/foo/secret。

如果我在 /foo/secret 中创建一个 .htaccess 文件,使用...

<Directory ./>
        Order deny,Allow
        Deny from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

...我收到一个“500 内部服务器错误”,虽然达到了预期的结果,但不是我期待的“403 禁止”消息。

我知道您应该在Directory指令中放置一个绝对路径,但我将其提交到代码存储库中,并且远程客户端不一定会在同一路径中运行。

.htaccess apache-2.2

3
推荐指数
1
解决办法
6504
查看次数

如何使用 GoDaddy 共享主机设置 MongoDB?

我想使用 GoDaddy 共享主机 (Linux) 设置 MongoDB。我已经启用了 SSH 访问。我可以在文档根目录之外成功上传、提取和运行 MongoDB。

但是,我如何确保 MongoDB 始终运行并准备好接受事务?我怎样才能访问它?

linux godaddy mongodb apache-2.2

3
推荐指数
1
解决办法
2万
查看次数

使用 iptables 仅允许来自指定 IP 地址的流量

我有一个专用服务器(我只使用实验室/测试环境)。在服务器上运行 CentOS 5.6 并且它作为 KVM 主机运行。

为了稍微保护一些东西,我想执行以下操作,使用“iptables”来仅允许来自某些 IP 地址(我自己的地址)的流量。

我当前的iptables配置如下所示:

[kvm]# iptables -L -v
Chain INPUT (policy ACCEPT 4927K packets, 6424M bytes)
 pkts bytes target     prot opt in     out     source               destination         
   41  2744 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain 
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain 
   66 21810 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps 
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps 
3573K 3515M fail2ban-SSH …
Run Code Online (Sandbox Code Playgroud)

ip iptables address kvm-virtualization

3
推荐指数
1
解决办法
6083
查看次数

服务器机房规格标准

有没有人知道服务器机房或数据中心(任何规模)的任何标准或指南?我正在为设计提出建议,尽管有些事情是从经验中得出的,但遵循一些标准做法会很好。

server-room

3
推荐指数
1
解决办法
2721
查看次数

超安全 Linux 服务器 仅限 SSH

我正在设置一个仅用于存储加密文件的安全服务器,但需要从 Internet 访问它。服务器本身位于安全的位置,没有物理访问权限,这很好,但我更担心互联网方​​面。我正在考虑在没有其他软件的情况下使用 Ubuntu,除了开放的 ssh。

如何设置 iptables 以阻止除 ssh 之外的所有连接?以及如何设置 open ssh 以锁定超过 2 次的失败尝试?

security linux ssh iptables

2
推荐指数
1
解决办法
981
查看次数

忽略行 grep

我正在运行的进程输出了一条非常烦人的消息。我宁愿不删除该行,而只需使用 grep 将其删除

要忽略的所有消息都包含“请求”一词。我可以很容易地只用这些行

$> myproc | grep requests
Run Code Online (Sandbox Code Playgroud)

我将如何使 grep 而不是 IGNORE 行与单词请求?

grep regex ignore

2
推荐指数
1
解决办法
318
查看次数

443端口的nginx + apache问题

这是端口 443 的 nginx 配置:

server {
    listen           *:443;
    server_name      site.com;

    ssl         on;
    ssl_protocols       SSLv3 TLSv1;
    ssl_certificate     /www/certs/site.com.crt;
    ssl_certificate_key /www/certs/site.com.key;

     access_log /var/log/nginx.site.com-access_log;
    location ~* .(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
        root /www/site.com/;
        index index.html index.php;
        access_log off;
        expires 30d;
    }
    location ~ /.ht {
        deny all;
    }
    location / {
        proxy_pass http://127.0.0.1:81/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $remote_addr;
        proxy_set_header Host $host;
        proxy_connect_timeout 60;
        proxy_send_timeout 90;
        proxy_read_timeout 90;
        proxy_redirect off;
        proxy_set_header Connection close;
        proxy_pass_header Content-Type;
        proxy_pass_header Content-Disposition;
        proxy_pass_header Content-Length;
    }
}
Run Code Online (Sandbox Code Playgroud)

问题 1:为什么要求我输入 PEM …

ssl debian nginx port apache-2.2

2
推荐指数
1
解决办法
3462
查看次数

如何在 RHEL 6 上安装 PostgreSQL 9?

我是 RHEL 6 的新手,但有一个项目需要 postgres 9 数据库,而我只有 RHEL 6 可用。我怎样才能安全地做到这一点?我应该从源代码安装还是某个地方有软件包?

postgresql linux redhat

2
推荐指数
1
解决办法
5792
查看次数

ssh root@domain - 如何指定密码?

我需要编写一个脚本来备份旧服务器上的数据库并将它们移动到我的新服务器上。我有大约 150 个,因此需要将其自动化。我发现了这个:

$ mysqldump -u username -p'password' db-name | ssh user@remote.box.com mysql -u username -p'password' db-name
Run Code Online (Sandbox Code Playgroud)

这将允许我这样做,但是,它需要我在每次运行时指定一个密码。如何使 ssh 命令采用密码参数?我试过了,ssh --help但什么也看不到。

如果这个命令不能接受密码,我可以用另一种方式吗?

linux ssh ssh-tunnel

2
推荐指数
2
解决办法
4251
查看次数