Posted by zuzhihui in Linux技术 on 2012/04/28 with No Comments
Ubuntu官方在2012年4月26日发布了Ubuntu Linux 12.04 LTS。其中LTS的意思是Long Term Support,Ubuntu官方为LTS服务器版本的Ubuntu Linux提供长达5年的技术维护。
瑞豪开源从即日起开始提供安装Ubuntu Linux 12.04 LTS的VPS。客户新购买VPS的时候可以选择安装32位或者64位的Ubuntu Linux 12.04 LTS。客户也可以自己把老VPS Rebuild为这个版本,记着在Rebuild之前先备份数据哦。
Ubuntu Linux 12.04 LTS自带的软件都是最新版本,包括最新的3.2.0版本的Linux内核,Apache的版本是2.2.22,PHP的版本是5.3.10,MySQL版本是5.5.22,Nginx的版本是1.1.19。
Posted by yar999 in Linux技术 on 2011/09/16 with No Comments
32位的CentOS 5 VPS上快速配置pptpd作为VPN服务器
ssh登录vps之后执行下面的命令
wget http://dl.rashost.com/pptpd/centos5/pptpd_install.sh
sh pptpd_install.sh
执行之后,就可以使用帐号ystest密码intel登录您的pptpd vpn了
32位的CentOS 6 VPS上快速配置pptpd作为VPN服务器
ssh登录vps之后执行下面的命令
wget http://dl.rashost.com/pptpd/centos6/pptpd_install.sh
sh pptpd_install.sh
执行之后,就可以使用帐号ystest密码intel登录您的pptpd vpn了
Posted by yar999 in Linux技术 on 2011/06/18 with 4 Comments
按照下图操作即可
注意
如果是apache环境,这样设置是302跳转
Posted by zuzhihui in Linux技术 on 2011/04/21 with No Comments
Linux Software RAID的rebuild速度是根据服务器负载情况自动调节的,默认的rebuild比较慢。默认的速度一般如下:
[root@x003 ~]# sysctl dev.raid.speed_limit_min
dev.raid.speed_limit_min = 1000
这个默认速度下,服务器上运行着很多VPS,Rebuild一块1T的硬盘好好几天时间:
[root@x002 ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb5[2] sda5[1]
965016384 blocks [2/1] [_U]
[>....................] recovery = 2.6% (25701568/965016384) finish=3506.9min speed=4461K/sec
md9 : active raid1 sdb1[2] sda1[0]
30716160 blocks [2/1] [U_]
resync=DELAYED
调高rebuild速度:
sysctl -w dev.raid.speed_limit_min=50000
过几分钟再察看,速度就好多了
[root@x002 ~]# cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sdb5[2] sda5[1]
965016384 blocks [2/1] [_U]
[>....................] recovery = 3.3% (32125440/965016384) finish=1049.2min speed=14816K/sec
md9 : active raid1 sdb1[2] sda1[0]
30716160 blocks [2/1] [U_]
resync=DELAYED
unused devices:
Posted by yar999 in Linux技术 on 2011/04/10 with No Comments
查看:
ssh登录之后执行下面的命令,最后一对双引号里面包含的就是mysql的root密码
cat /usr/local/lxlabs/kloxo/etc/slavedb/dbadmin
例如
[root@centos ~]# cat /usr/local/lxlabs/kloxo/etc/slavedb/dbadmin
O:6:"Remote":1:{s:4:"data";a:1:{s:5:"mysql";a:1:{s:10:"dbpassword";s:11:"abc.passwd";}}}
abc.passwd就是mysql默认的root密码
修改:
参照下图修改即可
Posted by yar999 in Linux技术 on 2011/04/02 with No Comments
kloxo默认使用的是lighttpd做web服务器,安装的时候有2个问题,可以按照下面解决
1 开启mysql的innodb引擎
由于mysql的innodb引擎比较占用内存,所以kloxo的my.cnf默认禁用了innodb引擎,这就导致安装magento的时候提示链接数据库错误,因为magento需要使用mysql的innodb引擎。
执行下面的命令开启mysql的innodb引擎即可
sed -i 's/skip-innodb/#skip-innodb/g' /etc/my.cnf
/etc/init.d/mysqld restart
2 勾选下 Skip Base URL Validation Before the Next Step
Posted by zuzhihui in Linux技术 on 2011/03/05 with No Comments
在Linux VPS上经常用vim来编辑文件,vim功能强大,vim配置的好可以给工作带来很大方便。本文记录我们常用的vim配置。
首先把vim示例配置文件拷贝到系统中,其中71是vim的版本,在各种linux下版本可能不同:
cp /usr/share/vim/vim71/vimrc_example.vim /etc/vim/vimrc.local
然后把如下行添加到这个文件的末尾:/etc/vim/vimrc.local
set fileencodings=utf-8,euc-cn
set fileformats=unix
set nobackup
set number
set ignorecase
set autoindent
set smartindent
set noexpandtab
set smarttab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set pastetoggle=<F2>
Posted by yar999 in Linux技术 on 2011/02/28 with 1 Comment
本文介绍怎样在Debian 6 VPS上安装配置pptpd VPN。
首先用apt-get命令从Debian的官方软件库中下载安装pptpd及其依赖的iptables和ppp,命令如下:
apt-get -y install pptpd iptables ppp
配置pptpd
echo ms-dns 208.67.222.222 >> /etc/ppp/pptpd-options
echo ms-dns 208.67.220.220 >> /etc/ppp/pptpd-options
echo localip 192.168.99.1 >> /etc/pptpd.conf
echo remoteip 192.168.99.9-99 >> /etc/pptpd.conf
iptables -t nat -A POSTROUTING -s 192.168.99.0/24 -j MASQUERADE
sed -i 's/exit\ 0/#exit\ 0/' /etc/rc.local
echo iptables -t nat -A POSTROUTING -s 192.168.99.0/24 -j MASQUERADE >> /etc/rc.local
echo exit 0 >> /etc/rc.local
echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
sysctl -p
/etc/init.d/pptpd restart
添加用户
echo 'ystest * intel *' >> /etc/ppp/chap-secrets
这样您就可以使用帐号ystest密码intel来登录您的pptpd了
我们把上面的操作写了一个脚本,您可以执行下面2条命令快速安装
wget http://dl.rashost.com/pptpd/debian6/pptpd_install.sh
sh pptpd_install.sh
Posted by yar999 in Linux技术 on 2011/02/26 with No Comments
本文介绍怎样在Debian 6 VPS上安装ISPConfig 3
首先设置主机名为ispconfig3.d6
echo ispconfig3.d6 > /etc/hostname
/etc/init.d/hostname.sh start
然后运行hostname命令可以验证一下是否生效,如果没有,就运行reboot试试,重启后应该就生效了吧。
然后要保证ispconfig3.d6指向本地地址127.0.0.1
echo 127.0.0.1 ispconfig3.d6 localhost localhost.localdomain > /etc/hosts
然后在VPS上运行ping ispconfig3.d6就可以看到ping的是127.0.0.1了。如果不是127.0.0.1,那就重新再来一遍吧。
运行如下命令改变默认的shell为bash,选择NO,不要选YES
dpkg-reconfigure dash
保证Debian VPS的软件源文件/etc/apt/sources.list内容如下,不管你用什么编辑器,达到目的即可:
deb http://ftp.us.debian.org/debian squeeze main
deb http://ftp.us.debian.org/debian squeeze-updates main
deb http://security.debian.org/ squeeze/updates main
运行如下命令安装必要的软件:
apt-get update
apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl courier-maildrop getmail4 rkhunter binutils sudo
apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl
apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby
apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool
以上命令在安装软件的过程中会问几个问题,其中几个问题解释如下:
New password for the MySQL “root” user: Create directories for web-based administration? General type of mail configuration: System mail name: #Web server to reconfigure automatically: #Configure database for phpmyadmin with dbconfig-common?
配置一下apache
a2enmod suexec rewrite ssl actions include
a2enmod dav_fs dav auth_digest
/etc/init.d/apache2 restart
编辑mysql的配置文件/etc/mysql/my.cnf,在如下行前面加#字符注释掉:
bind-address = 127.0.0.1
注释之后的样子是:
#bind-address = 127.0.0.1
然后运行如下命令重启mysql
/etc/init.d/mysql restart
运行如下命令配置一下pop3和imap服务:
cd /etc/courier
rm -f /etc/courier/imapd.pem
rm -f /etc/courier/pop3d.pem
sed -i 's/CN=localhost/CN=ispconfig3.d6/' /etc/courier/imapd.cnf
sed -i 's/CN=localhost/CN=ispconfig3.d6/' /etc/courier/pop3d.cnf
mkimapdcert
mkpop3dcert
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop-ssl restart
配置一下PureFTPd
sed -i 's/VIRTUALCHROOT=false/VIRTUALCHROOT=true/' /etc/default/pure-ftpd-common
echo 1 > /etc/pure-ftpd/conf/TLS
mkdir -p /etc/ssl/private/
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
chmod 600 /etc/ssl/private/pure-ftpd.pem
/etc/init.d/pure-ftpd-mysql restart
sed -i 's/defaults,errors=remount-ro/errors=remount-ro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0/' /etc/fstab
mount -o remount /
quotacheck -avugm
quotaon -avug
#安装BIND DNS Server
apt-get install bind9 dnsutils
#安装 Vlogger, Webalizer, AWstats
apt-get install vlogger webalizer awstats
#安装 Jailkit
apt-get install build-essential autoconf automake1.9 libtool flex bison debhelper
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.13.tar.gz
tar xvfz jailkit-2.13.tar.gz
cd jailkit-2.13
./debian/rules binary
cd ..
dpkg -i jailkit_2.13-1_*.deb
rm -rf jailkit-2.13*
#安装 fail2ban
apt-get install fail2ban
cd /etc/fail2ban/
rm -rf jail.local
wget http://dl.rashost.com/ispconfig3/fail2ban/jail.local
cd /etc/fail2ban/filter.d/
rm -rf courierimap.conf
rm -rf courierimaps.conf
rm -rf courierpop3.conf
rm -rf courierpop3s.conf
rm -rf pureftpd.conf
wget http://dl.rashost.com/ispconfig3/fail2ban/filter.d/courierimap.conf
wget http://dl.rashost.com/ispconfig3/fail2ban/filter.d/courierimaps.conf
wget http://dl.rashost.com/ispconfig3/fail2ban/filter.d/courierpop3.conf
wget http://dl.rashost.com/ispconfig3/fail2ban/filter.d/courierpop3s.conf
wget http://dl.rashost.com/ispconfig3/fail2ban/filter.d/pureftpd.conf
/etc/init.d/fail2ban restart
#安装 SquirrelMail
apt-get install squirrelmail
ln -s /usr/share/squirrelmail/ /var/www/webmail
squirrelmail-configure
#配置 SquirrelMail 使用 Courier-IMAP/-POP3
现在您可以通过 http://your_ip/webmail/ 来访问SquirrelMail
#安装 ISPConfig 3
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/
php -q install.php
到这里ISPconfig3就算安装好了,您可以使用http://your_ip:8080/ 来访问ISPconfig3
帐号admin密码admin
Posted by yar999 in Linux技术 on 2011/02/21 with No Comments
编译环境准备
首先查看debian的apt软件库的配置,确保/etc/apt/sources.list这个文件里面至少有:
deb http://ftp.us.debian.org/debian squeeze main
deb http://security.debian.org/ squeeze/updates main
然后同步一下:
apt-get update
安装编译所需要的工具:
apt-get install build-essential vim
安装编译所需要的库:
apt-get -y install libxml2-dev libmcrypt-dev libssl-dev libldap2-dev libmhash-dev libmysqlclient15-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libsasl2-dev libfreetype6-dev
下载并编译php 5.2.17
wget http://www.php.net/get/php-5.2.17.tar.gz/from/this/mirror
wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
mv mirror php-5.2.17.tar.gz
tar zxvf php-5.2.17.tar.gz
gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1
cd php-5.2.17
./configure --prefix=/opt/php --with-iconv --with-zlib --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-mysql --with-mysqli --enable-sqlite-utf8 --with-pdo-mysql --enable-ftp --with-jpeg-dir --with-freetype-dir --with-png-dir
cp php.ini-dist /opt/php/lib/php.ini
ln -s /opt/php/sbin/php-fpm /etc/init.d/php-fpm
update-rc.d -f php-fpm defaults
安装php加速器eAccelerator:
cd ..
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar jxvf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
/opt/php/bin/phpize
./configure --enable-eaccelerator --with-php-config=/opt/php/bin/php-config
make install
echo ‘
[eaccelerator]
zend_extension=”/opt/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/opt/php/eaccelerator_cache”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
‘ >> /opt/php/lib/php.ini
近期评论