AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-154732

Daniel W.'s questions

Martin Hope
Daniel W.
Asked: 2017-06-24 00:48:52 +0800 CST

通过 apt 从 live cd 安装包到真实系统

  • 2

我只能通过 live CD 启动,我需要将 Debian 软件包安装firmware-linux-nonfree到我的服务器上才能成功启动。

我怎样才能做到这一点?会chroot帮助我吗?

debian
  • 2 个回答
  • 10705 Views
Martin Hope
Daniel W.
Asked: 2014-08-06 03:55:43 +0800 CST

导出apt包列表以供重用(debian)

  • 2

是否可以从(Debian)服务器导出软件包列表,

所以我可以重复使用这个列表并简单地点击apt-get install <exported_package_list>

在不同的服务器上?

我也可以通过管道将文本文件添加到apt-getlikeapt-get install << list.txt吗?

debian
  • 1 个回答
  • 1807 Views
Martin Hope
Daniel W.
Asked: 2014-07-17 02:19:28 +0800 CST

外部驱动器从 /dev/sda 切换到 /dev/sdb

  • 2

我们有一个带有外部驱动器的小盒子,用于备份配置集。我发现问题只是在重新启动或驱动器从任何未知事件切换/dev/sda1到/dev/sdb1.

如何规避此问题或配置 fstab 以尝试这两个位置?

/dev/sda1       /stor           ext4    defaults,noatime,noexec  0       0

你可以看到我做了很多调试:

root@nsa:~# mount /stor
mount: special device /dev/sda1 does not exist

正如您在下面看到的,我在编写问题时做了一些调试。

系统日志:

Jul 16 09:48:48 nsa kernel: [167416.395274] EXT4-fs warning (device sda1): 
         __ext4_read_dirblock:908: error reading directory block (ino 2, block 0)

#df -h之前umount:

/dev/sda1       1.4T  185G  1.1T  15% /stor

#dmesg:

[   170.431715] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[119366.019470] usb 1-1.2: USB disconnect, device number 4
[119366.297601] usb 1-1.2: new high-speed USB device number 6 using dwc_otg
[119366.398979] usb 1-1.2: New USB device found, idVendor=1058, idProduct=1021
[119366.399013] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[119366.399029] usb 1-1.2: Product: Ext HDD 1021
[119366.399047] usb 1-1.2: Manufacturer: Western Digital
[119366.399063] usb 1-1.2: SerialNumber: 5743415A4132343133343334
[119366.400719] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[119366.403826] scsi1 : usb-storage 1-1.2:1.0
[119367.398875] scsi 1:0:0:0: Direct-Access     WD       Ext HDD 1021     2002 PQ: 0 ANSI: 4
[119367.401608] sd 1:0:0:0: Attached scsi generic sg0 type 0
[119367.402505] sd 1:0:0:0: [sdb] 2930272256 512-byte logical blocks: (1.50 TB/1.36 TiB)
[119367.403524] sd 1:0:0:0: [sdb] Test WP failed, assume Write Enabled
[119367.404593] sd 1:0:0:0: [sdb] Asking for cache data failed
[119367.404623] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[119367.407157] sd 1:0:0:0: [sdb] Test WP failed, assume Write Enabled
[119367.410142] sd 1:0:0:0: [sdb] Asking for cache data failed
[119367.410185] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[119374.143786]  sdb: sdb1
[119374.146995] sd 1:0:0:0: [sdb] Test WP failed, assume Write Enabled
[119374.149166] sd 1:0:0:0: [sdb] Asking for cache data failed
[119374.149203] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[119374.149231] sd 1:0:0:0: [sdb] Attached SCSI disk
[153689.349544] EXT4-fs error (device sda1): ext4_find_entry:1309: inode #2: comm rsync: reading directory lblock 0

#lsusb:

Bus 001 Device 006: ID 1058:1021 Western Digital Technologies, Inc. Elements 2TB
hard-drive
  • 1 个回答
  • 5249 Views
Martin Hope
Daniel W.
Asked: 2014-07-01 04:10:17 +0800 CST

rsync 更改已经存在的文件

  • 2

我的 crontab 中有一个简单的 rsync 行,可以将备份文件从 prod 服务器获取到另一个服务器。

看起来它正在触及目标文件夹中已经存在的文件。这样,备份将逐渐增加每个间隔的时间。

请查看以下文件更改的日期和时间。

如何使用 rsync 不触摸(和下载?)它已经拥有的文件。我也不需要计算任何校验和,一旦创建了备份,它们就不会再改变了。

rsync -vzre 'ssh' stor@server:/backup/system/ /storage/share/Backup/Server

要获取的文件:

-rw-r-x--- 1 root stor 896K Jun 22 05:02 giant-140622-etc.zip
-rw-r-x--- 1 root stor 620K Jun 22 05:02 giant-140622-sql.zip
-rw-r-x--- 1 root stor  84M Jun 22 05:02 giant-140622-www.zip
-rw-r-x--- 1 root stor 899K Jun 25 05:00 giant-140625-etc.zip
-rw-r-x--- 1 root stor 603K Jun 25 05:00 giant-140625-sql.zip
-rw-r-x--- 1 root stor  84M Jun 25 05:00 giant-140625-www.zip
-rw-r-x--- 1 root stor 899K Jun 28 05:00 giant-140628-etc.zip
-rw-r-x--- 1 root stor 620K Jun 28 05:00 giant-140628-sql.zip
-rw-r-x--- 1 root stor  86M Jun 28 05:00 giant-140628-www.zip
-rw-r-x--- 1 root stor 899K Jun 30 05:00 giant-140630-etc.zip
-rw-r-x--- 1 root stor 617K Jun 30 05:00 giant-140630-sql.zip
-rw-r-x--- 1 root stor  86M Jun 30 05:00 giant-140630-www.zip

目的地:

-rw-r-x--- 1 stor stor 896K Jun 30 06:06 giant-140622-etc.zip
-rw-r-x--- 1 stor stor 620K Jun 30 06:06 giant-140622-sql.zip
-rw-r-x--- 1 stor stor  84M Jun 30 06:06 giant-140622-www.zip
-rw-r-x--- 1 stor stor 899K Jun 30 06:06 giant-140625-etc.zip
-rw-r-x--- 1 stor stor 603K Jun 30 06:06 giant-140625-sql.zip
-rw-r-x--- 1 stor stor  84M Jun 30 06:06 giant-140625-www.zip
-rw-r-x--- 1 stor stor 899K Jun 30 06:06 giant-140628-etc.zip
-rw-r-x--- 1 stor stor 620K Jun 30 06:06 giant-140628-sql.zip
-rw-r-x--- 1 stor stor  86M Jun 30 06:06 giant-140628-www.zip
-rw-r-x--- 1 stor stor 899K Jun 30 06:07 giant-140630-etc.zip
-rw-r-x--- 1 stor stor 617K Jun 30 06:08 giant-140630-sql.zip
-rw-r-x--- 1 stor stor  86M Jun 30 06:10 giant-140630-www.zip

更新:

当我从 shell 运行rsync命令(使用--skip-existingarg)时,它只下载不存在的新文件并跳过它已有的文件。

在调查由 cronjob 运行的完全相同的命令的行为时,已经存在的文件确实会在每个周期发生变化,并且整个作业在每个周期中花费的时间会逐渐增加(比较上面的时间,cronjob 从 06:00 开始,每个文件 2 分钟,即使它们已经存在)。

rsync -vzr --ignore-existing -e 'ssh -i /path/id_rsa -l backup' backup@flowl.info:/backup/system/ /nfs/share-private/Backup/Server

更新:

这是7月份的文件,我在里面多加了一个空行,请看时代,开始06:01和提出每个新文件。

-rw-r-x--- 1 stor stor 899K Jul  4 06:01 giant-140702-etc.zip
-rw-r-x--- 1 stor stor 621K Jul  4 06:01 giant-140702-sql.zip
-rw-r-x--- 1 stor stor  86M Jul  4 06:03 giant-140702-www.zip
                                       ^-- 01 to 03
-rw-r-x--- 1 stor stor 899K Jul  4 06:04 giant-140704-etc.zip
-rw-r-x--- 1 stor stor 634K Jul  4 06:05 giant-140704-sql.zip
-rw-r-x--- 1 stor stor  86M Jul  8 06:02 giant-140704-www.zip
                                       ^-- ???
-rw-r-x--- 1 stor stor 899K Jul  8 06:03 giant-140706-etc.zip
-rw-r-x--- 1 stor stor 629K Jul  8 06:03 giant-140706-sql.zip
-rw-r-x--- 1 stor stor  86M Jul  8 06:06 giant-140706-www.zip
                                       ^-- 03 - 06
-rw-r-x--- 1 stor stor 899K Jul  8 06:07 giant-140708-etc.zip
-rw-r-x--- 1 stor stor 629K Jul  8 06:07 giant-140708-sql.zip
-rw-r-x--- 1 stor stor  86M Jul  8 06:10 giant-140708-www.zip
                                       ^-- 07 - 10

现在,当我想象再过一个月时,时间会是这样的:

-rw-r-x--- 1 stor stor 899K Jul  8 06:32 giant-140808-etc.zip
-rw-r-x--- 1 stor stor 629K Jul  8 06:32 giant-140808-sql.zip
-rw-r-x--- 1 stor stor  86M Jul  8 06:35 giant-140808-www.zip
                                       ^-- what I imagine to happen
backup
  • 4 个回答
  • 1474 Views
Martin Hope
Daniel W.
Asked: 2014-03-06 08:32:55 +0800 CST

`No input file specified.`(nginx,fpm)的真正解决方案

  • 8

这个问题的大多数答案是,设置 fastcgi_param SCRIPT_FILENAME 并且它会起作用(斜体格式被破坏了?!)。

我已经设置了这个变量(正确),但它仍然显示错误而不是 404 页面,因为问题的根源在这里:

location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }

将不存在的路径传递给 php5-fpm,这会打印错误,在日志中如下所示:

FastCGI sent in stderr:
"Unable to open primary script: ... (No such file or directory)"
while reading response header from upstream

所以在行前fastcgi_pass 必须有条件检查文件是否真的存在,或者,如果fpm worker返回“file not found”,则引导nginx返回404页面。

我怎样才能做到这一点?

nginx
  • 2 个回答
  • 28980 Views
Martin Hope
Daniel W.
Asked: 2014-02-27 03:38:50 +0800 CST

nginx 将文件夹 http 重写为 https

  • 0

我目前有 2 个服务器容器,1 个用于 http,另一个用于同一服务器但 https。我想使用Listen 80;and合并这些容器Listen 443 ssl;,这可行,但我现在需要重写一个不同的 URL:

    location ^~ /wp-admin {
            rewrite ^ https://domain.com$request_uri? permanent;
    }

    location ^~ /wp-login.php {
            rewrite ^ https://domain.com$request_uri? permanent;
    }

当 HTTP 和 HTTPS 结合使用时,这会导致无限的位置循环。我需要更改模式,但无法正常工作:

    location ~ ^http://domain\.com/wp-admin {
            rewrite ^ https://domain.com$request_uri? permanent;
    }

    location ~ ^http://domain\.com/wp-login.php {
            rewrite ^ https://domain.com$request_uri? permanent;
    }

这不起作用,有人知道吗?

nginx
  • 1 个回答
  • 1117 Views
Martin Hope
Daniel W.
Asked: 2014-02-26 05:10:54 +0800 CST

检查 Apache 是否加载了特定的配置?

  • 16

有很多配置文件,我放了一个文件,但我看不到它的效果。

要么我的配置错误,要么 Apache 未加载配置文件。

有没有我可以触发的命令来查看 Apache 是否加载了特定的配置文件?

apachectl configtest

不打印错误。服务器重新启动而没有错误。

apache-2.2
  • 2 个回答
  • 16805 Views
Martin Hope
Daniel W.
Asked: 2014-02-25 04:41:31 +0800 CST

nginx默认服务器不工作

  • 4

我正在使用 Debian,最新的 dotdeb nginx-lite。我已经读过,server如果域没有特定的服务器部分,nginx 找到的第一部分将用作备用/默认部分。

我从我的安装中删除了sites-available,sites-enabled因为我对所有与 http 相关的东西都使用了专用的挂载/www。

我/etc/nginx/nginx.conf的这些行包括其他配置:

    include /www/conf.d/nginx/default.conf;
    include /etc/nginx/conf.d/*.conf;
    include /www/conf.d/nginx/*;

default.conf 看起来像:

server {
        server_name 0.0.0.0;
        listen 0.0.0.0:80;
        rewrite ^ http://mymaintarget.com permanent;
}

这对我不起作用。我仍然收到此警告:

Restarting nginx: nginxnginx: [warn] conflicting
server name "0.0.0.0" on 0.0.0.0:80, ignored

我很确定没有其他服务器部分,而 default.conf 是第一个包含/使用的部分。

任何人都知道出了什么问题或配置默认服务器的正确方法是什么?

更新完整的配置文件:

nginx.conf:

user www-data;
worker_processes 8;
pid /run/nginx.pid;

events {
        worker_connections 768;
}

http {
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 10;
        types_hash_max_size 2048;
        server_tokens off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        error_log /var/log/nginx/error.log;

        gzip on;
        gzip_disable "msie6";
        gzip_vary on;


        # Default VirtualHost
        include /www/conf.d/nginx/default.conf;

        # conf.d is empty anyways
        #include /etc/nginx/conf.d/*.conf;

        # VirtualHosts
        include /www/conf.d/nginx/*;
}

默认配置:

server {
        listen 80 default_server;
        rewrite ^ http://blog.flowl.info permanent;
}
nginx
  • 2 个回答
  • 22338 Views
Martin Hope
Daniel W.
Asked: 2014-02-14 03:11:29 +0800 CST

PHP-FPM 在 memcached 中保存会话

  • 1

我正在尝试将我的 session_handler 切换到 memcached,我不确定它是否有效,它看起来不像它。

vi /etc/php5/fpm/php.ini

session.save_handler = memcached
session.save_path = unix://run/memcached/memcached.sock

/etc/init.d/php5-fpm restart

几次访问我的博客后,我应该在 memcached 中有一个密钥,不是吗?

nc -U /run/memcached/memcached.sock

giant:~# nc -U /run/memcached/memcached.sock
stats items
END
stats slabs
STAT active_slabs 0
STAT total_malloced 0
END

phpinfo():

session.gc_probability  0   0
session.hash_bits_per_character 5   5
session.hash_function   0   0
session.name    PHPSESSID   PHPSESSID
session.referer_check   no value    no value
session.save_handler    memcache    memcache
session.save_path   unix://run/memcached/memcached.sock unix://run/memcached/memcached.sock
session.serialize_handler   php php
session.upload_progress.cleanup On  On
session.upload_progress.enabled On  On
session.upload_progress.freq    1%  1%
session.upload_progress.min_freq    1   1
session.upload_progress.name    PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix  upload_progress_    upload_progress_
session.use_cookies On  On
session.use_only_cookies    On  On
session.use_trans_sid   0   0

有人可以引导我进行正确的配置吗?

php-fpm
  • 1 个回答
  • 8192 Views
Martin Hope
Daniel W.
Asked: 2014-01-23 12:05:37 +0800 CST

删除后重建主目录

  • 1

这就是发生的事情:

root@rasp:~# ls -al
total 72
drwx------  8 root root 4096 Jan 22 21:01 .
drwxr-xr-x 25 root root 4096 Sep 11 14:27 ..
-rw-------  1 root root 8079 Jan 22 19:55 .bash_history
-rw-r--r--  1 root root  570 Jan 31  2010 .bashrc
drwx------  3 root root 4096 Jul 31 16:28 .config
drwxr-xr-x  2 root root 4096 Jan 21 15:18 misc
-rw-r--r--  1 root root  140 Nov 19  2007 .profile
-rw-r--r--  1 root root  204 Jan 22 21:01 psk-01.cap
-rw-r--r--  1 root root  236 Jan 22 21:01 psk-01.csv
-rw-r--r--  1 root root  325 Jan 22 21:01 psk-01.kismet.csv
-rw-r--r--  1 root root  227 Jan 22 21:01 psk-01.kismet.netxml
-rw-------  1 root root 1024 Jul 29 13:26 .rnd
drwxr-xr-x  5 root root 4096 Jan 19 15:51 .rpi-firmware
drwxr-xr-x  2 root root 4096 Sep 10 08:45 scripts
-rw-------  1 root root  259 Aug  1 14:04 .sqlite_history
drwx------  2 root root 4096 Nov  5 02:05 .ssh
root@rasp:~# rm psk *
rm: cannot remove `psk': No such file or directory
rm: cannot remove `aircrack': Is a directory
rm: cannot remove `misc': Is a directory
rm: cannot remove `scripts': Is a directory
root@rasp:~# rm psk * -f
rm: cannot remove `aircrack': Is a directory
rm: cannot remove `misc': Is a directory
rm: cannot remove `scripts': Is a directory
root@rasp:~# rm psk * -fR

我想放rm psk*,但里面有一个空白。

有什么方法可以重建 bash、config、profile、rnd、rpi-firmware、ssh 文件夹和文件?

debian
  • 2 个回答
  • 1150 Views
Martin Hope
Daniel W.
Asked: 2014-01-17 07:47:55 +0800 CST

我如何知道我是否安装了 ECC RAM?

  • 0

我租了一台服务器:8 GB DDR3-RAM ECC

启动时,日志文件会打印如下内容:

EDAC amd64: This node reports that Memory ECC is currently disabled, set F3x44[22] (0000:00:18.3).
Jan 15 03:24:44 big kernel: [   75.821734] EDAC amd64: ECC disabled in the BIOS or no ECC capability, module will not load.
Jan 15 03:24:44 big kernel: [   75.821736]  Either enable ECC checking or force module loading by setting 'ecc_enable_override'.

这是否意味着我没有 ECC RAM,或者只是没有启用或者..?我没有物理访问....对机器。

ecc
  • 2 个回答
  • 4061 Views
Martin Hope
Daniel W.
Asked: 2014-01-17 07:32:01 +0800 CST

为什么或谁重新启动了我的服务器

  • 2

我们的一台服务器昨晚重新启动

reboot   system boot  2.6.32-5-amd64   Wed Jan 15 03:24 - 16:07 (1+12:42)

我们的主人没有这样做,我也没有。

syslog没有显示任何错误

Jan 15 03:17:01 big /USR/SBIN/CRON[840]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly >> /dev/null)
Jan 15 03:20:01 big /USR/SBIN/CRON[844]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jan 15 03:24:44 big kernel: imklog 4.6.4, log source = /proc/kmsg started.
Jan 15 03:24:44 big rsyslogd: [origin software="rsyslogd" swVersion="4.6.4" x-pid="893" x-info="http://www.rsyslog.com"] (re)start
Jan 15 03:24:44 big kernel: [    0.000000] Initializing cgroup subsys cpuset
Jan 15 03:24:44 big kernel: [    0.000000] Initializing cgroup subsys cpu
Jan 15 03:24:44 big kernel: [    0.000000] Linux version 2.6.32-5-amd64 (Debian 2.6.32-48squeeze4) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Sep 23 22:14:43 UTC 2013
Jan 15 03:24:44 big kernel: [    0.000000] Command line: root=/dev/md1 ro acpi=ht
Jan 15 03:24:44 big kernel: [    0.000000] KERNEL supported cpus:

auth.log在 03:24 左右的很长一段时间内没有显示任何内容。

lastlog除了我自己之外没有显示任何连接。

故障日志没有条目。

向上记录

big:/var/log# uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
     1   210 days, 06:33:18 | Linux 2.6.32-5-amd64      Wed Mar 13 09:49:06 2013
     2    97 days, 10:58:48 | Linux 2.6.32-5-amd64      Wed Oct  9 17:23:44 2013
->   3     1 day , 12:54:06 | Linux 2.6.32-5-amd64      Wed Jan 15 03:23:22 2014

我可以看到重启后发生的日志条目,但我找不到任何导致重启的信息。

这段时间CPU使用率非常低,所以肯定不是过热问题。

03:10:01 PM     all      0.01      0.00      0.00      0.00      0.00     99.99
03:15:01 PM     all      0.02      0.00      0.00      0.00      0.00     99.97
03:20:01 PM     all      0.01      0.00      0.00      0.00      0.00     99.99
03:25:01 PM     all      0.02      0.00      0.00      0.00      0.00     99.97
03:30:01 PM     all      0.01      0.00      0.00      0.00      0.00     99.99
03:35:01 PM     all      0.01      0.00      0.00      0.00      0.00     99.99
03:40:01 PM     all      0.02      0.00      0.01      0.00      0.00     99.97

有谁知道我可以在哪里继续搜索?

debian
  • 1 个回答
  • 1829 Views
Martin Hope
Daniel W.
Asked: 2013-11-16 03:42:57 +0800 CST

将模块添加到 nginx-light (Debian / dotdeb)

  • 0

http://packages.debian.org/testing/nginx-light

http://packages.debian.org/testing/nginx-full

我可以向 nginx-light 安装添加仅在 nginx-full 中可用而无需重新编译的模块吗?

nginx
  • 1 个回答
  • 340 Views
Martin Hope
Daniel W.
Asked: 2013-11-15 03:58:31 +0800 CST

一直把cpufreq设置得越高越好吗?

  • 0

最初这个问题是关于为什么我在购买 2300 mhz 服务器 cpu 时的 cpuinfo mhz 为 1400。

在 HBruijn 的帮助下(谢谢!)并使用cpufreq-info工具,我发现了我的真实规格:

analyzing CPU 7:
  driver: powernow-k8
  CPUs which run at the same hardware frequency: 7
  CPUs which need to have their frequency coordinated by software: 7
  maximum transition latency: 8.0 us.
  hardware limits: 1.40 GHz - 2.40 GHz
  available frequency steps: 2.40 GHz, 2.10 GHz, 1.90 GHz, 1.60 GHz, 1.40 GHz
  available cpufreq governors: userspace, powersave, conservative, ondemand, performance
  current policy: frequency should be within 1.40 GHz and 2.40 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz (asserted by call to hardware).

问题:

让驱动程序决定cpu有多少功率(低使用率1400mhz) 是好的,还是服务器将频率设置为尽可能高(2300mhz)更好?

central-processing-unit
  • 1 个回答
  • 858 Views
Martin Hope
Daniel W.
Asked: 2013-08-01 00:09:48 +0800 CST

nginx http auth 仅适用于文件夹,不适用于文件

  • 1

我是 nginx 新手,我真的很喜欢它与 php-fpm 结合的速度。

我想保护一个文件夹

    location / {
            try_files $uri $uri/ $uri.php /;
            auth_basic "restricted";
            auth_basic_user_file /www/config/global.passwd;
    }

这可以通过访问来工作/,但在点击/test.php它时不会要求输入密码。它确实要求一个,/test/所以这只适用于文件夹。

如何包含文件进行保护?

nginx
  • 1 个回答
  • 6028 Views
Martin Hope
Daniel W.
Asked: 2013-07-04 06:58:25 +0800 CST

hosts.deny 行太长或文件太大?

  • 0

我在 hosts.deny 文件中有大约 50k 个 IP 地址被拒绝,由每行最多 7 个地址的脚本生成,并收到此错误:

warning: /etc/hosts.deny, line 4429: missing newline or line too long

第 4429 行是中间的那一行:

ALL: 96.47.225.95, 96.47.225.96, 96.47.225.97, 96.47.225.98, 96.47.225.99, 96.56.113.123, 96.8.112.149
ALL: 98.126.161.178, 98.15.206.118, 98.159.4.16, 98.197.212.67, 98.83.135.94, 98.94.6.213, 98.94.6.78
ALL: 99.167.89.146, 99.177.96.73, 99.235.84.25, 99.244.9.103, 99.49.94.70

怎么了?

更新:

警告仅在建立连接时出现,hosts.deny 文件同时被写入。(i/o, lock, fopen for write, fopen for read)。

linux
  • 1 个回答
  • 2465 Views
Martin Hope
Daniel W.
Asked: 2013-06-27 07:00:46 +0800 CST

在 phpPgAdmin 中将套接字更改为其他默认值

  • 0

我需要在其配置中更改 phpPgAdmin 连接的套接字。

// Hostname or IP address for server.  Use '' for UNIX domain socket.
// use 'localhost' for TCP/IP connection on this computer
$conf['servers'][0]['host'] = '/opt/jasperreports-server-cp-5.1.0/postgresql';
$conf['servers'][0]['defaultdb'] = 'postgres';

这不起作用。将其留空''也不起作用。

在 pg_hba.conf 我只有以下行:

local   all             all                                     trust

路径是正确的,因为我可以通过以下方式连接:

:~# psql --host=/opt/jasperreports-server-cp-5.1.0/postgresql/ --user=postgres
postgresql
  • 1 个回答
  • 605 Views
Martin Hope
Daniel W.
Asked: 2013-06-02 05:17:13 +0800 CST

iphone 的 ipsec (openswan) 路由或 dns 问题

  • 0

我建立了 VPN 连接,但路由或解析不起作用。配置取自http://louwrentius.com/blog/2011/12/setting-up-a-vpn-with-your-iphone-using-l2tp,-ipsec-and-linux/和http://blog .bertelsen.co/2012/02/debian-squeeze-l2tpipsec-vpn-server.html

在 vpn 服务器上,执行 ngrep 给出以下内容,而 85.25.128.10 是 dns 服务器:

interface: ppp0 (10.0.1.200/255.255.255.255)
#
U 10.0.1.201:55631 -> 85.25.128.10:53
  .............login.skype.com.....
#
U 10.0.1.201:55631 -> 85.25.128.10:53
  .............login.skype.com.....
#
U 10.0.1.201:55631 -> 85.25.128.10:53
  .............login.skype.com.....
#
U 10.0.1.201:55631 -> 85.25.128.10:53
  .............login.skype.com.....
#

dns数据包会发生什么?我无法在 iphone 客户端加载任何网站。

编辑:这一直有效,直到重定向:

####
T 10.0.1.201:51936 -> 10.0.1.200:80 [AP]
  GET / HTTP/1.1..Host: 10.0.1.200..Connection: keep-alive..Accept-Encoding: gzip,     deflate..User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) Apple
  WebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25..Accept-    Language: de-de..Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*
  /*;q=0.8....
##
T 10.0.1.200:80 -> 10.0.1.201:51936 [AP]
  HTTP/1.1 302 Found..Date: Sat, 01 Jun 2013 13:40:38 GMT..Server: Apache/2..X-Powered-    By: PHP/5.3.3-7+squeeze15..Location: http://xxxxxxx.com/..Vary: Accept-Enco
  ding..Content-Encoding: gzip..Content-Length: 20..Keep-Alive: timeout=15,     max=100..Connection: Keep-Alive..Content-Type: text/html........................
##
nat
  • 1 个回答
  • 543 Views
Martin Hope
Daniel W.
Asked: 2013-06-01 04:13:53 +0800 CST

允许在根服务器上转发,安全风险?

  • 3

有一个没有 iptables 规则的根服务器(我知道这不好,对我来说这只是暂时的),并且有这样的配置(出于 VPN 的原因):

echo 1 > /proc/sys/net/ipv4/ip_forwarding

iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE

这是否包括任何主机都能够滥用我的根服务器,将其用作路由器或以任何方式通过它转发流量?

linux
  • 1 个回答
  • 490 Views
Martin Hope
Daniel W.
Asked: 2013-05-29 15:52:45 +0800 CST

删除空文件链接

  • 2

我不小心做了一个链接,不能删除:

big:~# ls -al
total 88
lrwxrwxrwx  1 root root    27 May 28 18:10   -> /etc/apache2/ssl/apache.pem
drwx------  8 root root  4096 May 29 01:45 .
drwxr-xr-x 23 root root  4096 May 27 04:50 ..
drwxr-xr-x  2 root root  4096 Apr 18 19:26 backup_big

我不会用“rm”做实验:-D

debian
  • 1 个回答
  • 53 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve