May5

【原创】阿里云服务器网络访问速度测评

Author: leeon  Click: 7502   Comments: 0 Category: 其他  Tag: 阿里云,aliyun,云服务器

最近阿里云做活动买N送N,正打算做草根新项目,于是买了一年的服务器,运气不错阿里云给送了半年云服务器使用,也就是我只花了850元就得到18个月服务器的使用时间,性价比还算不错。

具体配置如下:

单核:Intel(R) Xeon(R) CPU E5-2430 0 @ 2.20GHz

内存:512M

带宽:1M

服务器:阿里云杭州节点

WebServer: Nginx+PHP-FPM

通过在17测,阿里测以及360网站测速上进行统计,可以发现阿里云的网络访问质量还是很不错的,可以覆盖到全国范围大部分地区用户在2s内快速接入并响应。

你可以自行比对其他国内的大型网站的评测分数,就可以得出你心中的评判标准。

根据统计分析得出指标,我认为在这样的配置情况下,只要网站优化得当,可以满足日UV在2w-4w PV10w规模网站的接入服务。

Apr21

64位系统上安装Android SDK Tools注意事项

Author: leeon  Click: 5776   Comments: 0 Category: 其他  Tag: android,sdk,tools,install

今日在windows 7 64位系统上部署android开发环境,但是在安装android sdk tools时始终提示:

Failed to find Java version for C:\Windows\system32\java.exe

查看一些解决方案都不是很靠谱,其实解决方法很简单,只要把这

C:\Windows\system32\java.exe

这个文件重命名即可,这样安装程序就不会默认找寻这个exe文件来检查java环境,而是通过你设定的系统环境变量信息来找寻java.exe。

网上反馈这个问题大多出现在64位环境下,特此记录一下

Mar9

zendstudio 10启动报错问题解决

Author: leeon  Click: 5569   Comments: 0 Category: 其他  Tag: zendstudio,error,log

更新到最新版本的zend studio 10 后启动提示如下错误:

Error creation processor for extension-point org.eclipse.php.ui.phpFormatterProcessor

参考

http://forums.zend.com/viewtopic.php?f=59&t=4215 官方论坛的解答,只需要进入如下设置中:

Window - Preferences - General - Startup and Shutdown

然后勾选Refresh workspace on startup 即可解决问题。

Dec9

【原创】Apache2.4 安装mod_fastcgi说明

Author: leeon  Click: 963   Comments: 0 Category: 其他  Tag: apache,2,4,mod_fastcgi

最近在Apache2.4上实践使用c/c++编写高性能cgi程序,在apache上配置mod_fastcgi模式的时候按照步骤始终不能成功,一直卡在mod_fastcgi的make上。提示错误如下(错误内容有省略):

[code="plain"]
/usr/local/apache/build/libtool --silent --mode=compile gcc -std=gnu99 -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/local/apache/include -I. -I/root/httpd-2.4.3/srclib/apr/include -I/root/httpd-2.4.3/srclib/apr-util/include -prefer-pic -c mod_fastcgi.c && touch mod_fastcgi.slo
mod_fastcgi.c: In function 'send_to_pm':
mod_fastcgi.c:175: warning: initialization from incompatible pointer type
mod_fastcgi.c:175: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
mod_fastcgi.c:236: warning: initialization from incompatible pointer type
mod_fastcgi.c:236: error: expected expression before ')' token
mod_fastcgi.c:236: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
mod_fastcgi.c: In function 'init_module':
mod_fastcgi.c:297: warning: initialization from incompatible pointer type
mod_fastcgi.c:297: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
mod_fastcgi.c:301: warning: initialization from incompatible pointer type
mod_fastcgi.c:301: warning: passing argument 5 of 'ap_log_error_' makes integer from pointer without a cast
/usr/local/apache/include/http_log.h:372: note: expected 'apr_status_t' but argument is of type 'struct server_rec *'
mod_fastcgi.c:329: warning: initialization from incompatible pointer type
mod_fastcgi.c:329: error: expected expression before ')' token
[/code]

于是搜寻各大网站终于在一个serverfault上找到有人提供的mod_fastcgi for apache2.4的解决方案

https://github.com/ByteInternet/libapache-mod-fastcgi

于是赶紧下载下来解压编译,依旧提示类似的编译错误,看了下安装手册才发现需要先大补丁才能编译。于是尝试使用作者提供的patch来给fastcgi官网提供的源码包打补丁:

(1)下载补丁文件

/upload/other/byte-compile-against-apache24.diff

(2) cd /root/mod_fastcgi-2.4.6 并上传本文中提供的diff patch文件到此目录

(3) 然后patch -p1 < byte-compile-against-apache24.diff 即可

(4)注意修改Makefile.AP2 为Makefile 同时修改里面的apache的路径(top_dir)为自己apache所部属的路径。

(5) 最后make && make install 编译mod_fastcgi,然后在apache的conf文件中加入module即可。

 

附编译fcgi遇到的问题:

如下错误:

[code="plain"]
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c fcgio.cpp -MT fcgio.lo -MD -MP -MF .deps/fcgio.TPlo  -fPIC -DPIC -o .libs/fcgio.lo
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70: error: 'EOF' was not declared in this scope
fcgio.cpp:75: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86: error: 'EOF' was not declared in this scope
fcgio.cpp:87: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()':
fcgio.cpp:113: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory `/root/fcgi-2.4.1-SNAP-0311112127/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/fcgi-2.4.1-SNAP-0311112127'
make: *** [all] Error 2
[/code]

我的gcc版本是4.4,搜寻网上的解决方案是在fcgio.h上加载cstdio头部

引文链接:https://bugs.gentoo.org/show_bug.cgi?id=256654

 

在编写fcgi程序的时候我们时常需要reload cgi才能重新看到新编译的程序效果,其实我们可以在apache的配置文件中加上如下配置来提供自动的reload策略,而不需要人工的重启来重新加载新程序。

[code="plain"]
<IfModule mod_fastcgi.c>
FastCgiconfig -autoUpdate
</IfModule>
[/code]

分类

标签

归档

最新评论

Abyss在00:04:28评论了
Linux中ramdisk,tmpfs,ramfs的介绍与性能测试
shallwe99在10:21:17评论了
【原创】如何在微信小程序开发中正确的使用vant ui组件
默一在09:04:53评论了
Berkeley DB 由浅入深【转自架构师杨建】
Memory在14:09:22评论了
【原创】最佳PHP框架选择(phalcon,yaf,laravel,thinkphp,yii)
leo在17:57:04评论了
shell中使用while循环ssh的注意事项

我看过的书

链接

其他

访问本站种子 本站平均热度:8823 c° 本站链接数:1 个 本站标签数:464 个 本站被评论次数:94 次