Kloxo控制面板中字体的修改

Posted by zuzhihui in vps技术 on 2009/05/14 with No Comments

使用Kloxo控制面板管理VPS的时候,缺省的Kloxo界面上的字体太小,汉化之后的中文在Firefox下显示有锯齿,非常难看。本文记录了怎样把这些字号放大。

要修改的文件都在目录 /usr/local/lxlabs/kloxo/httpdocs/htmllib/css 下面。

修改common.css,把里面所有10px的font-size修改成12px。完成之后,控制面板里大部分字体就改变了。

然后修改menustyle.css,把里面所有10px的font-size修改成12px

给 Kloxo Host-InA-Box 免费控制面板安装中文包

Posted by zuzhihui in vps技术 on 2009/05/13 with No Comments

Kloxo是一个优秀的控制面板,其前身是Lxadmin。Kloxo是个商业软件收费的,但它有个免费版本,名称是Kloxo HostInABox,这个免费版本的限制是仅支持40个域名,其他方面和商业版本一样。

很多Linux VPS都使用Kloxo来管理,当然RASHOST VPS也不例外。本文介绍怎样给Kloxo HostInABox安装中文语言包。

在VPS上执行如下命令:

cd /usr/local/lxlabs/kloxo/httpdocs/lang/
wget dl.rashost.com/kloxo-cn.tar.gz
tar zxf kloxo-cn.tar.gz
chown -R lxlabs: cn

然后登录Kloxo,在首页点击Appearance,然后点击Language框,选择Chinese,最好点击Update按钮即可

在VPS上打开php的错误日志

Posted by zuzhihui in vps技术 on 2009/05/09 with No Comments

在VPS上安装配置php应用如果碰到错误,而不显示错误信息的时候,经常是一头雾水,不知道是为什么错了,错在哪里了。

这时候如果打开php的错误显示功能,则能够把发生的错误信息显示出来,方便我们找原因。修改php.ini配置文件,打开错误显示功能,要修改的部分是:

error_reporting  =  E_ALL | E_NOTICE
display_errors = On
log_errors = On
error_log = /var/log/httpd/php.log

需要注意的是php日志文件/var/log/httpd/php.log的权限,要设置成777,至少让apache的执行用户能写。

配置好之后,重启apache即可

CentOS 5 下 OpenVPN 和 Windows 下 OpenVPN GUI 安装笔记

Posted by zuzhihui in vps技术 on 2009/05/08 with 1 Comment

此笔记,基于 “程序员小辉”的安装笔记修改 ——————————————————————————————————————–

一. OpenVPN 安装环境

Server 端的环境

  1. CentOS, kernel版本: 2.6.18, IP 为 221.233.59.16(ADSL拨号)
  2. kernel 需要支持 tun 设备, 需要加载 iptables 模块.
  3. 安装的 OpenVPN 的版本: 2.1.rc15.(目前最新版 可在http://openvpn.net 上下载).

Client 端的环境:

  1. Windows XP SP2
  2. openvpn-2.1_rc15-install.exe(此版本集成了 OpenVPN GUI 客户端)

二. OpenVPN 服务端安装过程

    1. 用putty登录到CentOS
    2. 下载LZO和OpenVPN 2.1.rc15
wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz
wget http://openvpn.net/release/openvpn-2.1_rc15.tar.gz
yum install -y openssl-devel
    1. 安装LZO和OpenVPN
tar zxvf lzo-2.03.tar.gz
cd lzo-2.03
./configure
make
make install
cd ..
tar zxvf openvpn-2.1_rc15.tar.gz
cd openvpn-2.1_rc15
./configure
make
make install
cd ..
cp /root/openvpn-2.1_rc15/easy-rsa/ -r /etc/openvpn
    1. 生成证书

初始化PKI

cd /etc/openvpn/2.0/#可以设置下OpenVPN参数(也可以修改vars文件来配置)
export D=`pwd`
export KEY_CONFIG=$D/openssl.cnf
export KEY_DIR=$D/keys
export KEY_SIZE=1024
export KEY_COUNTRY=CN
export KEY_PROVINCE=GD
export KEY_CITY=SZ
export KEY_ORG="dvdmaster"
export KEY_EMAIL="support@cooldvd.com"
#也可以不用设置直接执行下面的命令
. vars

创建证书颁发机构(CA)

./clean-all
./build-ca

Generating a 1024 bit RSA private key
................      
........      
writing new private key to 'ca.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [CN]:
State or Province Name (full name) [GD]:
Locality Name (eg, city) [SZ]:
Organization Name (eg, company) [dvdmaster]:
Organizational Unit Name (eg, section) []:dvdmaster
Common Name (eg, your name or your server's hostname) []:server
Email Address [support@cooldvd.com]:

建立server key

./build-key-server server

Generating a 1024 bit RSA private key
......      
....................      
writing new private key to 'server.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [CN]:
State or Province Name (full name) [GD]:
Locality Name (eg, city) [SZ]:
Organization Name (eg, company) [dvdmaster]:
Organizational Unit Name (eg, section) []:dvdmaster
Common Name (eg, your name or your server's hostname) []:server
Email Address [support@cooldvd.com]:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:abcd1234
An optional company name []:dvdmaster
Using configuration from /etc/openvpn/2.0/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           ::'CN'
stateOrProvinceName   ::'GD'
localityName          ::'SZ'
organizationName      ::'dvdmaster'
organizationalUnitName::'dvdmaster'
commonName            ::'server'
emailAddress          ::'support@cooldvd.com'
Certificate is to be certified until Mar 19 08:15:31 2016 GMT (3650 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

生成客户端 key

./build-key client1
Generating a 1024 bit RSA private key
.....      
......      
writing new private key to 'client1.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [CN]:
State or Province Name (full name) [GD]:
Locality Name (eg, city) [SZ]:
Organization Name (eg, company) [dvdmaster]:
Organizational Unit Name (eg, section) []:dvdmaster
Common Name (eg, your name or your server's hostname) []:client1 #重要: 每个不同的client 生成的证书, 名字必须不同.
Email Address [support@cooldvd.com]:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:abcd1234
An optional company name []:dvdmaster
Using configuration from /etc/openvpn/2.0/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           ::'CN'
stateOrProvinceName   ::'GD'
localityName          ::'SZ'
organizationName      ::'dvdmaster'
organizationalUnitName::'dvdmaster'
commonName            ::'client1'
emailAddress          ::'support@cooldvd.com'
Certificate is to be certified until Mar 19 08:22:00 2016 GMT (3650 days)
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

以此类推建立其他客户端 key

./build-key client2
./build-key client3

注意在进入 Common Name (eg, your name or your server’s hostname) []: 的输入时, 每个证书输入的名字必须不同.

  • 生成Diffie Hellman参数

./build-dh

  • 将 keys 下的所有文件打包下载到本地(可以通过winscp,http,ftp等等……)

tar zcvf yskeys.tar.gz keys/

  • 创建服务端配置文件

mkdir /etc/openvpn/2.0/conf
cp /root/openvpn-2.1_rc15/sample-config-files/server.conf /etc/openvpn/2.0/conf/server.conf

服务端配置文件(server.conf)样例

port 1194

proto udp

dev tun

ca /etc/openvpn/2.0/keys/ca.crt
cert /etc/openvpn/2.0/keys/ovpnser.crt
key /etc/openvpn/2.0/keys/ovpnser.key  # This file should be kept secret

dh /etc/openvpn/2.0/keys/dh1024.pem

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

push "redirect-gateway def1 bypass-dhcp"

push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 202.103.44.150" #客户端获得的DNS地址
push "dhcp-option DNS 202.103.24.68" #客户端获得的DNS地址

client-to-client

keepalive 10 120

comp-lzo

user nobody
group nobody

persist-key
persist-tun

status openvpn-status.log

verb 3

  • 启动OpenVPN

/usr/local/sbin/openvpn --config /etc/openvpn/2.0/conf/server.conf &

三. OpenVPN GUI For Windows 客户端安装过程

    1. 下载 openvpn-2.1_rc15-install.exe(此版本集成 OpenVPN  GUI)

官方下载地址:http://openvpn.net/release/openvpn-2.1_rc15-install.exe

  • 依屏幕指示安装OpenVPN GUI
  • 配置 openvpn gui

将上面第6步打包的yskeys.tar.gz中的下列证书文件解压到 你的OpenVPN GUI安装路径\OpenVPN\config文件夹下

ca.crt
ca.key
client1.crt
client1.csr
client1.key

  • 修改client.ovpn

把你的OpenVPN GUI安装路径\OpenVPN\sample-config下的client.ovpn文件复制到你的OpenVPN GUI安装路径\OpenVPN\config文件夹下,用记事本打开client.ovpn

#找到remote my-server-1 1194,把my-server-1改成你的ip地址
remote 221.233.59.16 1194

  • 双击 client.ovpn 即可启动 openvpn, 或者通过 OpenVPN GUI 的控制启动 VPN.

三. OpenVPN 访问外网的设置

    1. 开启CentOS 5 的路由转发功能
echo 1 > /proc/sys/net/ipv4/ip_forward
#为了使CentOS重启后仍然开启路由转发功能我们需要再执行下列命令
sysctl -w net.ipv4.ip_forward=1
    1. 添加iptables转发规则
#因为我那天CentOS是ADSL拨号上网,所以把出口设置成ppp0,请根据实际情况设置
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ppp0 -j MASQUERADE
    1. 必须保证server.conf配置中,有下面三个配置
push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 202.103.44.150" #客户端获得的DNS地址
push "dhcp-option DNS 202.103.24.68" #客户端获得的DNS地址

当 client 连接成功后, 在 cmd 下执行 ipconfig /all, 应该有这类似这样的输出:

Ethernet adapter 本地连接 2:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : TAP-Win32 Adapter V9
        Physical Address. . . . . . . . . : 00-FF-F2-1A-44-BD
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 10.8.0.6
        Subnet Mask . . . . . . . . . . . : 255.255.255.252
        Default Gateway . . . . . . . . . : 10.8.0.5
        DHCP Server . . . . . . . . . . . : 10.8.0.5
        DNS Servers . . . . . . . . . . . : 10.8.0.1
                                            202.103.44.150
                                            202.103.24.68
        Lease Obtained. . . . . . . . . . : 2009年5月8日 23:55:06
        Lease Expires . . . . . . . . . . : 2010年5月8日 23:55:06

四. 设置 OpenVPN 服务器 reboot后自动启动 openvpn

执行

vi /etc/rc.local

然后在最后面加入此行:

/usr/local/sbin/openvpn --config /etc/openvpn/2.0/conf/server.conf &

五.OpenVPN 测试

连接成功之后,去ip138.com上看看外网ip是多少,如果是CentOS系统的外网ip那说明测试成功了~

用awstats分析apache,nginx日志

Posted by zuzhihui in vps技术 on 2009/04/24 with 3 Comments

1.下载安装awstats

wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz

tar zxvf awstats-6.9.tar.gz

mv awstats-6.9/  /usr/local/

cd /usr/local/awstats-6.9/tools/

2.配置awstats

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:

/usr/local/awstats-6.9

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):

>none

-----> 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] ?

y

-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
>test.com

-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>Enter(安默认的,配置文件保存在/etc/awstats)

2.修改/etc/awstats/awstats.test.com.conf
#你要分析的日志文件位置
LogFile=”/var/log/apache2/access.log”
#日志的类型1:apache 2:IIS
LogFormat=1
#要分析日志所属的域名
SiteDomain=”test.com”
#是否允许在统计页面直接更新数据1:允许 0:不允许
AllowToUpdateStatsFromBrowser=1

3.更新awstats数据库

mkdir /var/lib/awstats/
/usr/local/awstats-6.9/wwwroot/cgi-bin/awstats.pl -config=test.com -update

4.配置apache

        ScriptAlias /cgi-bin/ /usr/local/awstats-6.9/wwwroot/cgi-bin/

                AllowOverride None
                Options  ExecCGI -MultiViews  SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all

5.访问http://test.com/cgi-bin/awstats.pl来查看awstatc统计

6.配置nginx

awstats需要Perl脚本支持,但是用的Nginx服务器,对Perl支持不好,于是通过FastCGI方式来使用Perl。
首先安装Perl的FCGI模块

 wget http://www.cpan.org/modules/by-module/FCGI/FCGI-0.67.tar.gz
tar -zxvf FCGI-0.67.tar.gz
cd FCGI-0.67
perl Makefile.PL
make && make install

安装FCGI-ProcManager

 wget http://search.cpan.org/CPAN/authors/id/G/GB/GBJK/FCGI-ProcManager-0.18.tar.gz
tar -xzxf FCGI-ProcManager-0.18.tar.gz
cd FCGI-ProcManager-0.18
perl Makefile.PL
make
make install

Perl的FastCGI启动脚本

vi fcgi_perl

#!/usr/bin/perl -w
use FCGI;
use Socket;
use FCGI::ProcManager;
sub shutdown { FCGI::CloseSocket($socket); exit; }
sub restart { FCGI::CloseSocket($socket); &main; }
use sigtrap 'handler', \&shutdown, 'normal-signals';
use sigtrap 'handler', \&restart, 'HUP';
require 'syscall.ph';
use POSIX qw(setsid);

#&daemonize; we don't daemonize when running under runsv
#this keeps the program alive or something after exec'ing perl scripts
END() { }
BEGIN() { }
{
no warnings;
*CORE::GLOBAL::exit = sub { die "fakeexit\nrc=" . shift() . "\n"; };
};
eval q{exit};
if ($@) {
exit unless $@ =~ /^fakeexit/;
}
&main;

sub daemonize() {
chdir '/' or die "Can't chdir to /: $!";
defined( my $pid = fork ) or die "Can't fork: $!";
exit if $pid;
setsid() or die "Can't start a new session: $!";
umask 0;
}

sub main {
#如果使用 IP sockets
#$socket = FCGI::OpenSocket( "127.0.0.1:8999", 10 );
#如果使用 UNIX sockets
#$socket = FCGI::OpenSocket( "/var/run/perl_cgi-dispatch.sock", 10 );

#foreach $item (keys %ENV) { delete $ENV{$item}; }
#设置fastcgi进程数,默认四个
my $n_processes = $ENV{FCGI_NPROCESSES} || 4;
$proc_manager = FCGI::ProcManager->new( {n_processes => $n_processes} );
#使用unix socket
$socket = FCGI::OpenSocket( "$ENV{FCGI_SOCKET_PATH}", 10 );
#设置Socket权限
chmod 0777, $ENV{FCGI_SOCKET_PATH};

; #use UNIX sockets - user running this script must have w access to the 'nginx' folder!!
$request =
FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%req_params, $socket,
&FCGI::FAIL_ACCEPT_ON_INTR );
$proc_manager->pm_manage();
if ($request) { request_loop() }
FCGI::CloseSocket($socket);
}

sub request_loop {
while ( $request->Accept() >= 0 ) {
$proc_manager->pm_pre_dispatch();

#processing any STDIN input from WebServer (for CGI-POST actions)
$stdin_passthrough = '';
{ no warnings; $req_len = 0   $req_params{'CONTENT_LENGTH'}; };
if ( ( $req_params{'REQUEST_METHOD'} eq 'POST' ) && ( $req_len != 0 ) )
{
my $bytes_read = 0;
while ( $bytes_read  0 ) {
close(CHILD_RD);
close(CHILD_ERR);
print PARENT_WR $stdin_passthrough;
close(PARENT_WR);
$rin = $rout = $ein = $eout = '';
vec( $rin, fileno(CHILD_O), 1 ) = 1;
vec( $rin, fileno(PARENT_ERR), 1 ) = 1;
$ein = $rin;
$nfound = 0;

while ( $nfound =
select( $rout = $rin, undef, $ein = $eout, 10 ) )
{
die "$!" unless $nfound != -1;
$r1 = vec( $rout, fileno(PARENT_ERR), 1 ) == 1;
$r2 = vec( $rout, fileno(CHILD_O), 1 ) == 1;
$e1 = vec( $eout, fileno(PARENT_ERR), 1 ) == 1;
$e2 = vec( $eout, fileno(CHILD_O), 1 ) == 1;

if ($r1) {
while ( $bytes = read( PARENT_ERR, $errbytes, 4096 ) ) {
print STDERR $errbytes;
}

if ($!) {
$err = $!;
die $!;
vec( $rin, fileno(PARENT_ERR), 1 ) = 0
unless ( $err == EINTR or $err == EAGAIN );
}
}
if ($r2) {
while ( $bytes = read( CHILD_O, $s, 4096 ) ) {
print $s;
}
if ( !defined($bytes) ) {
$err = $!;
die $!;
vec( $rin, fileno(CHILD_O), 1 ) = 0
unless ( $err == EINTR or $err == EAGAIN );
}
}
last if ( $e1 || $e2 );
}
close CHILD_RD;
close PARENT_ERR;
waitpid( $pid, 0 );
} else {
foreach $key ( keys %req_params ) {
$ENV{$key} = $req_params{$key};
}

# cd to the script's local directory
if ( $req_params{SCRIPT_FILENAME} =~ /^(.*)\/[^\/] $/ ) {
chdir $1;
}
close(PARENT_WR);

#close(PARENT_ERR);
close(STDIN);
close(STDERR);

#fcntl(CHILD_RD, F_DUPFD, 0);
syscall( &SYS_dup2, fileno(CHILD_RD), 0 );
syscall( &SYS_dup2, fileno(CHILD_ERR), 2 );

#open(STDIN, "<&CHILD_RD");
exec( $req_params{SCRIPT_FILENAME} );
die("exec failed");
}
} else {
print("Content-type: text/plain\r\n\r\n");
print
"Error: No such CGI app - $req_params{SCRIPT_FILENAME} may not exist or is not executable by this process.\n";
}
}
}

再设置启动的脚本

vi startfcgiperl

#!/bin/bash
export FCGI_SOCKET_PATH="/tmp/perl_fcgi.socket"
export FCGI_NPROCESSES=4
/etc/init.d/fcgi_perl > /dev/null 2>&1 &

为Nginx添加FastCGI的Perl支持

vi /usr/local/nginx/conf/nginx.conf

		location ~ .*\.pl$
                        {
                                fastcgi_index awstats.pl;
                                include perl.conf;
                        }

                location /awstats {
                        alias /usr/local/awstats-6.9/wwwroot/cgi-bin/;
                }

vi /usr/local/nginx/conf/perl.conf

fastcgi_pass unix:/tmp/perl_fcgi.socket;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME /var/www/awstats-6.8/wwwroot/cgi-bin$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /usr/local/awstats-6.9/wwwroot/cgi-bin/awstats.pl;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_read_timeout 60;

让awstats分析nginx的日志

cp /etc/awstats/awstats.test.com.conf /etc/awstats/awstats.test2.com.conf
修改/etc/awstats/awstats.test2.com.conf
#你要分析的日志文件位置
LogFile="/web/logs/access.log"
#日志的类型1:apache 2:IIS
LogFormat=1
#要分析日志所属的域名
SiteDomain="test2.com"
#是否允许在统计页面直接更新数据1:允许 0:不允许
AllowToUpdateStatsFromBrowser=1

访问http://test2.com/awstats/awstats.pl查看统计

RasHost正式推出Debian 5.0(Lenny) VPS

Posted by zuzhihui in vps技术 on 2009/03/03 with No Comments

Debian Linux是我们最喜欢的一个Linux发行版,Debian拥有很大的灵活性,Debian官方的软件包及其丰富,自创的APT包管理系统使用起来非常方便。

Debian VPS自然也是我们极力推荐的VPS,目前Debian 5.0(代号Lenny)刚刚发布,我们也紧锣密鼓的推出安装了Debian 5.0的VPS,欢迎各位客户使用安装了Debian 5.0的VPS。

现有的Debian 4.0的客户可以自行升级到Debian 5.0,如果不会升级的客户,可以给info@rashost.com发一封邮件让我们来帮助你升级,或者干脆让我们免费给你安装一个全新的Debian 5.0也是可以的。

网站实时监测,有故障立刻短信通知

Posted by zuzhihui in vps技术 on 2009/02/16 with No Comments

本文介绍一种方法,能够实现当VPS上面网站不能访问的时候,管理员能及时得到邮件和短信通知,这个通知是完全免费的。

首先,网站管理员要拥有一个手机号码。如果是中国移动的手机,就去申请一个@139.com的邮箱;如果是中国联通186的手机,也可以去申请一个@wo.com.cn的邮箱。这两种邮箱都有新邮件短信提醒的功能,进入邮箱设置一下,当收到新邮件的时候发短信至手机。如果是其他手机号码,我不知道是否有此类配套的邮箱可以用。

然后,去本文最后提到的监控网站注册一个帐号,注册一个免费的monitor服务,并把通知邮箱写成你的@139.com或者@wo.com.cn的邮箱。监控会每隔几分钟检测一下你的网站,如果网站不通,就会发邮件到你的邮箱,邮箱收到新邮件就会发短信通知你了。

国外的监控网站有: http://www.siteuptime.comhttp://mon.itor.us
国内的监控网站有: http://www.jiankongbao.comhttp://bm.chinaz.com

面向国外用户的VPS站点

Posted by zuzhihui in vps技术 on 2009/02/01 with No Comments

我们的国际站点 http://rasvps.com/ 今日开张,本站点主要面向国外的用户,提供中国VPS和美国VPS。

关于CentOS5 VPS中的yum源的配置

Posted by zuzhihui in vps技术 on 2009/01/02 with No Comments

CentOS中的yum能很方便的更新安装软件包,它能够自动解决rpm包之间的依赖关系,就像Debian中的apt-get一样。 使用yum必须要配置yum源地址,在国内的网络情况下,配置一个速度快的yum源还真不容易。不像Debian的apt源,国内有很多。本文介绍一些我们配置yum源的经验。

不使用国内的yum源

以前也以为国内的yum源速度快,但不知实际情况却恰恰相反。国内的一些yum源速度非常慢,yum更新慢的印象都是国内的源造成的。我分析慢原因还是国内的带宽少,这种没有回报的公益事业在国内没有多少人愿意投入,带宽都用来卖给客户赚钱了。

另外国内的yum源非常不稳定,以前常使用的be10的国内yum源,现在经常不能访问。

国外的CentOS VPS

如果CentOS VPS的位置在国外,配置有一个国外的IP地址,那么使用缺省的yum源设置应该就很好。就像我们的美国VPS,使用的都是缺省的yum源,速度相当快

国内的CentOS VPS

国内的CentOS VPS使用缺省的yum源速度往往很慢,因为缺省的yum源是这样设置的:

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

http://mirrorlist.centos.org这个URL能够自动返回VPS所在地附近的一些yum源,而这些yum源都是位于中国大陆或者台湾等地区,这些地区的源访问起来非常慢。为了解决这个问题,我们只需在mirrorlist这一行的尾部添加如下字符串即可:

&cc=us

解释一下上面的字符串:&是用来连接URL中的参数的;cc是http://mirrorlist.centos.org这个URL能接受的一个参数,代表地区的意思;us代表美国。这样,一个完整的mirrorlist配置应该如下:

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&cc=us

这样就能够直接访问美国地区的那些yum源,这些yum源从中国访问也是很快的。

附件

附上整个的/etc/yum.repos.d/CentOS-Base.repo文件供参考:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&cc=us
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&cc=us
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons&cc=us
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&cc=us
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&cc=us
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

更简单的,可以用root在CentOS 5 VPS下执行如下命令更新yum源:

wget http://rashost.com/download/yum.sh
sh yum.sh

ViewVC在Debian Lenny下的安装和配置

Posted by zuzhihui in vps技术 on 2008/12/26 with No Comments

很多人都在VPS上安装了Subversion,CVS等软件。ViewVC是一个很好的SubVersion/CVS的Web前端工具,
本文介绍了在Debian Lenny VPS下ViewVC的安装和配置。

Apache

ViewVC在Apache的CGI模式下运行,所以要安装Apache并配置Apache支持CGI。

a2enmod cgi
/etc/init.d/apache2 restart

安装ViewVC

apt-get install viewvc

配置ViewVC

dpkg-reconfigure viewvc

需要输入CVS和Subversion的数据路径。

然后在浏览器里输入地址(请替换IP地址):

http://192.168.9.9/cgi-bin/viewvc.cgi,就能看到ViewVC的界面了。

Back to Top

2007-2017 © 北京瑞豪开源科技有限公司 京ICP备13004995号-2