Skip to content


Google 企业应用套件

 

http://www.google.com/a/help/intl/zh-CN/admins/editions_spe.html

专业版为US$50.00美元/用户帐户/年。 免费版支持100个账号的7G邮箱,支持pop、smtp、imap,中文界面。 带Google Talk  Google 日历 Google 文件 初始页 移动访问Google Page Creator 等免费服务。

中文界面到了第二步填写信息的时候,总是会提示你选择的国家(中国)”Google 企业应用套件目前不支持该国家/地区的域名。”

这里有个问题: 最重要的是要通过美国的代理服务器访问; 1 申请的域名必须是.com域名的邮箱:如果有.cn com.cn域名需要申请,可以先申请一个.com域名的,然后设置另外的.cn .com.cn域名为相应的.com域名的别名即可; 2 申请的国家填写美国: 注册页面是有IP对应国家的校验的,所以要通过美国的代理服务器才能提交通过; 可以使用putty  登录设置中配置tunnel,目标设置为Dynamic,添加一个端口7070,再按Add,一个动态转发端口就实现了; 然后用相应帐号ssh登录后:除了登录的终端窗口意外,本地的7070连服务器的22端口之间就有了一个SSH加密的转发通道了。

为了方便切换,可以使用FireFox的SwitchProxy tool插件,设置socks代理通过本地的127.0.0.1:7070 进行传输。 3 电话号码填写一个合法的美国电话号码:555 222-2222;

注册后: 1 会有域名拥有者校验: 在网站根域名的目录下,上传一个带有校验码的googlehostedservice.html文件; 2 域名MX记录修改等,基本上按照提示修改即可

ASPMX.L.GOOGLE.COM. 10 ALT1.ASPMX.L.GOOGLE.COM. 20 ALT2.ASPMX.L.GOOGLE.COM. 30 ASPMX2.GOOGLEMAIL.COM. 40 ASPMX3.GOOGLEMAIL.COM. 50 ASPMX4.GOOGLEMAIL.COM. 60 ASPMX5.GOOGLEMAIL.COM. 70

如果域名mx解析不够,可以只用ASPMX.L.GOOGLE.COM.

邮箱服务的入口:https://mail.google.com/a/c1gstudio.com/ 初始页的入口:http://partnerpage.google.com/c1gstudio.com

客户端收发邮件

每个用户登录到自己的gmail请先设置一下自己的账户
  1. 登录到您的 Gmail 帐户。
  2. 点击任一 Gmail 页顶部的设置
  3. 点击橙色框邮件设置中的转发和 POP
  4. 选择针对所有邮件启用 POP 或者针对从现在起开始接收的邮件启用 POP
  5. 使用 POP 访问 Gmail 邮件后,选择您要对邮件采用的处理方式。
  6. 配置 POP 客户端* 然后点击保存更改

在客户端设置 POP服务器:pop.gmail.com 995 SMTP:smtp.gmail.com 25

用户名:你的企业邮箱邮件地址(包括@c1gstudio.com) 密码:你自己的企业邮箱密码

需要启动SSL(可参考gmail相关页面

 

参考:  免费企业邮箱: Google企业邮箱的申

美国的代理服务器

Posted in 网站建设.

Tagged with , , .


log中的_vti_bin/owssvr.dll 和/MSOffice/cltreq.asp

404记录

/_vti_bin/owssvr.dll  
/MSOffice/cltreq.asp

此及IE工具栏上的”讨论”按钮产生(需ms office)

Posted in 其它, 分析报告.

Tagged with .


设置apache 日志不记录图片

 SetEnv NoLOG 1

CustomLog logs/www.c1gstudio.com-access_log common env=!NoLOG

对于找不到图片的还是会记录在log中的

Posted in Apache, linux 维护优化, 技术.

Tagged with , , .


linux awstats 安装

http://sourceforge.net/projects/awstats/ #wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.8.tar.gz 车东的内主要搜索引擎和蜘蛛定义 #wget http://www.chedong.com/tech/lib.tgz 下载GeoIP的应用库:C http://www.maxmind.com/download/geoip/api/c/ #wget http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz 下载GeoIP/GeoIPCityLite包:解包并部署到awstats目录下 #wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz #wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz

# tar zxvf GeoIP.tar.gz #cd GeoIP-1.4.4 #./configure #make && make install #cd ..

#tar zxvf awstats-6.8.tar.gz #mv awstats-6.8 /opt/awstats

#gunzip lib.tgz #tar xvf lib.tar 覆盖原文件 #\cp -a lib/* /opt/awstats/wwwroot/cgi-bin/lib/

#gunzip GeoIP.dat.gz #gunzip GeoLiteCity.dat.gz #cp GeoIP.dat /opt/awstats/wwwroot/cgi-bin/plugins/ #cp GeoLiteCity.dat /opt/awstats/wwwroot/cgi-bin/plugins/

设置权限 #chown -R www:website /opt/awstats #chmod 0755 //opt/awstats/wwwroot/cgi-bin/plugins/Geo*

perl -MCPAN -e ‘install “Geo::IP”‘ 或者使用纯Perl包  perl -MCPAN -e ‘install “Geo::IP::PurePerl”‘ #perl -MCPAN -e ‘install “Geo::IP”‘ 一路回车到底

如果失败可以手动安装Geo::IP,并指定库的路径 #wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.38.tar.gz #tar zxvf Geo-IP-1.38.tar.gz #cd Geo-IP-1.38 #perl Makefile.PL LIBS=’-L/usr/local/lib’ INC=’-I/usr/local/include’ #make && make install

配置awstats #cd /opt/awstats/tools/ #perl awstats_configure.pl —–> Running OS detected: Linux, BSD or Unix Warning: AWStats standard directory on Linux OS is ‘/usr/local/awstats’. If you want to use standard directory, you should first move all content of AWStats distribution from current directory: /opt/awstats to standard directory: /usr/local/awstats And then, run configure.pl from this location. Do you want to continue setup from this NON standard directory [yN] ?

y

—–> Check for web server install   Enter full config file path of your Web server. Example: /etc/httpd/httpd.conf Example: /usr/local/apache2/conf/httpd.conf Example: c:\Program files\apache group\apache\conf\httpd.conf Config file path (‘none’ to skip web server setup):

指定httpd.conf的路径,我用nginx输入none

—–> Update model config file ‘/opt/awstats/wwwroot/cgi-bin/awstats.model.conf’   File awstats.model.conf updated.   —–> Need to create a new config file ? Do you want me to build a new AWStats config/profile file (required if first install) [y/N] ?

我使用手工写的conf所以输入n

—–> Add update process inside a scheduler Sorry, configure.pl does not support automatic add to cron yet. You can do it manually by adding the following command to your cron: /opt/awstats/wwwroot/cgi-bin/awstats.pl -update -config=myvirtualserver Or if you have several config files and prefer having only one command: /opt/awstats/tools/awstats_updateall.pl now Press ENTER to continue…

然后回车

将缺省awstats.model.conf 命名成common.conf #cd ../wwwroot/cgi-bin/ #mv awstats.model.conf common.conf 修改其中的一些配置选项: #vi common.conf 按”/”输入decodeutfkeys 去掉此行前的”#” LoadPlugin=”decodeutfkeys”

查找geoip GEOIP_STANDARD和geoip_city_maxmind ,去掉注释并改成你的路径 LoadPlugin=”geoip GEOIP_STANDARD /opt/awstats/wwwroot/cgi-bin/plugins/GeoIP.dat” LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD /opt/awstats/wwwroot/cgi-bin/plugins/GeoLiteCity.dat

按照一下样例设置配置文件: #vi /etc/awstats/awstats.www.c1gstudio.com.conf Include “/opt/awstats/wwwroot/cgi-bin/common.conf” LogFile=”gzip -d </opt/nginx/logs/www.c1gstudio.com.%YYYY-24%MM-24%DD-24.log.gz |" SiteDomain="www.c1gstudio.com" HostAliases="c1gstudio.com127.0.0.1 localhost" DirData="/var/lib/awstats"

创建数据目录 #mkdir /var/lib/awstats

成生报告 #perl /opt/awstats/wwwroot/cgi-bin/awstats.pl -config=www.c1gstudio.com -update

查看报告 http://www.c1gstudio.com/cgi-bin/awpstats.pl?config=www.c1gstudio.com

定时更新 10 5 * (cd /opt/awstats/wwwroot/cgi-bin/;./awstats.pl -update -config=www.c1gstudio.com)

参考资料 http://www.chedong.com/tech/awstats.html http://blog.s135.com/read.php/199.htm 测试环境 as4 nginx0.6.32

Posted in 技术.


pear 升级HTTP error, got response: HTTP/1.1 404 Not Found

pear remote-list HTTP error, got response: HTTP/1.1 404 Not Found Didn’t receive 200 OK from remote server. (HTTP/1.1 404 Not Found)

 pear upgrade –force http://pear.php.net/get/Archive_Tar http://pear.php.net/get/XML_Parser http://pear.php.net/get/Console_Getopt-1.2.2    pear upgrade –force http://pear.php.net/get/PEAR-1.3.3 (IF your existing version is older than 1.3.3)    pear upgrade –force http://pear.php.net/get/PEAR-1.4.3.tar    pear upgrade PEAR

pear remote-list

详见:http://pear.php.net/

Posted in 技术.

Tagged with , .


php 控制 nginx 使用404生成html

http://wiki.codemongers.com/NginxHttpCoreModule#error_page

error_page   404  =  /404.php;

我没仔细看,漏掉了中间的 “= , 以为nginx 404 不能再用php 控制header。 在网上转的半天也学到一些东东

     fastcgi_hide_header X-Powered-By; # 在header里隐藏php的版本      #fastcgi_pass_header Location;#在header里显示location      #fastcgi_pass_header Status;      fastcgi_pass_header Authorization;

自定义http 状态码 https://calomel.org/nginx.html

使用recursive_error_pages  on;递归404来找归档文件或使用memcache http://marc.info/?l=nginx&m=120127277410400&w=2 http://blog.arh.cc/index.php?/archives/11-Simple-and-clean-nginx.conf.html

Posted in Nginx, 技术.

Tagged with , , .


tomcat 内存溢出

装完nginx环境重启后,tomcat不能启动 tail tomcat/logs/catalina.out

2008-8-25 15:55:37 org.apache.tomcat.util.net.JIoEndpoint processSocket 严重: Error allocating socket processor java.lang.OutOfMemoryError: Java heap space         at java.lang.Thread.(Thread.java:208)         at org.apache.tomcat.util.net.JIoEndpoint$Worker.start(JIoEndpoint.java:468)         at org.apache.tomcat.util.net.JIoEndpoint.newWorkerThread(JIoEndpoint.java:681) ….   

free -m 看了一下内存从2G变成了1G,让机房重插下内存后一切正常。

Posted in Tomcat, 技术.

Tagged with , .


mysql5.0升级至mysql5.1 需执行mysql_upgrade

http://dev.mysql.com/doc/refman/5.1/zh/installing.html#upgrading-from-5-0

Posted in Mysql, 技术.

Tagged with .


mysqlhotcopy备份数据库

首先是通过cpan自动安装

shell>perl -MCPAN -e shell cpan>install DBI cpan>install DBD::mysql ( 安装这个时test通不过) cpan>q (退出)

cpan手动安装

unset LANG cd ~/.cpan/build/DBI-1.607 perl Makefile.PL make test make install cd ../DBD-mysql-4.007 perl Makefile.PL –mysql_config=/opt/mysql/bin/mysql_config make make test

错误

 failed: Can’t load ‘/root/.cpan/build/DBD-mysql-4.007/blib/arch/auto/DBD/mysql/mysql.so’ ln -s /opt/mysql/lib/mysql/* /usr/lib/ make test

错误

/root/.cpan/build/DBD-mysql-4.007/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: make realclean perl Makefile.PL –mysql_config=/opt/mysql/bin/mysql_config –libs=”-L/opt/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm”

错误

all skipped: ERROR: Access denied for user ‘root’@’localhost’ (using password: NO). Can’t continue test perl Makefile.PL –mysql_config=/opt/mysql/bin/mysql_config –libs=”-L/opt/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm” –testpassword=123456 make make test

错误

t/00base………………..String found where operator expected at t/00base.t line 20, near “BAIL_OUT “Unable to load DBI””         (Do you need to predeclare BAIL_OUT?) make realclean perl Makefile.PL –mysql_config=/opt/mysql/bin/mysql_config –libs=”-L/opt/mysql/lib/mysql -lmysqlclient -lz” –cflags=-I/opt/mysql/include/mysql –testhost=localhost –testsocket=/opt/mysql/mysql.sock –testdb=bugdb –testuser=root –testpassword=123456 make make test

错误

t/00base………………..String found where operator expected at t/00base.t line 20, near “BAIL_OUT “Unable to load DBI””         (Do you need to predeclare BAIL_OUT?)

(在另一机器上没出这个错)-_-*!!! 直接make install

检察是否安装成功

shell>perldoc DBI shell>perldoc DBI::mysql

从源码装 http://search.cpan.org/ http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm#INSTALLATION

gzip -cd DBI-(version).tar.gz | tar xf – cd DBI-(version) perl Makefile.PL make make test make install cd .. gzip -cd Data-ShowTable-(version).tar.gz | tar xf – cd Data-ShowTable-3.3 perl Makefile.PL make make install

Data-ShowTable-3.3.tar.gz 安装时有个错误 *** ERROR: Unterminated I at line 724 in file ShowTable.pm 用以下方法解决 http://lists.mysql.com/perl/1015

cd .. gzip -cd DBD-mysql-(version)-tar.gz | tar xf – cd DBD-mysql-(version) perl Makefile.PL –mysql_config=/opt/mysql/bin/mysql_config –libs=”-L/opt/mysql/lib/mysql -lmysqlclient -lcrypt -lnsl -lm -lz” –cflags=-I/opt/mysql/include/mysql –testsocket=/opt/mysql/mysql.sock –testhost=localhost –testuser=root –testpassword=****** make make test make install

在数据库段分配一个专门用于备份的用户

mysql> grant select,reload,lock tables on *.* to ‘hotcopyer’@’localhost’ identified by ‘123456’; mysql> grant insert on hotcopy.checkpoint to hotcopyer@’localhost’; mysql> flush privileges;

建表记录下历史

create database hotcopy; create table checkpoint(time_stamp timestamp not null,src varchar(32),dest varchar(60), msg varchar(255)); cd /opt/mysql/bin/ ./mysqlhotcopy test_ucenter –noindices –allowold –checkpoint hotcopy.checkpoint –addtodest /home/admin –user=hotcopyer –password=123456

你也可以将备份用的用户和密码放在~/.my.cnf下

vi /root/.my.cnf

[client] host=localhost user=hotcopyer password=123456

我在运行mysqlhotcopy时会遇到”has gone away”错误,数据库为25张表,800M大小。

DBD::mysql::db do failed: MySQL server has gone away at /opt/mysql/bin/mysqlhotcopy line 513.

看了下备份执行时间为10S左右,和我my.cnf中的wait timeout一样,调大max_allowed_packet和wait_timeout参数后没有错误。 修改下配置为 vi /opt/mysql/my.cnf

max_allowed_packet = 4M #字段最大的可能值 wait_timeout = 60

以上参数放在my.cnf的[mysqlhotcopy]和/root/.my.cnf中的[client]无效。 wait_timeout = 60可能会占用太多的connection。 我将它改为 10,然后修改mysqlhostcopy脚本来解决”has gone away”错误

#vi /opt/mysql/bin/mysqlhotcopy 复制第177行的mysql连接至513行

my $dbh = DBI->connect(“dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy”,                         $opt{user}, $opt{password}, {     RaiseError => 1,     PrintError => 0,     AutoCommit => 1, });

分析: mysqlhotcopy时会先连上数据库,然后lock table再复制数据库文件,最后unlock table, 由于复制数据文件会占用一定时间,所以再次执行unlock table时可能已超过设置的wait timeout时间, 我这里将它再连接一次就不会报错啦。 如用到checkpoint,那492行也要插一次

结论: mysqlhotcopy比较适合备份小型一点(1G以下)的数据库,还需留意下table lock wait timeout参数

定时及远程备份参考 使用crontab+ssh每天自动完全备份mysql数据  

Posted in cpan, Mysql, 备份, 技术.

Tagged with , , , , , .


linux下最·容易的增量备份,tar增量备份

linux备份真是太方便了,其实我们常用的tar就是很好的增量备份软件

使用 tar -g 参数进行增量备份实验

完整备份:

#建立测试路径与档案 mkdir test touch test/{a,b,c}; 在test下生成三个文件

#执行完整备份 tar -g snapshot -zcf backup_full.tar.gz test

#查看 tarball 内容 tar ztf backup_full.tar.gz test/ test/a test/b test/c

增量备份:

#新增一个档案 touch test/d

#执行第一次的增量备份 (注意 tarball 档名) tar -g snapshot -zcf backup_incremental_1.tar.gz test

#查看 tarball 内容 tar ztf backup_incremental_1.tar.gz test/ test/d

#新增一个档案, 并异动一个档案内容 touch test/e echo 123 > test/a

#执行第二次的增量备份 (注意 tarball 档名) tar -g snapshot -zcf backup_incremental_2.tar.gz test

#查看 tarball 内容 tar ztf backup_incremental_2.tar.gz test/ test/a test/e

还原备份资料:

#清空测试资料 rm -rf test

#开始进行资料还原 tar zxf backup_full.tar.gz tar zxf backup_incremental_1.tar.gz tar zxf backup_incremental_2.tar.gz

#查看测试资料 ls test a b c d e

使用 tar -u 参数进行增量备份

第一次备份:

#建立测试路径与档案 mkdir test touch test/a test/b test/c

#备份资料 tar zcf backup.tar.gz test

#查看 tarball 内容 tar ztf backup.tar.gz test/ test/a test/b test/c

增量备份:

#新增一个档案, 并异动一个档案内容 touch test/d echo 123 > test/a

#执行增量备份 (-u 参数只能执行於未压缩的 tarball) gunzip backup.tar.gz tar uf backup.tar test gzip backup.tar

#查看 tarball 内容 tar ztf backup.tar.gz test/ test/a test/b test/c test/ test/a test/d

还原备份资料:

#清除测试资料 rm -rf test

#解包 tarball tar zxf backup.tar.gz

#查看测试资料 ls test a b c d

Posted in linux 维护优化.

Tagged with , , , , .