Posts Tagged error

cPanel License 过期的另一种可能

今天有台VPS服务器的网络节点出错,服务器提供商修了一下午,好了,但登陆cpanel时发过提示License过期

到http://www.cpanel.net/apps/verify/index.cgi输入我的VPS主IP查询并没有过期

于是使用/usr/local/cpanel/cpkeyclt更新,提示如下:

Updating cPanel license…Done. Update Failed!
Error message:
The cPanel license server said that your license has been expired.
For more information visit: http://www.cpanel.net/lic.html

The exact message was: The license is expired. (XXX.XXX.XXX.XXX)!

Building global cache for cpanel…Done

其中那个IP(XXX.XXX.XXX.XXX)是我的VPS上的另一个独立IP,我怀疑是因为网络故障造成了主IP变动,或因为我重启过VPS,造成新加进来的IP又重新自动排序了下,结果也是主IP变动

那就改回来吧,进入/etc/sysconfig/network-scripts/目录,查找ifcfg-venet0:0~ifcfg-venet0:X等文件

将原来的主IP更换到ifcfg-venet0:0,这应该是默认的主IP所在的配置文件

然后/etc/init.d/network reload,使更改生效,提示如下:Shutting down interface venet0:                            [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface venet0:  SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
                                                           [  OK  ]
再试更新cpanel License

# /usr/local/cpanel/cpkeyclt
Updating cPanel license…Done. Update succeeded.
Building global cache for cpanel…Done

问题解决

  • Share/Bookmark

Tags: , , , , , , ,

CentOS 5 优化方案

系统环境部署及调整
检查系统是否正常
# more /var/log/messages (检查有无系统内核级错误信息)
# dmesg (检查硬件设备是否有错误信息)
# ifconfig(检查网卡设置是否正确)
# ping www.163.com (检查网络是否正常)

[1] 停止打印服务

  如果不准备提供打印服务,停止默认被设置为自动启动的打印服务。

root@sample ~]#/etc/rc.d/init.d/cups stop ← 停止打印服务
Stopping cups:            [OK]    ← 停止服务成功,出现“OK”

[root@sample ~]#chkconfig cups off ← 禁止打印服务自动启动

[root@sample ~]#chkconfig –list cups ← 确认打印服务自启动设置状态
cups0:off 1:off 2:off 3:off 4:off 5:off 6:off ← 0-6都为off的状态就OK(当前打印服务自启动

被禁止中)
[2] 停止ipv6

  在CentOS默认的状态下,ipv6是被启用的状态。因为我们不使用ipv6,所以,停止ipv6,以最大限

度保证安全和快速。

  首先再次确认一下ipv6功能是不是被启动的状态。

root@sample ~]#ifconfig -a ← 列出全部网络接口信息

eth0 Link encap:Ethernet HWaddr 00:0C:29:B6:16:A3
inet addr:192.168.0.13 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb6:16a3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:84 errors:0 dropped:0 overruns:0 frame.:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10288 (10.0 KiB) TX bytes:9337 (9.1 KiB)
Interrupt:185 Base address:0×1400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame.:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:952 (952.0 b) TX bytes:952 (952.0 b)

sit0 Link encap:IPv6-in-IPv4 ← 确认ipv6是被启动的状态
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame.:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
  然后修改相应配置文件,停止ipv6。

[root@sample ~]#vi /etc/modprobe.conf ← 修改相应配置文件,添加如下行到文尾:

alias net-pf-10 off
alias ipv6 off

[root@sample ~]#shutdown -r now ← 重新启动系统,使设置生效

[3]Centos5中自带的源就蛮好了,一装完我就yum install -y rdesktop了,建议保留,再加system-config-packages,装程序会事产功倍

[4]使用 yum 程序安装所需开发包(以下为标准的 RPM 包名称)
gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel

[5] 修改命令history记录
# vi /etc/profile
找到 HISTSIZE=1000 改为 HISTSIZE=200

[6] 对TCP/IP网络参数进行调整,加强抗SYN Flood能力
# echo ‘net.ipv4.tcp_syncookies = 1′ >> /etc/sysctl.conf
# sysctl -p

[7]关闭不需要的服务
# ntsysv
以下仅列出需要启动的服务,未列出的服务一律关闭:
crond
irqbalance (仅当服务器CPU为S.M.P架构或支持双核心、HT技术时,才需开启,否则关闭。)
microcode_ctl
network
random
sendmail
sshd
syslog

  • Share/Bookmark

Tags: , , , , , , , , , , , , , , , , , , , , ,

kloxo启动错误:cannot restore segment prot after reloc: Permission denied

按之前写的一键安装kloxo安装好kloxo后,发现重启动时会出错,服务不正常,SSH进去使用

service kloxo restart命令重启kloxo服务,有一大批乱码,主要的错误信息如下:

Failed loading /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so:  /usr/local/lxlabs/ext/lib/Zend/lib/Optimizer-2.5.7/php-5.2.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied

解决方法:

这是SELinux搞的鬼,解决办法有如下两个
1. 使用chcon 命令
示例: chcon -t texrel_shlib_t    /usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
2. 禁止掉SELinux
更改/etc/sysconfig/selinux 文件的内容为 SELINUX=disabled

再次重启kloxw,报错如下:

Fatal error: Call to undefined function  mysql_connect() in /usr/local/lxlabs/kloxo/httpdocs/htmllib/phplib/lib/sqlite.php on line 34

mysql_connect()函数找不到了,重启服务器,一切正常

  • Share/Bookmark

Tags: , , , , , , , , , , , ,

GET /?C=N;O=D HTTP/1.1

Site 一个废弃的站,发现只有四个google收录了,分别是:

com/images/?DA

com/images/?SA

com/images/?ND

com/images/?MA

搞不懂

而另一个网站的访问日志也有问题,请求的浏览器是Chrome/4.1.249.1045

当然,也可能是其它的,请求的地址和上面的有关系:

“GET /?C=N;O=D HTTP/1.1″

“GET /?C=M;O=A HTTP/1.1″

“GET /?C=S;O=A HTTP/1.1″

“GET /?C=D;O=A HTTP/1.1″

也是这四个鬼东西

别外,见老外的问答:

Hi,
Googlebot/2.1 (IP is 66.249.72.134) try to get such following starnge URL at our site, which it always get 404 error,

get /sub1/tacmpa.h%20…
get /sub2/ke-es%20…

Also this googlebot/2.1 also try to get some picture at starange format like,

get /pictures/MA/?C=S;O=A HTTP/1.1 200 584
get /pictures/PJ/?C=S;O=A HTTP/1.1 200 5706
get /pictures/IQ/?C=N;O=D HTTP/1.1 200 5904

Here the googlebot get 200 status, we cannot understand why,

1) It try to get picture at such strange URL, we never have such links from external or internal.

2) why googlebot/2.1 to get image? Should have another googlebot which spider images, right?

Thanks.

Here the googlebot get 200 status 
 

The first order of business is fixing that so that you serve a 404 Not Found. Otherwise the 200′s may sink you!

You may never know exactly where those URLs are coming from. Googlebot may have a coding error, or may be testing your server to see how you respond to bad URLs (that happens.) Some competitor might have noticed that you are vulnerable and is now posting those bad links somewhere. Or they may be surfing to those bad urls with the Toolbar turned on. Someone may be directly submitting those URLs. Or you may have a dynamic script on your site that is misfiring somehow.

So the urgent need you have is to start responding with a 404. Then, if you want, you can be a detective and find the source.

get /pictures/MA/?C=S;O=A HTTP/1.1 200 584
get /pictures/PJ/?C=S;O=A HTTP/1.1 200 5706
get /pictures/IQ/?C=N;O=D HTTP/1.1 200 5904
You get those if you rearrange directorylisting depending on Name,Last modified,Size or Description

 不是很清楚,不像是漏洞,而更可能是google的一个测试,或bug

现在才知道,这是目录的索引排序而已,如果网站没有index,并且没禁用目录索引的话

  • Share/Bookmark

Tags: , , , , , , ,

Email Error: Could not instantiate mail function

zencart在Contact Us提交信息时,可能会有如下错误:
Email Error: Could not instantiate mail function
这其实是我们设置不当造成的,后台email设置里要求我们以这种各式:
name
如果不这样设置的话,php的mail参数$to就为空了,因为zencart检不出我们非法的地址格式
所以报了错
换其它email方法,或除了Contact Us功能,倒是没有出现过类似的错

  • Share/Bookmark

Tags: , , ,

不知道由于什么原因,bluehost不能以PHP方式发邮件了

错误信息如下:

Email Error: Could not instantiate mail function. Please check Admin->Configuration->Email Options->Email Transport.

另有几家也是这种问题,有的甚至sendmail都不能用,而且还不能连外部SMTP服务器,网站发邮件功能等于是废了

记得bluehost之前有段时间不能用sendmail,现在又反过来,晕菜

补充,其实是我判断错了,zencart设置问题,bluehost本身没问题

  • Share/Bookmark

Tags: , , , , ,

cPanel添加域名强制检查DNS servers问题

用cPanel时,常遇到这类问题

Error from park wrapper: Using nameservers with the following IPs: ………   Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server.  Please transfer the domain to this servers nameservers or have your administrator add one of its nameservers to /etc/ips.remotedns and make the proper A entries on that remote nameserver.

其实就是为所有权检查,还有一些安全而考虑的

有的服务器商就去掉了这种检验机制,因为DNS更改时延造成的麻烦很大

而bluehost的检验机制更为强大

如何关了?如果你有WHM管理权限,可按如下处理:

Fix the option in WHM. In whm->tweak settings, make sure that this option is checked:

Quote:
Allow Creation of Parked/Addon Domains that resolve to other servers (i.e. domain transfers) [This can be a major security problem. If you must have it enabled, be sure to not allow users to park common internet domains.] 

This really is redundant any more and doesn’t need to be used. Just make SURE to follow the instructions and NOT allow users to park common domains.

This can (at times) become a security issue, but only if you don’t keep a close eye on what your users are doing.

  • Share/Bookmark

Tags: , , , , , , ,

unable to initialize windows sockets interface error code 0 解决方法

今天办公室一台电脑的无线网络不稳定,机子也很卡,开机会好久才进入桌面

查杀了病毒后,发现无线网连上不了,该机子没有网线,是外接无线局域网卡上网的

点查看无线网络,提示windows无法配置此无线连接。。。

以为是wireless zero configration没启用,但查看了服务,是自动启动的没错,却没有启动,而启动后也是提示windows无法配置此无线连接

不小心看到气球提示说明是有搜索到无线网络的,那是什么原因呢

ping 了下127.0.0.1,提示unable to initialize windows sockets interface error code 0

问题原来出在这里,即WINSOCK坏了,下个修复软件搞定,软件叫WinsockFix.exe

修复完了重启,电脑网络即正常

  • Share/Bookmark

Tags: , , , ,

GOOGLE翻墙代码

<?php
ini_set(‘max_execution_time’, 60);//脚本最大允许执行时长祿  表示没有限制
ini_set(‘memory_limit’, ’128M’);//限制最大占用的内存 28M
ini_set(‘error_reporting’, 0);
ini_set(‘display_errors’, 0);
ini_set(‘magic_quotes_runtime’, 0);//默认为off,意为不转义从文件读取或数据库中查询获得的数据
ini_set(‘magic_quotes_sybase’, 0);//是否采用Sybase形式的自动字符串转义★★
ini_set(‘default_mimetype’, ‘text/html’);//设置默认mime类型为text/html
ini_set(‘default_charset’,'UTF-8′);//设置默认编码为UTF-8
ini_set(‘default_socket_timeout’, ’60′);//默认socket超时(祿
ini_set(‘date.timezone’, ‘UTC’);//设置时区 //date_default_timezone_set(‘UTC’);
//检查gzip加速支持情儿
if ( extension_loaded(‘zlib’) && strstr($_SERVER["HTTP_ACCEPT_ENCODING"],”gzip”) ) {
 ob_start(‘ob_gzhandler’);
} else {
 ob_start();
}
//header(‘Content-Type: text/html; charset=UTF-8′);
//header(‘Content-language: zh-CN’);
//header(‘Expires:-1′);
header(‘Server: gws’);
header(‘X-Powered-By: gushu’); 

$str1 = array(
     ‘<title>Google</title>’,
     ‘Google 搜索</title>’,
     ‘www.google.com.hk’,
     ‘zh-TW’
     );
$str2 = array(‘
     <title>CrazyLemon提供Google在线翻墙搜索服务</title>’,
     ‘CrazyLemon提供Google在线翻墙搜索服务</title>’,
     ‘www.crazylemon.net/google’,
     ‘zh-CN’
     );
     //echo $_SERVER["QUERY_STRING"];
if(!empty($_SERVER["QUERY_STRING"])){
 $q = str_replace(‘hl=zh-TW’,'hl=zh-CN’,$_SERVER["QUERY_STRING"]);
 $url = ‘http://www.google.com.hk/search?’.$q;
}else{
 $url = ‘http://www.google.com.hk/’;
}
$user_agent = $_SERVER["HTTP_USER_AGENT"];
$referer_url = ‘http://www.gushu.cn/’;
//$url 需要抓取的页面地址
//$user_agent 需要返回的user_agent信息 如“baiduspider”或“googlebot
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
//curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_REFERER, $referer_url);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
/*
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_COOKIE, $_COOKIE);
curl_setopt ($ch, CURLOPT_POST, $_POST);
*/
if(!curl_errno($ch))
{
 $google =str_replace(“/search”,”/google/search”, curl_exec ($ch));

 echo str_replace($str1,$str2,$google);
}
curl_close($ch);

ob_end_flush();
?>

如何把一段文本里的A标签都去掉?

preg_replace(array(“/\<a[^\>]+\>/i”,”/\<\/a\>/i”), “”, $string);

  • Share/Bookmark

Tags: , , , , , , , , , , , , , ,

Gspay Error code 101解决方法

测试Gspay时,在Gspay支付页面提交个人地址信息并跳转下一步时报错了,错误代码如下:

Internal error: Authorization declined

Error code 101

在网上搜了下,没相关资料,只有一个外贸网站的FAQ里有提到

12 .Common payment error code:
101 customers IP does not match the selected countries  102 The IP of the client’s country is blocked 103 Customer’s IP  of  United States does not match the state 104 card holders who deceived 105 fraudulent card number 106, the language of the client browser is blocked 107 client countries, blocked 108 fraudulent e-mail address 109 deceived IP 110 deceived phone numbers to 111 client browser is blocked 112 transaction limit in excess of the maximum 113 hours IP restrictions 114 Unreasonable customer information

意思是说客户的IP和地址里所填写国家并不匹配,所以被拒绝了,这是信用卡安全机制的一部份

因为我们用的测试帐号一般都乱填的国家,但IP却是中国的,被检测出来

要顺利测试的话,只要在国家里选中国,就OK了

  • Share/Bookmark

Tags: , , , , , , ,