分类目录归档:Linux
nginx: [emerg] unknown directive “proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for” in
$remote_addr 可信时才能信任 X-Forwarded-For、$proxy_add_x_forwarded_for
nginx配置代理转发,部分配置如下
location / {
# index index.html index.htm index.php;
# try_files $uri $uri/ /index.php$request_uri;
proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Real-Port $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://10.29.185.61:8063;
}
$proxy_add_x_forwarded_forthe “X-Forwarded-For” client request header field with the $remote_addr variable appended to it, separated by a comma. If the “X-Forwarded-For” field is not present in the client request header, the $proxy_add_x_forwarded_for variable is equal to the $remote_addr variable.
“ X-Forward-For”客户端请求头字段,后面附加 $remote _ addr 变量,中间用逗号分隔。如果客户端请求头中没有“ X-Forward-For”字段,则 $proxy_add_x_forwarded_for 变量等于 $remote_addr 变量。
shadowsocks服务端快速搭建
Install (centos7)
yum install python-setuptools && easy_install pip pip install git+https://github.com/shadowsocks/shadowsocks.git@master
Usage
ssserver -p 443 -k password -m aes-256-cfb
To run in the background:
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
To stop:
sudo ssserver -d stop
To check the log:
sudo less /var/log/shadowsocks.log
pecl update mongodb 1.1.* to 1.2.* 导致 php-fpm 全部立即段错误并失去控制,systemctl restart php-fpm失败
第二次遇到了~
ps -ef | grep php-fpm | cut -c 9-15 | xargs kill && systemctl restart php-fpm
Dec 15 20:40:02 web4 systemd: Removed slice User Slice of root.
Dec 15 20:40:02 web4 systemd: Stopping User Slice of root.
Dec 15 20:40:25 web4 kernel: traps: php-fpm[10171] general protection ip:7f4046d83120 sp:7ffc76043de0 error:0 in mongodb.so[7f4046d57000+be000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1770] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1771] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1772] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1773] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1774] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1775] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1776] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1777] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1778] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:26 web4 systemd: Stopping LSB: starts php-fpm...
goaccess log-format 参数说明
log-format The log-format variable followed by a space or \t for tab-delimited, specifies the log format string.
SPECIFIERS
%xA date and time field matching the time-format and date-format variables. This is used when a timestamp is given instead of the date and time being in two separate variables.%ttime field matching the time-format variable.%ddate field matching the date-format variable.%vThe server name according to the canonical name setting (Server Blocks or Virtual Host).%eThis is the userid of the person requesting the document as determined by HTTP authentication.%hhost (the client IP address, either IPv4 or IPv6)%rThe request line from the client. This requires specific delimiters around the request (single quotes, double quotes, etc) to be parsable. Otherwise, use a combination of special format specifiers such as%m,%U,%qand%Hto parse individual fields.- Note: Use either
%rto get the full request OR%m,%U,%qand%Hto form your request, do not use both.
- Note: Use either
%mThe request method.%UThe URL path requested.- Note: If the query string is in
%U, there is no need to use%q. However, if the URL path, does not include any query string, you may use%qand the query string will be appended to the request.
- Note: If the query string is in
%qThe query string.%HThe request protocol.%sThe status code that the server sends back to the client.%bThe size of the object returned to the client.%RThe “Referer” HTTP request header.%uThe user-agent HTTP request header.%DThe time taken to serve the request, in microseconds.%TThe time taken to serve the request, in seconds with milliseconds resolution.%LThe time taken to serve the request, in milliseconds as a decimal number.%^Ignore this field.%~Move forward through the log string until a non-space (!isspace) char is found.~hThe host (the client IP address, either IPv4 or IPv6) in a X-Forwarded-For (XFF) field.
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/vg1-lvMysql
resize2fs 对xfs无效问题
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/vg1-lvMysql
Couldn’t find valid filesystem superblock.
xfs_growfs /dev/centos/root df -h
ref:https://www.cnblogs.com/pinganzi/p/6478255.html
[root@web5 ~]# xfs_growfs /mnt/mysql
meta-data=/dev/mapper/vg1-lvMysql isize=512 agcount=4, agsize=7864320 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=31457280, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=15360, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 31457280 to 44564480
authorized_keys
chmod 600 .ssh/authorized_keys
chmod 700 .ssh
LVM新安装初始化
/dev/vdb 为空白新磁盘
创建pv
pvcreate /dev/vdb
创建vg
vgcreate vg1 /dev/vdb
创建lv
lvcreate -L 100G -n lvMongodb vg1
或者(使用100%的剩余空间)
lvcreate -l 100%Free -n lvMysql vg1
LVM LV热扩容[ext4]
lvextend -L +5G /dev/mapper/vg1-lvMysql
resize2fs /dev/mapper/vg1-lvMysql
当然前提是PV还有PFree可以使用
org.apache.solr.common.SolrException: Exception writing document id 663b167f2d661568 to the index; possible analysis error: cannot change DocValues type from SORTED_SET to NUMERIC for field “is_original”
org.apache.solr.common.SolrException: Exception writing document id 663b167f2d661568 to the index; possible analysis error: cannot change DocValues type from SORTED_SET to NUMERIC for field "is_original"
我这里修改tints类型为tint类型,导致新数据无法写入,字段删除完毕了,也reload了没有,只要清理的数据才行
<delete><query>*:*</query></delete> <commit/>