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-123313

MultiformeIngegno's questions

Martin Hope
MultiformeIngegno
Asked: 2019-09-20 03:35:10 +0800 CST

在 nginx 中重写正则表达式以匹配 URL 中的年份

  • 1

我正在尝试编写一个 nginx 重写指令,该指令将 URL 重定向https://website.com/2018/11/20/dummytext/feed/到https://website.com/2018/11/20/dummytext/(最后删除/feed/)。

我不能只做一个匹配,(.*)/feed/因为我不想重定向https://website.com/feed/。

我创建了这个正则表达式,它最终与 /feed/ 匹配所有帖子,这似乎有效: https ://www.regextester.com/?fam=111507

这就是我在 nginx 中所拥有的:

rewrite "^\b(19|[2-9][0-9])\d{2}\b\/(.*)\/feed\/?$" https://website.com/$1 permanent;

第一个问题是它似乎不起作用(我已经重新启动了 nginx)。当我访问一个 URL时,https://website.com/2018/11/20/dummytext/feed/我不会被重定向到任何地方。第二个问题是我不确定这部分https://website.com/$1是否真的会/feed/从 URL 中删除,保持 URL 的其余部分不变。

nginx
  • 1 个回答
  • 683 Views
Martin Hope
MultiformeIngegno
Asked: 2015-05-12 07:24:24 +0800 CST

证书链中的自签名证书

  • 2

我正在构建正确的证书链。我的证书颁发由 StartSSL 颁发的 2 类证书。

这是我在 ssl.crt 中放入的内容:

my cert
https://www.startssl.com/certs/ca.pem
https://www.startssl.com/certs/class2/sha1/pem/sub.class2.client.sha1.ca.pem
https://www.startssl.com/certs/class2/sha1/pem/sub.class2.server.sha1.ca.pem

(我放链接是为了让你看到我把文件放在哪里)

如果我这样做,openssl s_client -connect multiformeingegno.it:993我会得到:

Verify return code: 19 (self signed certificate in certificate chain)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready

如果我尝试将我的帐户添加到 Gmail,这就是我得到的:

"Missing +OK response upon connecting to the server: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready."

为什么说是自签名证书?

ssl
  • 2 个回答
  • 51952 Views
Martin Hope
MultiformeIngegno
Asked: 2015-01-30 03:50:14 +0800 CST

nginx:不遵守 default_server 指令

  • 1

我有多个文件,每个文件都有一个用于不同虚拟主机的配置。在这些配置文件之一(包含在主 nginx 配置文件中)上,我设置了 default_server 指令:

server {

    listen                  80;
    listen                  443 ssl default_server spdy;
    server_name             188.166.X.XXX;
    root                    /var/www/default;
    index                   index.php index.html;
    ...
}

......但它没有受到尊重。如果我在 nginx 服务器块中指向我未添加的域的 A 记录,则会拾取按字母顺序排列的第一个服务器块(而不是 default_server)。为什么?

nginx
  • 1 个回答
  • 1640 Views
Martin Hope
MultiformeIngegno
Asked: 2014-11-01 15:21:25 +0800 CST

设置 Postfix+Dovecot 从数据库读取

  • 4

我正在尝试设置Postfix和Dovecot,后者将虚拟用户存储在 MySQL 数据库中,遵循本指南(但在这里我回顾一下所有内容,因为我在评论后修复的指南中有一些“错误”)。序言:我从 Ubuntu 存储库安装了、Postfix和Dovecot。postfix-mysqldovecot-mysql

让我们从 Postfix 配置开始:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no   
readme_directory = no

myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

relay_domains = *
virtual_alias_maps = proxy:mysql:/etc/postfix/virtual_alias_maps.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual_mailbox_maps.cf
virtual_mailbox_base = /home/vmail
virtual_mailbox_limit = 512000000
virtual_minimum_uid = 5000
virtual_transport = virtual
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
local_transport = virtual
local_recipient_maps = $virtual_mailbox_maps
transport_maps = hash:/etc/postfix/transport

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/private/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_tls_loglevel = 1

然后我创建了用户vmail来存储电子邮件:

groupadd -g 5000 vmail
useradd -u 5000 -g vmail -s /usr/bin/nologin -d /home/vmail -m vmail

以及 MySQL 数据库和用户来存储有关域和虚拟用户的信息:

CREATE DATABASE postfix_db;
USE postfix_db;
CREATE USER postfix_user@localhost IDENTIFIED BY 'password';
GRANT ALL ON postfix_db.* TO postfix_user@localhost;
FLUSH PRIVILEGES;

然后我创建了与域、转发和用户相关的表:

CREATE TABLE `domains` (
  `domain` varchar(50) NOT NULL default "",
  PRIMARY KEY  (`domain`),
  UNIQUE KEY `domain` (`domain`)
);


CREATE TABLE `forwardings` (
  `source` varchar(80) NOT NULL default "",
  `destination` text NOT NULL,
  PRIMARY KEY  (`source`)
);

CREATE TABLE `users` (
  `email` varchar(80) NOT NULL default "",
  `password` varchar(20) NOT NULL default "",
  `quota` varchar(20) NOT NULL default '20971520',
  `domain` varchar(255) NOT NULL default "",
  UNIQUE KEY `email` (`email`)
);

我在表中添加了我的域(正确设置了 A 和 MX 记录):

INSERT INTO `domains` VALUES ('virtualdomain.tld');

以及与该域相关的帐户:

INSERT INTO `users` VALUES ('[email protected]', ENCRYPT('password'), '20971520', 'virtualdomain.tld');

然后我创建了一个自签名证书:

cd /etc/ssl/private/
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out server.key
chmod 400 server.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
chmod 444 server.crt

然后是我在 Postfix 配置中引用的文件:

/etc/postfix/virtual_alias_maps.cf

user = postfix_user
password = hunter2
hosts = localhost
dbname = postfix_db
table = domains
select_field = domain
where_field = domain

/etc/postfix/virtual_mailbox_domains.cf

user = postfix_user
password = hunter2
hosts = localhost
dbname = postfix_db
table = forwardings
select_field = destination
where_field = source

/etc/postfix/virtual_mailbox_maps.cf

user = postfix_user
password = hunter2
hosts = localhost
dbname = postfix_db
table = users
select_field = concat(domain,'/',email,'/')
where_field = email

接着

touch /etc/postfix/transport
postmap /etc/postfix/transport

现在我删除了默认的 Dovecot 配置文件,将其替换为:

protocols = imap
auth_mechanisms = plain
passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}
userdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}

service auth {
    unix_listener auth-client {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}

mail_home = /home/vmail/%d/%u
mail_location = maildir:~

ssl_cert = </etc/ssl/private/server.crt
ssl_key = </etc/ssl/private/server.key

我创建了/etc/dovecot/dovecot-sql.conf文件:

driver = mysql
connect = host=localhost dbname=postfix_db user=postfix_user password=hunter2
# The new name for MD5 is MD5-CRYPT so you might need to change this depending on version
default_pass_scheme = MD5-CRYPT
# Get the mailbox
user_query = SELECT '/home/vmail/%d/%u' as home, 'maildir:/home/vmail/%d/%u' as mail, 5000 AS uid, 5000 AS gid, concat('dirsize:storage=',  quota) AS quota FROM users WHERE email = '%u'
# Get the password
password_query = SELECT email as user, password, '/home/vmail/%d/%u' as userdb_home, 'maildir:/home/vmail/%d/%u' as userdb_mail, 5000 as  userdb_uid, 5000 as userdb_gid FROM users WHERE email = '%u'
# If using client certificates for authentication, comment the above and uncomment the following
#password_query = SELECT null AS password, ‘%u’ AS user

...最后重新启动 dovecot 和后缀:

service postfix dovecot restart

问题是,当我尝试向 发送电子邮件时[email protected],我在日志中看到:

NOQUEUE: reject: RCPT from blablabla.com[xxx.xxx.xxx.xxx]: 451 4.3.0 <[email protected]>: Temporary lookup failure; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<blablabla.com>

并且邮件因错误而退回

550 5.1.1 "Recipient address rejected: User unknown in virtual alias table"
ubuntu
  • 2 个回答
  • 1039 Views
Martin Hope
MultiformeIngegno
Asked: 2014-07-24 11:41:04 +0800 CST

s3cmd:即时备份

  • 2

为了进行备份,我创建了一个脚本,该脚本对我需要备份的所有文件夹进行存档,将其发送到 S3(通过 s3cmd),然后在上传完成后将其删除。

我正在寻找一种方法来避免必须创建存档然后将其删除,因为我没有足够的空间来临时存储存档!可能吗?

这是我的脚本:

DBLIST=`mysql -uMYSQL_USERNAME -pMYSQL_PASSWORD --events -ANe"SELECT GROUP_CONCAT(schema_name) FROM information_schema.schemata WHERE schema_name NOT IN ('information_schema','performance_schema')" | sed 's/,/ /g'`
MYSQLDUMP_OPTIONS="-uMYSQL_USERNAME -pMYSQL_PASSWORD --single-transaction --routines --triggers"
BACKUP_DEST="/home/backup/db"
for DB in `echo "${DBLIST}"`
do
    mysqldump ${MYSQLDUMP_OPTIONS} ${DB} | gzip -f > ${BACKUP_DEST}/${DB}.sql.gz &
done
wait
tar -czvf /home/backup/db2/`date +\%G-\%m-\%d`_db.tar.gz ${BACKUP_DEST}
s3cmd --reduced-redundancy put -r /home/backup/db2/ s3://MY-S3-BUCKET/ --no-encrypt
find /home/backup -type f -delete

在旁注中,我敢打赌,将用户名/密码以纯文本形式存储在 crontab 文件中不是最佳做法。我该如何解决这个问题?

提前致谢 :)

mysql
  • 1 个回答
  • 874 Views
Martin Hope
MultiformeIngegno
Asked: 2014-03-28 10:50:40 +0800 CST

chroot 目录组件的所有权或模式错误

  • 77

我创建了用户 MY_USER。将他的主目录设置为 /var/www/RESTRICTED_DIR,这是他应该被限制的路径。然后我编辑了 sshd_config 并设置:

Match user MY_USER
  ChrootDirectory /var/www/RESTRICTED_DIR

然后我重新启动了ssh。将 MY_USER 设为 RESTRICTED_DIR 的所有者(和组所有者),并将其更改为 755。我明白了

Accepted password for MY_USER
session opened for user MY_USER by (uid=0)
fatal: bad ownership or modes for chroot directory component "/var/www/RESTRICTED_DIR"
pam_unix(sshd:session): session closed for user MY_USER

如果我从 sshd_config 中删除了 2 行,则用户可以成功登录。当然它可以访问所有服务器。有什么问题?我什至尝试将 RESTRICTED_DIR 设置为 root(当我在某处读到有人解决了同样的问题时)。没运气..

ssh
  • 4 个回答
  • 215347 Views
Martin Hope
MultiformeIngegno
Asked: 2013-01-26 15:37:45 +0800 CST

Nginx:在特定链接结构上未考虑参数

  • 0

我在我的 VPS 上安装了 WP(使用 nginx 1.3.12 和 php5-fpm 5.4.11)。

搜索结果的第一页 (/?s=test) 已正确加载,但 /page/2/?s=test 显示与 /page/2/ 相同的内容(因此未考虑 ?s=test) .

这可能是我的 nginx 配置有问题:

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}

location / {
# if you're just using wordpress and don't want extra rewrites
# then replace the word @rewrites with  /index.php
try_files $uri $uri/ /index.php;

}

无论如何,文章工作正常.. 永久链接结构 (/%year%/%monthnum%/%day%/%postname%/) 工作正常.. 所以我应该找到一个不会破坏它的修复程序(但“修复”搜索参数问题)。

“演示”

第 1 页 (/?s=test): http://goo.gl/HigKa

第 2 页 ( /page/2/?s=test):http://goo.gl/ujftR

提前致谢。

php
  • 1 个回答
  • 86 Views
Martin Hope
MultiformeIngegno
Asked: 2013-01-10 16:34:09 +0800 CST

Nginx $document_root$fastcgi_script_name 与 $request_filename

  • 21

如果在我的配置文件中设置,我看不出有什么不同

 fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

或者:

 fastcgi_param  SCRIPT_FILENAME    $request_filename;

他们分别做什么?两者中的一个比另一个更好吗?

提前致谢。

nginx
  • 3 个回答
  • 61188 Views
Martin Hope
MultiformeIngegno
Asked: 2013-01-04 18:10:29 +0800 CST

这是拒绝服务攻击吗?

  • 0

我的 kern.log 被这些行淹没了:

Jan  4 03:00:57 myhost kernel: [9040601.809740] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=33285 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:01:09 myhost kernel: [9040613.699425] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=62996 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:01:21 myhost kernel: [9040625.584770] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=26121 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:01:33 myhost kernel: [9040637.471088] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=59140 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:01:45 myhost kernel: [9040649.352450] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=33805 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:01:56 myhost kernel: [9040661.237910] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=33285 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:02:08 myhost kernel: [9040673.116958] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=14341 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:02:20 myhost kernel: [9040685.003337] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=22793 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:02:32 myhost kernel: [9040696.886561] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=32783 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:02:44 myhost kernel: [9040708.770251] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=14854 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:02:56 myhost kernel: [9040720.652454] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=56844 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:03:08 myhost kernel: [9040732.530823] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=4373 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:03:20 myhost kernel: [9040744.409373] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=62989 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:03:32 myhost kernel: [9040756.417865] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=4116 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:03:44 myhost kernel: [9040769.008748] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=16136 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:03:57 myhost kernel: [9040782.192103] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=9476 PROTO=UDP SPT=25345 DPT=53 LEN=44 
Jan  4 03:04:10 myhost kernel: [9040795.020864] iptables denied: IN=eth0 OUT= MAC=10:00:25:09:e7:40:00:21:5e:3f:c4:04:08:00 SRC=178.33.217.13 DST=xx.xx.xx.xx LEN=64 TOS=0x00 PREC=0x00 TTL=236 ID=55553 PROTO=UDP SPT=25345 DPT=53 LEN=44 

这是 DoS 攻击吗?当然 xx.xx.xx.xx 是我的 IP 地址(目的地)。

编辑:我也有很多来自其他 IP 的请求,虽然是同一个端口。

logging
  • 3 个回答
  • 1827 Views
Martin Hope
MultiformeIngegno
Asked: 2013-01-01 05:26:42 +0800 CST

CRON 连续打开和关闭会话

  • 0

我在我的授权日志中看到了大量这样的行:

Dec 31 03:45:01 xxxxxxx CRON[17259]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 03:45:01 xxxxxxx CRON[17259]: pam_unix(cron:session): session closed for user root
Dec 31 03:55:01 xxxxxxx CRON[17317]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 03:55:01 xxxxxxx CRON[17317]: pam_unix(cron:session): session closed for user root
Dec 31 04:05:01 xxxxxxx CRON[17375]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:05:01 xxxxxxx CRON[17375]: pam_unix(cron:session): session closed for user root
Dec 31 04:15:01 xxxxxxx CRON[17434]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:15:01 xxxxxxx CRON[17434]: pam_unix(cron:session): session closed for user root
Dec 31 04:17:01 xxxxxxx CRON[17438]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:17:01 xxxxxxx CRON[17438]: pam_unix(cron:session): session closed for user root
Dec 31 04:25:01 xxxxxxx CRON[17498]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:25:01 xxxxxxx CRON[17498]: pam_unix(cron:session): session closed for user root
Dec 31 04:35:01 xxxxxxx CRON[17596]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:35:01 xxxxxxx CRON[17596]: pam_unix(cron:session): session closed for user root
Dec 31 04:45:01 xxxxxxx CRON[17669]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:45:01 xxxxxxx CRON[17669]: pam_unix(cron:session): session closed for user root
Dec 31 04:55:01 xxxxxxx CRON[17730]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 04:55:01 xxxxxxx CRON[17730]: pam_unix(cron:session): session closed for user root
Dec 31 05:05:01 xxxxxxx CRON[17788]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:05:01 xxxxxxx CRON[17788]: pam_unix(cron:session): session closed for user root
Dec 31 05:15:01 xxxxxxx CRON[17857]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:15:01 xxxxxxx CRON[17857]: pam_unix(cron:session): session closed for user root
Dec 31 05:17:01 xxxxxxx CRON[17861]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:17:01 xxxxxxx CRON[17861]: pam_unix(cron:session): session closed for user root
Dec 31 05:25:01 xxxxxxx CRON[17917]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:25:02 xxxxxxx CRON[17917]: pam_unix(cron:session): session closed for user root
Dec 31 05:35:01 xxxxxxx CRON[17975]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:35:01 xxxxxxx CRON[17975]: pam_unix(cron:session): session closed for user root
Dec 31 05:45:01 xxxxxxx CRON[18015]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:45:01 xxxxxxx CRON[18015]: pam_unix(cron:session): session closed for user root
Dec 31 05:55:01 xxxxxxx CRON[18072]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 05:55:01 xxxxxxx CRON[18072]: pam_unix(cron:session): session closed for user root
Dec 31 06:05:01 xxxxxxx CRON[18130]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:05:01 xxxxxxx CRON[18130]: pam_unix(cron:session): session closed for user root
Dec 31 06:15:01 xxxxxxx CRON[18201]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:15:01 xxxxxxx CRON[18201]: pam_unix(cron:session): session closed for user root
Dec 31 06:17:01 xxxxxxx CRON[18229]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:17:01 xxxxxxx CRON[18229]: pam_unix(cron:session): session closed for user root
Dec 31 06:25:01 xxxxxxx CRON[18262]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:25:01 xxxxxxx CRON[18263]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:25:01 xxxxxxx CRON[18263]: pam_unix(cron:session): session closed for user root
Dec 31 06:35:01 xxxxxxx CRON[18357]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:35:01 xxxxxxx CRON[18357]: pam_unix(cron:session): session closed for user root
Dec 31 06:43:31 xxxxxxx CRON[18262]: pam_unix(cron:session): session closed for user root
Dec 31 06:45:01 xxxxxxx CRON[18596]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:45:01 xxxxxxx CRON[18596]: pam_unix(cron:session): session closed for user root
Dec 31 06:55:01 xxxxxxx CRON[18660]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 06:55:01 xxxxxxx CRON[18660]: pam_unix(cron:session): session closed for user root
Dec 31 07:05:01 xxxxxxx CRON[18717]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:05:01 xxxxxxx CRON[18717]: pam_unix(cron:session): session closed for user root
Dec 31 07:15:01 xxxxxxx CRON[18776]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:15:01 xxxxxxx CRON[18776]: pam_unix(cron:session): session closed for user root
Dec 31 07:17:01 xxxxxxx CRON[18781]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:17:01 xxxxxxx CRON[18781]: pam_unix(cron:session): session closed for user root
Dec 31 07:25:01 xxxxxxx CRON[18841]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:25:01 xxxxxxx CRON[18841]: pam_unix(cron:session): session closed for user root
Dec 31 07:35:01 xxxxxxx CRON[18898]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:35:01 xxxxxxx CRON[18898]: pam_unix(cron:session): session closed for user root
Dec 31 07:45:01 xxxxxxx CRON[18981]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:45:01 xxxxxxx CRON[18981]: pam_unix(cron:session): session closed for user root
Dec 31 07:55:01 xxxxxxx CRON[19043]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 07:55:01 xxxxxxx CRON[19043]: pam_unix(cron:session): session closed for user root
Dec 31 08:05:01 xxxxxxx CRON[19100]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:05:01 xxxxxxx CRON[19100]: pam_unix(cron:session): session closed for user root
Dec 31 08:15:01 xxxxxxx CRON[19164]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:15:01 xxxxxxx CRON[19164]: pam_unix(cron:session): session closed for user root
Dec 31 08:17:01 xxxxxxx CRON[19169]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:17:01 xxxxxxx CRON[19169]: pam_unix(cron:session): session closed for user root
Dec 31 08:25:01 xxxxxxx CRON[19229]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:25:01 xxxxxxx CRON[19229]: pam_unix(cron:session): session closed for user root
Dec 31 08:35:01 xxxxxxx CRON[19314]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:35:01 xxxxxxx CRON[19314]: pam_unix(cron:session): session closed for user root
Dec 31 08:45:01 xxxxxxx CRON[19412]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:45:01 xxxxxxx CRON[19412]: pam_unix(cron:session): session closed for user root
Dec 31 08:55:01 xxxxxxx CRON[19472]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 08:55:01 xxxxxxx CRON[19472]: pam_unix(cron:session): session closed for user root
Dec 31 09:05:01 xxxxxxx CRON[19537]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:05:01 xxxxxxx CRON[19537]: pam_unix(cron:session): session closed for user root
Dec 31 09:15:01 xxxxxxx CRON[19581]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:15:01 xxxxxxx CRON[19581]: pam_unix(cron:session): session closed for user root
Dec 31 09:17:01 xxxxxxx CRON[19608]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:17:01 xxxxxxx CRON[19608]: pam_unix(cron:session): session closed for user root
Dec 31 09:25:01 xxxxxxx CRON[19641]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:25:01 xxxxxxx CRON[19641]: pam_unix(cron:session): session closed for user root
Dec 31 09:35:01 xxxxxxx CRON[19707]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:35:01 xxxxxxx CRON[19707]: pam_unix(cron:session): session closed for user root
Dec 31 09:45:01 xxxxxxx CRON[19766]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:45:01 xxxxxxx CRON[19766]: pam_unix(cron:session): session closed for user root
Dec 31 09:55:01 xxxxxxx CRON[19827]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 09:55:01 xxxxxxx CRON[19827]: pam_unix(cron:session): session closed for user root
Dec 31 10:05:01 xxxxxxx CRON[19889]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:05:01 xxxxxxx CRON[19889]: pam_unix(cron:session): session closed for user root
Dec 31 10:15:01 xxxxxxx CRON[19948]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:15:01 xxxxxxx CRON[19948]: pam_unix(cron:session): session closed for user root
Dec 31 10:17:01 xxxxxxx CRON[19976]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:17:01 xxxxxxx CRON[19976]: pam_unix(cron:session): session closed for user root
Dec 31 10:25:01 xxxxxxx CRON[20010]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:25:01 xxxxxxx CRON[20010]: pam_unix(cron:session): session closed for user root
Dec 31 10:35:01 xxxxxxx CRON[20068]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:35:01 xxxxxxx CRON[20068]: pam_unix(cron:session): session closed for user root
Dec 31 10:45:01 xxxxxxx CRON[20126]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:45:01 xxxxxxx CRON[20126]: pam_unix(cron:session): session closed for user root
Dec 31 10:55:01 xxxxxxx CRON[20184]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 10:55:01 xxxxxxx CRON[20184]: pam_unix(cron:session): session closed for user root
Dec 31 11:05:01 xxxxxxx CRON[20242]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:05:01 xxxxxxx CRON[20242]: pam_unix(cron:session): session closed for user root
Dec 31 11:15:01 xxxxxxx CRON[20355]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:15:01 xxxxxxx CRON[20355]: pam_unix(cron:session): session closed for user root
Dec 31 11:17:01 xxxxxxx CRON[20368]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:17:01 xxxxxxx CRON[20368]: pam_unix(cron:session): session closed for user root
Dec 31 11:25:01 xxxxxxx CRON[20424]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:25:01 xxxxxxx CRON[20424]: pam_unix(cron:session): session closed for user root
Dec 31 11:35:01 xxxxxxx CRON[20482]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:35:01 xxxxxxx CRON[20482]: pam_unix(cron:session): session closed for user root
Dec 31 11:45:01 xxxxxxx CRON[20540]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:45:01 xxxxxxx CRON[20540]: pam_unix(cron:session): session closed for user root
Dec 31 11:55:01 xxxxxxx CRON[20610]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 11:55:01 xxxxxxx CRON[20610]: pam_unix(cron:session): session closed for user root
Dec 31 12:05:01 xxxxxxx CRON[20672]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:05:01 xxxxxxx CRON[20672]: pam_unix(cron:session): session closed for user root
Dec 31 12:15:01 xxxxxxx CRON[20738]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:15:01 xxxxxxx CRON[20738]: pam_unix(cron:session): session closed for user root
Dec 31 12:17:01 xxxxxxx CRON[20747]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:17:01 xxxxxxx CRON[20747]: pam_unix(cron:session): session closed for user root
Dec 31 12:25:01 xxxxxxx CRON[20811]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:25:01 xxxxxxx CRON[20811]: pam_unix(cron:session): session closed for user root
Dec 31 12:35:01 xxxxxxx CRON[20873]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:35:01 xxxxxxx CRON[20873]: pam_unix(cron:session): session closed for user root
Dec 31 12:45:02 xxxxxxx CRON[20935]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:45:02 xxxxxxx CRON[20935]: pam_unix(cron:session): session closed for user root
Dec 31 12:55:01 xxxxxxx CRON[20984]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 12:55:02 xxxxxxx CRON[20984]: pam_unix(cron:session): session closed for user root
Dec 31 13:05:01 xxxxxxx CRON[21042]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:05:01 xxxxxxx CRON[21042]: pam_unix(cron:session): session closed for user root
Dec 31 13:15:01 xxxxxxx CRON[21212]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:15:01 xxxxxxx CRON[21212]: pam_unix(cron:session): session closed for user root
Dec 31 13:17:01 xxxxxxx CRON[21240]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:17:01 xxxxxxx CRON[21240]: pam_unix(cron:session): session closed for user root
Dec 31 13:25:01 xxxxxxx CRON[21299]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:25:01 xxxxxxx CRON[21299]: pam_unix(cron:session): session closed for user root
Dec 31 13:35:01 xxxxxxx CRON[21378]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:35:01 xxxxxxx CRON[21378]: pam_unix(cron:session): session closed for user root
Dec 31 13:45:01 xxxxxxx CRON[21439]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:45:01 xxxxxxx CRON[21439]: pam_unix(cron:session): session closed for user root
Dec 31 13:55:01 xxxxxxx CRON[21497]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 13:55:01 xxxxxxx CRON[21497]: pam_unix(cron:session): session closed for user root
Dec 31 14:05:01 xxxxxxx CRON[21561]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 14:05:01 xxxxxxx CRON[21561]: pam_unix(cron:session): session closed for user root
Dec 31 14:15:01 xxxxxxx CRON[21631]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 14:15:01 xxxxxxx CRON[21631]: pam_unix(cron:session): session closed for user root
Dec 31 14:17:01 xxxxxxx CRON[21657]: pam_unix(cron:session): session opened for user root by (uid=0)
Dec 31 14:17:01 xxxxxxx CRON[21657]: pam_unix(cron:session): session closed for user root

这是我的 crontab:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

# cron to backup all the databases in 1 gzipped file every midnight
0 0     * * *   root    bash /home/db_backup.sh > /dev/null 2>&1

# cron to update CloudFlare list of IPs for set_real_ip_from (nginx)
0 21    * * 0  root bash /etc/nginx/cloudflare-ips.sh > /dev/null 2>&1

每 2 分钟、5 分钟或 10 分钟(12 月 31 日 12:05、12 月 31 日 12:15、12 月 31 日 12:17,...)无需执行任何操作!是什么导致这些会话一直打开和关闭(在一个小的时间间隔内)?

logging
  • 1 个回答
  • 11658 Views
Martin Hope
MultiformeIngegno
Asked: 2012-12-31 12:35:12 +0800 CST

Nginx 即时配置重新加载导致错误

  • 0

我试图运行“nginx -c /etc/nginx/nginx.conf”但我得到:

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[Exit 1]

然后我运行一个

 fuser -k 80/tcp ; service nginx restart.

我再次尝试使用“nginx -c /etc/nginx/nginx.conf”但仍然出现相同的错误“[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)”

为什么会这样?

nginx
  • 1 个回答
  • 2317 Views
Martin Hope
MultiformeIngegno
Asked: 2012-09-25 13:52:07 +0800 CST

如果直接访问 (nginx),则拒绝加载 php 文件

  • 0

我不知道这是否可以实现...无论如何我会尝试。如果直接加载(您将浏览器指向直接 URL),我想拒绝查看某个文件夹中的 php 文件,但前提是您在某个页面上单击指向它们的链接。这可以在具有位置的 nginx 中实现吗?这不涉及任何安全问题,因此如果该方法不是 100% 安全,那也不是问题……

编辑:好的,让我们添加一些细节。我有一个 VPS,我有一个带有登录框的页面。输入登录详细信息后,您将访问一个页面,该页面包含指向 phpinfo/phpsysinfo/webmin 面板/apc status/nginx status 的链接。因此,您可以在一个页面上链接到软件来监控我的 VPS 的统计信息。我知道通过默默无闻的安全性并不好,但我觉得让这些信息没有真正暴露会更舒服。所以我想拒绝访问那些拒绝直接访问的页面(全部在 1 个目录中)(但前提是您来自受登录框保护的页面)。

php
  • 2 个回答
  • 1849 Views
Martin Hope
MultiformeIngegno
Asked: 2012-09-23 08:00:34 +0800 CST

如果我不应该使用 root 用户,为什么还要保留它?

  • 0

我正在使用 Ubuntu Server 12.04 的全新 VPS。我想请教您应用哪些良好实践来增强现有 Ubuntu 服务器的安全性。

这是我到目前为止所做的: 我将 Google Authenticator 添加到 SSH,然后我创建了一个新用户(我将使用该用户而不是“root”来进行 SSH 和 SFTP 访问),我将其添加到下面的 /etc/sudoers 列表中'root',所以现在是:

 # User privilege specification
 root     ALL=(ALL:ALL) ALL
 new_user ALL=(ALL:ALL) ALL

然后我编辑了 sshd_config 并将 PermitRootLogin 设置为“no”。然后重启ssh服务。

这个可以吗?不过有几件事想问你:

1) 在 root 用户仍然存在的情况下添加一个新的 (sudoer) 用户有什么意义(好的,它不能以 root 权限访问,但它仍然存在..)?2) 系统文件归“root”所有。我想使用我的 new_user 通过 SFTP 访问,但我无法编辑这些文件!我是否应该对它们进行批量 CHMOD,以便 new_user 也具有写入权限?这有什么好的做法?

在此先感谢,如果我做错了什么和/或其他保护系统的方法,我希望你能告诉我。:)

ubuntu
  • 2 个回答
  • 234 Views
Martin Hope
MultiformeIngegno
Asked: 2012-09-21 05:48:11 +0800 CST

在 Ubuntu Server 上使用新用户更改默认 root 用户

  • 0

我有一个 VPS,直到现在我都使用默认root用户进行 SSH 访问和所有操作。出于安全原因,我想使用不同的用户进行 root、终端访问和 sudo 操作。所以我创建了另一个用户,给了他 sudo 和所有其他权限。

问题是所有系统文件都属于root. 如果我为 设置 PermitRootLogin No 会root怎样?新的 root 用户将无法编辑这些文件!

ubuntu
  • 1 个回答
  • 426 Views
Martin Hope
MultiformeIngegno
Asked: 2012-07-18 14:43:14 +0800 CST

更改 tar 参数

  • -2

我想更改我实际用来将文件放入 tar 存档的命令以实现此目的:

1) 从存档中删除目录树(实际上 .tar.gz 文件保留了文件树。我希望文件成为“父文件”)。

2) 删除用于创建存档的文件,只留下新的 .tar.gz

BACKUP_DEST=/home/backup/db/`date +\%G-\%m-\%d`
tar -czvf ${BACKUP_DEST}/files.tar.gz ${BACKUP_DEST}
archive command tar
  • 1 个回答
  • 58 Views
Martin Hope
MultiformeIngegno
Asked: 2012-07-18 09:18:54 +0800 CST

在 1 个文件中备份 MySQL 数据库,但每个数据库都有单独的 .tar.gz

  • 4

我现在在 cron 中使用它来备份 1 个 sql.gz 文件中的所有数据库:

0 0     * * *   root    mysqldump -u root -pPASSWORD --all-databases | gzip > /home/backup/db/`date +\%G-\%m-\%d`_db.sql.gz

我想要一个 .tar.gz 文件,其中包含 X 个其他存档,用于我拥有多少个数据库。这可能吗?

backup mysql database
  • 3 个回答
  • 2971 Views
Martin Hope
MultiformeIngegno
Asked: 2012-07-11 12:15:59 +0800 CST

PHP5-FPM 的 I/O 错误,ptrace(PEEKDATA) 失败

  • 2

我有很多这样的:

[NOTICE] child 19214 stopped for tracing 
[NOTICE] about to trace 19214 
[ERROR] ptrace(PEEKDATA) failed: Input/output error (5) 
[NOTICE] finished trace of 19214 
[WARNING] [pool www] child 19208, script 'blahblah.php' executing too slow (30.041419 sec), logging 
[NOTICE] child 19208 stopped for tracing 
[NOTICE] about to trace 19208 
[ERROR] ptrace(PEEKDATA) failed: Input/output error (5) 
[NOTICE] finished trace of 19208 
[WARNING] [pool www] child 19218, script 'blahblah.php' executing too slow (30.035029 sec), logging 

当 php 达到 max children 时(至少我认为是这种情况)它停止“工作”......现在我知道我可以增加 max_children (当前设置为 9)但是有一种方法可以阻止 php “死亡”?

我使用的是具有 1 个内核和 512 MB 内存的 VPS (PHP5-FPM 5.4.4 + APC 3.1.10)。


禁用慢速日志后,我现在得到:

WARNING: [pool www] child 1684 exited on signal 15 (SIGTERM) after 77.802376 seconds from start
NOTICE:  [pool www] child 1694 started
WARNING: [pool www] child 1377, script 'blahblah.php' (request: "GET /blahblah.php") execution timed out (38.291440 sec), terminating
WARNING: [pool www] child 1377 exited on signal 15 (SIGTERM) after 2750.295279 seconds from start
NOTICE:  [pool www] child 1696 started
WARNING: [pool www] child 1722, script 'blahblah.php' (request: "POST /blahblah.php") execution timed out (39.653910 sec), terminating
WARNING: [pool www] child 1722 exited on signal 15 (SIGTERM) after 793.953090 seconds from start

我认为这些脚本这么慢是不正常的。你建议玩max_execution_time?

php php5 php-fpm alternative-php-cache
  • 2 个回答
  • 24713 Views
Martin Hope
MultiformeIngegno
Asked: 2012-07-11 01:43:43 +0800 CST

奇怪的 PHP 警告(无法加载动态库:no-debug-non-zts-20100525)

  • 0

我在apc.ini中临时设置了apc.enable_cli=1,然后运行php -r "apc_clear_cache();" 在终端中清除 APC 缓存,但这就是我得到的:

PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mcrypt.so' - /opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mysql.so' - /opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mysqli.so' - /opt/php5/lib/php/extensions/no-debug-non-zts-20100525/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php5/lib/php/extensions/no-debug-non-zts-20100525/pdo.so' - /opt/php5/lib/php/extensions/no-debug-non-zts-20100525/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/php5/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so' - /opt/php5/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

我在 Ubuntu Server 12.04 (VPS) 上运行 PHP-FPM 5.4.3、Nginx 1.3.1 和 APC 3.1.10。你知道这些错误是什么意思吗?

php alternative-php-cache
  • 1 个回答
  • 13304 Views
Martin Hope
MultiformeIngegno
Asked: 2012-06-16 14:20:26 +0800 CST

具有多个网站的 Exim4

  • 0

我在 Ubuntu Server 12.04 上,我设法按照本指南安装和配置 Exim4 。

我将主机名设置为“multiformeingegno.com”,我的 /etc/hosts 如下所示:

127.0.0.1                           localhost
127.0.1.1                           multiformeingegno
IPv4 ADDRESS                        multiformeingegno.com      multiformeingegno
IPv6 ADDRESS                        multiformeingegno.com      multiformeingegno

我可以通过 PHP 发送邮件就好了。我有两个问题。

  1. 我在 VPS 上,我的主机就像 xxxxx.server.topcloud.it,我想在我发送的邮件中隐藏这个地址!我可以从标签中查看:收到:来自 multiformeingegno.com (xxxxxx.server.topcloud.it. [IPv4 地址])

  2. 在我的 VPS 上,我托管了多个站点。如何根据“正在使用”的域更改我的主机名/fqdn(如果我使用的术语不当请纠正我)?例如,我在我的网站 multiformeingegno.com 中有一个联系表,在另一个网站 example.com 中有另一个联系表。如何根据实际发送邮件的网站更改“返回路径”、“接收自”等?这可能吗?

ubuntu email smtp exim
  • 3 个回答
  • 887 Views
Martin Hope
MultiformeIngegno
Asked: 2012-06-11 15:22:31 +0800 CST

nginx 的 Phpmyadmin 位置

  • 5

我安装了 nginx 和 phpmyadmin。我用这些参数设置了一个域来测试 phpmyadmin:

server {
listen 80;
server_name example.com;

root /usr/share/phpmyadmin;
index index.php;
fastcgi_index index.php;

location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}


}

一切正常(如果我访问该域,我可以登录到 phpmyadmin)。问题是它只是为了测试 phpmyadmin,现在我想把它移到我的“默认”站点。但我不知道如何将它放在 /phpmyadmin 上。这是“默认”nginx 站点的配置(我想把这个 /phpmyadmin 位置放在哪里):

server {

server_name blabla;

access_log  /var/log/nginx/$host.access.log;
error_log   /var/log/nginx/error.log;

root    /var/www/default;
index   index.php index.html;

location / {
try_files $uri $uri/ index.php;
}  

location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}

### NginX Status
location /nginx_status {
stub_status on;
access_log   off; 
}

### FPM Status
location ~ ^/(status|ping)$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
access_log      off;
}

}
nginx php-fpm
  • 2 个回答
  • 25738 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