在Windows平台上升级MySQL步骤
1.备份旧数据
2.停止旧服务器
3.从windows的系统服务中删掉mysql服务,用如下命令:
C:\> C:\mysql\bin\mysqld –remove
4.用可执行安装文件方式安装mysql,或者解压可直接执行的二进制压缩包来安装
5.重新注册mysql服务,用如下命令:
C:\> C:\mysql\bin\mysqld –install
6.重启服务器
1.备份旧数据
2.停止旧服务器
3.从windows的系统服务中删掉mysql服务,用如下命令:
C:\> C:\mysql\bin\mysqld –remove
4.用可执行安装文件方式安装mysql,或者解压可直接执行的二进制压缩包来安装
5.重新注册mysql服务,用如下命令:
C:\> C:\mysql\bin\mysqld –install
6.重启服务器
location ~ ^/phpmyadmin/ {
allow 1.1.1.0/24;
allow 2.2.2.2.2/32;
deny all;
index index.php 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;
}
}
connect() to unix:/tmp/php-cgi.sock failed (11: Resource temporarily unavailable) while connecting to upstream,
PHP-FPM 配置文件中的:
改成:
参考
http://forum.nginx.org/read.php?3,31467,31467
个人觉得这东西太难搞了。尽管网上教程那么多。也请教了不少人。但我还是很艰难的才搞成。。
我太笨了……
nagios.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
}
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.php default.html default.htm de
fault.php;
location / {
proxy_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;
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木马,自我测试服务器安全!