存档

‘√web’ 分类的存档

在Windows平台上升级MySQL步骤

2010年11月16日 1 条评论

1.备份旧数据
2.停止旧服务器
3.从windows的系统服务中删掉mysql服务,用如下命令:

C:\> C:\\bin\mysqld –remove

4.用可执行安装文件方式安装mysql,或者解压可直接执行的二进制压缩包来安装
5.重新注册mysql服务,用如下命令:

C:\> C:\mysql\bin\mysqld –install

6.重启服务器

nginx限制目录IP访问

2010年6月26日 没有评论

location ~ ^/phpmyadmin/ {
allow 1.1.1.0/24;
allow 2.2.2.2.2/32;
deny all;
index index. index.do index.html index.htm;

location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
}

分类: √nginx, √web 标签: , ,

查看apache、mysql、php编译参数

2010年6月19日 1 条评论

apache编译参数:

通过编译安装文件夹下的cat config.status文件进行查看;

或到安装目录如/usr/local/2/build下的config.nice文件查看。

php编译参数:

直接通过命令:/usr/local//bin/ -i |grep configure ;

或者通过编译安装文件夹下的cat config.nice文件进行查看;

或利用phpinfo()参数进行查看。

mysql编译参数:

直接通过命令:cat “/usr/local//bin/mysqlbug”|grep configure ;

分类: √linux, √web 标签: , ,

nginx+fastcgi(11: Resource temporarily unavailable)

2010年6月3日 没有评论

connect() to unix:/tmp/-cgi.sock failed (11: ) while connecting to upstream,

PHP-FPM 配置文件中的:

-1
改成:
1024

参考

http://forum.nginx.org/read.php?3,31467,31467

nagios配置文件

2010年5月31日 没有评论

个人觉得这东西太难搞了。尽管网上教程那么多。也请教了不少人。但我还是很艰难的才搞成。。
我太笨了……
.cfg
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/usr/local/nagios/etc/objects/services.cfg
cfg_file=/usr/local/nagios/etc/objects/hosts.cfg
cfg_file=/usr/local/nagios/etc/objects/hostgroups.cfg
cfg_file=/usr/local/nagios/etc/objects/contactgroups.cfg

[root@moniter objects]# more contacts.cfg
define contact{
contact_name vi;
alias sys admin
service_notification_period 24×7
host_notification_period 24×7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email viyin@yahoo.com
pager 1391119xxxx
}

[root@moniter objects]# more contactgroups.cfg
define contactgroup{
contactgroup_name vis;
alias roots;
members vi
}

[root@moniter objects]# more hosts.cfg
define host{
# use host-pnp
host_name viyin.net
alias www
address 218.6.15.105
check_command check-host-alive
max_check_attempts 3
check_period 24×7
contact_groups vis
notification_interval 10
notification_period 24×7
notification_options d,u,r
}
[root@moniter objects]# more hostgroups.cfg
define hostgroup{
hostgroup_name linux-servers
alias linux-servers
members viyin.net
}

[root@moniter objects]# more services.cfg
define service{
# use srv-pnp
host_name viyin.net
service_description Current Users
check_command check_local_users!20!50
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
check_period 24×7
notification_interval 10
notification_period 24×7
notification_options w,u,c,r
contact_groups vis
}

分类: √linux, √web 标签: ,

nginx反向代理discuz设置

2010年5月6日 1 条评论

ip 1.1.1.1:80 -> 1.1.1.2:8080 ->1.1.1.2:80

1.1.1.1
nginx文件配置

server
{
listen 80;
server_name www.viyin.net;
index index.html index.htm index. default.html default.htm de
fault.php;

location / {
_pass http://1.1.1.2:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header User-Agent;
proxy_set_header Host $host;
# 转发host的信息,如果不设置host,在后台使用request.getServerName()取到的域名不是www.viyin.net,而是127.0.0.1
# 因Discuz! 为了安全,需要获取客户端User-Agent来判断每次POST数据是否跟第一次请求来自同1个浏览器,
# 如果不转发User-Agent,Discuz! 提交数据就会报”您的请求来路不正确,无法提交”的错误

}
location /bbs/ {

proxy_pass http://1.1.1.2:8080/bbs/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header User-Agent;
proxy_set_header Host $host;
}

1.1.1.2

location ~ \.php$ {
proxy_pass http://127.0.0.1:81;
proxy_redirect off;
#proxy_set_header Host $proxy_host;
proxy_pass_header User-Agent;
proxy_set_header Host $host;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_hide_header Content-Type;

分类: √web 标签: ,

nginx权限控制

2010年5月5日 没有评论

1、用低权限账号运行Nginx。例www

2、在php.ini中禁用危险的函数。如:system,passthru,shell_exec,exec,popen,proc_open,chroot,scandir,chgrp,chown等,但禁止太多的函数可能对某些php程序的正常运行产生影响。

3、在php.ini中设置open_basedir,如:open_basedir = “/usr/local/webserver/nginx/html/www.xpb.cn_7da347bc1a9fd621/:/usr/local/webserver/nginx/html/viyin.cn_7da347bc1a9fd621/”

4、禁止目录遍历,各个虚拟主机用户放在不易于猜到的目录,如:www.viyin.net_7da347bc1a9fd621、viyin.cn_7da347bc1a9fd621

5、自己找一个php木马,自我测试服务器安全!

分类: √web 标签: ,