换了burstnet vps

作者:shenmeng 发布时间:December 2, 2009 分类:默认分类

teamvps一个月就要到期了,不准备再用了,其实用起来还可以,价钱也不算太贵,但是由于是个新公司,感觉有些不可靠。换成现在的burstnet的vps ,比teamvps便宜,配置稍差点,不过有两个IP,速度稍慢些,ping速在200多ms,比teamvps多大概30ms ,之前在网上听人说burstnet在美国东海岸,速度会很慢,我觉得还不错,之前犹豫了很久才决定买这款,ixwebhosting价钱便宜,支持支付宝,但是速度很慢,在我这里ping他们的demo,速度在400ms以上,我怀疑买这么便宜,肯定超卖。在几个比较出名的主机上中,就觉得lunarpages较快,但价钱也不便宜,比我这vps还贵。

我是昨天下午付的款,今天系统就好了,进默认的vePortal面板一看,vePortal面板基本什么功能都没有,而且系统也是没装什么软件,只装了个apache。看见网上有人说用nginx很省资源,看了看centos的源里没有nginx ,要自己编译(也可以从fedora的源里下载),感觉太麻烦了。还是用apache吧,等哪天感觉系统资源紧张再换吧。安装php和mysql都很简单。直接三个命令就行了:

yum -y install php
yum -y install mysql
yum -y install php-mysql

然后开启mysql服务,重启apache

/etc/init.d/mysqld start
/etc/init.d/httpd restart

安装时系统自动配置好了,不需要修改配置文件就可以使用。
另外将apache , mysql加入自启动,可以修改/etc/rc.d/rc.local文件,加入以下几行:

/etc/init.d/mysqld start
/etc/init.d/httpd start

如果有多个域名,就需要设置apache的virtualhost ,我还特意去图书馆借了本apache的书,其实这个也简单。
假设有四个域名,两个ip(10.0.0.1和10.0.0.2),每个ip分配两个域名,则可以这样设置(将代码添加到/etc/httpd/conf/httpd.conf 文件末尾)。
DocumentRoot是网站主目录。最后几行是开启各目录中.htaccess文件的override功能。

ServerName 127.0.0.1
NameVirtualHost 10.0.0.1
NameVirtualHost 10.0.0.2
<VirtualHost 127.0.0.1>
        ServerName site1.com
        DocumentRoot "/home/www/site1"
</VirtualHost>
<VirtualHost 127.0.0.1>
        ServerName site2.com
        DocumentRoot "/home/www/site2"
</VirtualHost>
<VirtualHost 127.0.0.2>
        ServerName site3.com
        DocumentRoot "/home/www/site3"
</VirtualHost>
<virtualHost 127.0.0.2>
        ServerName site4.com
        DocumentRoot "/home/www/site4"
</VirtualHost>
<Directory "/home/www/">
        AllowOverride All
</Directory>
  1. 1