参数介绍
选项 名称 功能
-n Hostnames 不将地址解析成主机名。
-h Maximum hops 搜索目标的最大跃点数。
-g Host-list 沿着路由列表释放源路由。
-p Period 在 ping 之间等待的毫秒数。
-q Num_queries 每个跃点的查询数。
-w Time-out 为每次回复所等待的毫秒数。
-T Layer 2 tag 将第 2 层优先级标记(例如,对于 IEEE 802.1p)连接到数据包并将它发送到路径中的每个网络设备。这有助于标识没有正确配置第 2 层优先级的网络设备。-T 开关用于测试服务质量 (QoS) 连通性。
-R RSVP isbase Che检查以确定路径中的每个路由器是否支持“资源保留协议 (RSVP)”,此协议允许主机为数据流保留一定量的带宽。 -R 开关用于测试服务质量 (QoS) 连通性。
默认的跃点数是 30,并且超时前的默认等待时间是 3 秒。默认时间是 250 毫秒,并且沿着路径对每个路由器进行查询的次数是 100。
以下是典型的 pathping 报告。跃点列表后所编辑的统计信息表明在每个独立路由器上数据包丢失的情况。
C:\Documents and Settings\Administrator>pathping www.163.com
Tracing route to 163.xdwscache.glb0.lxdns.com [60.173.8.216]
over a maximum of 30 hops:
0 ZHJ-WORK [192.168.1.166]
1 60.168.112.1
2 60.168.112.1
3 61.190.245.45
4 118.84.1.9
5 118.84.2.6
6 61.191.10.102
7 60.173.8.22
8 60.173.8.216
Computing statistics for 200 seconds...
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 ZHJ-WORK [192.168.1.166]
0/ 100 = 0% |
1 3ms 0/ 100 = 0% 0/ 100 = 0% 60.168.112.1
0/ 100 = 0% |
2 2ms 0/ 100 = 0% 0/ 100 = 0% 60.168.112.1
0/ 100 = 0% |
3 3ms 0/ 100 = 0% 0/ 100 = 0% 61.190.245.45
0/ 100 = 0% |
4 5ms 0/ 100 = 0% 0/ 100 = 0% 118.84.1.9
0/ 100 = 0% |
5 8ms 0/ 100 = 0% 0/ 100 = 0% 118.84.2.6
0/ 100 = 0% |
6 6ms 0/ 100 = 0% 0/ 100 = 0% 61.191.10.102
0/ 100 = 0% |
7 8ms 0/ 100 = 0% 0/ 100 = 0% 60.173.8.22
0/ 100 = 0% |
8 8ms 0/ 100 = 0% 0/ 100 = 0% 60.173.8.216
Trace complete.
当运行 pathping 时,在测试问题时首先查看路由的结果。此路径与 tracert 命令所显示的路径相同。然后 pathping 命令对下一个 125 毫秒显示忙消息(此时间根据跃点计数变化)。在此期间,pathping 从以前列出的所有路由器和它们之间的链接之间收集信息。在此期间结束时,它显示测试结果。
user www www;
worker_processes 8;
error_log /var/log/nginx_error.log crit;
pid /usr/local/nginx/nginx.pid;
worker_rlimit_nofile 65535;
events
{
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 8m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;
server
{
listen 80;
server_name 192.168.10.60;
root /PATH/TO/YOUR/CI/FORLDER;
index index.html index.htm index.php index.shtml;
if ($request_filename !~* /(javascript|css|images|fckeditor|userfiles|crontab|robots\.txt|index\.php))
{
rewrite ^/(.*)$ /index.php?$1 last;
}
access_log /var/log/192.168.10.60-access.log;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht
{
deny all;
}
}
}
1.要尝试使用MongoDB首先必须要在命令行运行mongod服务
a. cd MONGO_HOME/bin
b. ./mongod --dbpath /data/mongodb/db/ --logpath /data/mongodb/logs/mongolog --logappend --fork
参数说明
--dbpath #指定db文件存放的目录
--port #指定mongod服务使用的端口
--fork #设置mongo服务为后台运行
--logpath #指定log文件的目录和文件名
--logappend #设置每次log添加在文件最后
--rest #关闭rest api功能
--nohttpinterface #关闭web管理功能
--auth #指定mongo使用身份验证机制
--bindip #用逗号分隔ip地址,用来指定
--f #将所有前面介绍的参数都可以存放到一个配置文件中,然后用这个参数调用配置文件来启动mongod服务
2.关闭MongoDB有几种方法
a. db.shutdownServer() #推荐优先使用
b. ctrl + c #在不使用 --fork参数的时候可以使用,可能会造成数据文件损坏
c. kill / kill -2 #在无法使用 a和b的情况下使用,可能会造成数据文件损坏
d. kill -9 #不在万不得已的情况下,不要使用这个方法
3. 查看MongoDB状态
a.db.runCommand({"serverStatus":1})
b.MONGO_HOME/bin/mongostat
4. 添加用户,切换用户 使 --auth参数起效
db.addUser("root","123")
db.addUser("read_only","123",true); #第3个参数表示设置readonly的状态
db.auth("read_only","123")
5. 数据库备份
有4种方法备份数据库
a. 关闭mongod服务后,复制--dbpath参数指定的数据文件。优点速度快,缺点需要停止mongo服务。
b. 使用mongodump 导出数据,并用mongorestore 导入数据。优点不需要停止mongo服务,缺点在mongodump操作时用户插入的数据可能无法备份出来。
c. fsync and lock锁定数据库的让用户只能使用read功能,再使用方法b导出并导入数据。优点不需要停止mongo服务,缺点在数据库lock期间用户无法执行insert操作。
d. 使用slaveDB并且 使用方法c锁定slaveDB,再使用方法b导出并导入数据。优点不需要停止mongo服务,不会影响用户insert操作(推荐使用此方法)。
6. 修复数据库
当数据库文件遭到损坏的时候有3种方法修复数据文件
a. MONGO_HOME/bin/mongod --repair
b. use test
db.repairDatabase()
c. db.runCommand({"repairDatabase":1});
编辑/usr/local/webserver/php/etc/php.ini 文件,搜索 cgi.fix_pathinfo ,如果cgi.fix_pathinfo 该行为 ; cgi.fix_pathinfo=0 请修改为 cgi.fix_pathinfo=0
或直接执行:sed -i 's/; cgi.fix_pathinfo=0/cgi.fix_pathinfo=0/g' /usr/local/webserver/php/etc/php.ini
再执行:/usr/local/webserver/php/sbin/php-fpm restart 重启php-fpm
如果是cgi.fix_pathinfo=0则没问题,不需要修改。
请各位lnmp(linux+nginx+mysql+php)用户检查一下,防止pathinfo漏洞给网站或服务器带来安全隐患。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
a1:ee:9e:76:32:ab:79:83:21:c1:d1:eb:35:44:fe:b4.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:13
RSA host key for 192.168.1.6 has changed and you have requested strict checking.
Host key verification failed.
原因就是在上次登录到那台机器之后,我把那台虚拟机重新做了系统,导致Host key和之前保存的不一致,所以提示KEY 验证失败不能登录。
解决方法很简单: vi /root/.ssh/known_hosts 删除掉那个IP对应的公钥,保存退出再连接就可以了。








