CentOS上安装DirectAdmin
[ 2010/05/05 08:49 | by Totti ]
1:安装相关的组件,或者你可以选择面对装了一半之后跳出来这样一个提示:
cd /usr/local/directadmin/custombuild
./build all d
安装CentOS的相关组件的命令如下:
yum update -y
yum install gcc-c++ gcc automake -y
yum install make
yum install flex
2:CentOS是附带了httpd的unix版本,但是因为directadmin的安装需要干净的系统,所以在装之前要反安装httpd,php,mysql这些web组件。
yum remove httpd* php* mysql* -y
安装:
做完了热身运动,现在可以放心地参照官网的步骤进行DirectAdmin的安装了。
运行命令:
wget http://directadmin.com/setup.sh
获取安装文件
chmod +x setup.sh
更改文件权限+x是一种方式,也可以用控制面板里面用的比较多的755。
./setup.sh
运行安装文件,然后在下面填入相关的信息。其中hostname最好和vps里面的名字一样,我开始就用了vps.810081.com和host.810081.com两个名字,结果收到了提示邮件。
DirectAdmin’s setup has a few more things you need to fill:
Please enter your Client ID :
Please enter your License ID :
Please enter your hostname \(server.domain.com\)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don’t use domain.com. Use server.domain.com instead.
Do not enter http:// or www
Enter your hostname (FQDN) :
Is this correct? (y,n) :
Is eth0 your network adaptor with the license IP? (y,n) :
Is xx.xx.xx.xx the IP in your license? (y,n) :
DirectAdmin will now be installed on: Enterprise 5
Is this correct? (must match license) (y,n) :
You now have 2 options for your apache/php setup.
1: customapache: older, more tested. Includes Apache 1.3, php 4 and frontpage.
2: custombuild 1.1: newer, less tested. Includes any Apache version, php 4, 5, or both in cli and/or suphp. Frontpage not available with Apache 2.x.
Post any issues with custombuild to the forum: http://www.directadmin.com/forum/forumdisplay.php?f=61
Enter your choice (1 or 2):
针对vps的特殊设置:
经过这些步骤,directAdmin的安装已经完成了,对还差最后一个步骤。在vps上面还要将Ip,硬盘这些进行一个定位,用vi进入/usr/local /directadmin/conf/directadmin.conf这个文件,将其中的ethernet_dev的值改成
ethernet_dev=venet0:0
可以通过/sbin/ifconfig这个命令来查看自己的硬盘。
善后:
如果忘了DirectAdmin的密码用
locate mysql.ini
来定位并翻看这个文件里面存在着DirectAdmin的密码,据说另外一种方式也可以,不过我试了没有成功了,还是照单列出来了,有兴趣的童鞋自己去试
cd /usr/local/directadmin
./directadmin i
./directadmin p
摘自:http://blog.dengruo.com/200909/572
cd /usr/local/directadmin/custombuild
./build all d
安装CentOS的相关组件的命令如下:
yum update -y
yum install gcc-c++ gcc automake -y
yum install make
yum install flex
2:CentOS是附带了httpd的unix版本,但是因为directadmin的安装需要干净的系统,所以在装之前要反安装httpd,php,mysql这些web组件。
yum remove httpd* php* mysql* -y
安装:
做完了热身运动,现在可以放心地参照官网的步骤进行DirectAdmin的安装了。
运行命令:
wget http://directadmin.com/setup.sh
获取安装文件
chmod +x setup.sh
更改文件权限+x是一种方式,也可以用控制面板里面用的比较多的755。
./setup.sh
运行安装文件,然后在下面填入相关的信息。其中hostname最好和vps里面的名字一样,我开始就用了vps.810081.com和host.810081.com两个名字,结果收到了提示邮件。
DirectAdmin’s setup has a few more things you need to fill:
Please enter your Client ID :
Please enter your License ID :
Please enter your hostname \(server.domain.com\)
It must be a Fully Qualified Domain Name
Do *not* use a domain you plan on using for the hostname:
eg. don’t use domain.com. Use server.domain.com instead.
Do not enter http:// or www
Enter your hostname (FQDN) :
Is this correct? (y,n) :
Is eth0 your network adaptor with the license IP? (y,n) :
Is xx.xx.xx.xx the IP in your license? (y,n) :
DirectAdmin will now be installed on: Enterprise 5
Is this correct? (must match license) (y,n) :
You now have 2 options for your apache/php setup.
1: customapache: older, more tested. Includes Apache 1.3, php 4 and frontpage.
2: custombuild 1.1: newer, less tested. Includes any Apache version, php 4, 5, or both in cli and/or suphp. Frontpage not available with Apache 2.x.
Post any issues with custombuild to the forum: http://www.directadmin.com/forum/forumdisplay.php?f=61
Enter your choice (1 or 2):
针对vps的特殊设置:
经过这些步骤,directAdmin的安装已经完成了,对还差最后一个步骤。在vps上面还要将Ip,硬盘这些进行一个定位,用vi进入/usr/local /directadmin/conf/directadmin.conf这个文件,将其中的ethernet_dev的值改成
ethernet_dev=venet0:0
可以通过/sbin/ifconfig这个命令来查看自己的硬盘。
善后:
如果忘了DirectAdmin的密码用
locate mysql.ini
来定位并翻看这个文件里面存在着DirectAdmin的密码,据说另外一种方式也可以,不过我试了没有成功了,还是照单列出来了,有兴趣的童鞋自己去试
cd /usr/local/directadmin
./directadmin i
./directadmin p
摘自:http://blog.dengruo.com/200909/572
Supesite使用CDN后获取真实IP 办法
[ 2010/01/23 17:11 | by Totti ]
include/main.inc.php文件,这部分
替换成
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
$_SGLOBAL['onlineip'] = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
$_SGLOBAL['onlineip'] = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
$_SGLOBAL['onlineip'] = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
$_SGLOBAL['onlineip'] = $_SERVER['REMOTE_ADDR'];
}
$_SGLOBAL['onlineip'] = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
$_SGLOBAL['onlineip'] = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
$_SGLOBAL['onlineip'] = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
$_SGLOBAL['onlineip'] = $_SERVER['REMOTE_ADDR'];
}
替换成
function get_real_ip()
{
$ip=false;
if(!empty($_SERVER["HTTP_CLIENT_IP"]))
{
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
if ($ip)
{
array_unshift($ips, $ip); $ip = FALSE;
}
for ($i = 0; $i < count($ips); $i++)
{
if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i]))
{
$ip = $ips[$i];
break;
}
}
}
return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}
$_SGLOBAL['onlineip'] = get_real_ip();
{
$ip=false;
if(!empty($_SERVER["HTTP_CLIENT_IP"]))
{
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);
if ($ip)
{
array_unshift($ips, $ip); $ip = FALSE;
}
for ($i = 0; $i < count($ips); $i++)
{
if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i]))
{
$ip = $ips[$i];
break;
}
}
}
return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}
$_SGLOBAL['onlineip'] = get_real_ip();
Weave新版本的Bug-按钮被隐藏
[ 2010/01/01 16:23 | by Totti ]
Directadmin安装 Zend Optimizer
[ 2009/12/20 11:16 | by Totti ]
第一步:
Edit /usr/local/directadmin/custombuild/options.conf file and change zend=no to zend=yes.
第二步:
cd /usr/local/directadmin/custombuild
./build update
./build zend
Edit /usr/local/directadmin/custombuild/options.conf file and change zend=no to zend=yes.
第二步:
cd /usr/local/directadmin/custombuild
./build update
./build zend
Centos 常用命令收集
[ 2009/12/13 18:01 | by Totti ]
一:查看cpu
more /proc/cpuinfo | grep "model name"
grep "model name" /proc/cpuinfo
如果觉得需要看的更加舒服
grep "model name" /proc/cpuinfo | cut -f2 -d:
more /proc/cpuinfo | grep "model name"
grep "model name" /proc/cpuinfo
如果觉得需要看的更加舒服
grep "model name" /proc/cpuinfo | cut -f2 -d:
Windows Media Player文件