卸载VPS默认组件并升级系统:
rpm -qa|grep httpd
rpm -e httpd
rpm -qa|grep mysql
rpm -e mysql
rpm -qa|grep php
rpm -e php
yum -y remove httpd
yum -y remove php
yum -y remove mysql-server mysql
yum -y remove php-mysql
yum -y install yum-fastestmirror
yum -y remove httpd
yum -y update
安装必要软件:
#Synchronization time
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum install -y ntp
ntpdate -d cn.pool.ntp.org
date
#Disable SeLinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
yum -y install libtool libtool-libs autoconf kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal nano sendmail
yum -y install fonts-chinese gettext gettext-devel
yum -y install ncurses-devel
yum -y install gmp-devel pspell-devel
yum -y install unzip
if [ -s libiconv-1.13.1.tar.gz ]; then
echo "libiconv-1.13.1.tar.gz [found]"
else
echo "Error: libiconv-1.13.1.tar.gz not found!!!download now......"
wget -c http://zephyrxt.net/vps/libiconv-1.13.1.tar.gz
fi
if [ -s libmcrypt-2.5.8.tar.gz ]; then
echo "libmcrypt-2.5.8.tar.gz [found]"
else
echo "Error: libmcrypt-2.5.8.tar.gz not found!!!download now......"
wget -c http://zephyrxt.net/vps/libmcrypt-2.5.8.tar.gz
fi
if [ -s mhash-0.9.9.9.tar.gz ]; then
echo "mhash-0.9.9.9.tar.gz [found]"
else
echo "Error: mhash-0.9.9.9.tar.gz not found!!!download now......"
wget -c http://zephyrxt.net/vps/mhash-0.9.9.9.tar.gz
fi
if [ -s mcrypt-2.6.8.tar.gz ]; then
echo "mcrypt-2.6.8.tar.gz [found]"
else
echo "Error: mcrypt-2.6.8.tar.gz not found!!!download now......"
wget -c http://zephyrxt.net/vps/mcrypt-2.6.8.tar.gz
fi
echo "============================check files=================================="
cd /root
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make && make install
cd ../
cd /root
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make && make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
cd ../../
cd /root
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make && make install
cd ../
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
cd /root
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure
make && make install
cd ../
rm -rf libiconv-1.13.1
rm -rf libmcrypt-2.5.8
rm -rf mhash-0.9.9.9
——————安装Mysql————
wget -c http://XSSDFvps/mysql-5.1.54.tar.gz
tar -zxvf mysql-5.1.54.tar.gz
cd mysql-5.1.54/
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
cd ../
groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql/.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig --level 345 mysql on
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
echo "/usr/local/lib" >>/etc/ld.so.conf
ldconfig
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
/etc/init.d/mysql start
/usr/local/mysql/bin/mysqladmin -u root password root
/etc/init.d/mysql restart
/etc/init.d/mysql stop
chkconfig mysql-ndb off
chkconfig mysql-ndb-mgm off
rm -rf mysql-5.1.54
/etc/init.d/mysql restart
——————正式安装Litespeed————
wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.19-std-i386-linux.tar.gz
tar xvfz lsws-4.0.19-std-i386-linux.tar.gz
cd lsws-4.0.19
./install.sh #推荐把默认的8080端口改成80
——————按照提示安装————
登录后台http://IP:7080/
点击Action 编译:PHP选择5.2.16
参数选择:
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --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 --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --with-mime-magic --enable-suhosin
——————如果无法编译成功提示安装autoconf————
cd /root
wget -c http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz
yum remove -y autoconf autoconf2.13 automake automake1.9
tar zxvf autoconf-2.13.tar.gz
cd autoconf-2.13/
./configure
make && make install
cd ../
——————加入eaccelerator支持——
mkdir /tmp/eaccelerator
chmod -R 777 /tmp/eaccelerator
————建立网站——
mkdir - p / usr/ local/ lsws/ yourdomain. com //建立網站目錄
chmod 777 / usr/ local/ lsws/ yourdomain. com
————安装Zendoptimizer——
wget -c http://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
cp -f ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/
加入:
[Zend Optimizer]
zend_optimizer.optimization_level=1
zend_extension="/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"
————安装phpmyadmin————
wget -c http://zephyrxt.net/vps/phpmyadmin.tar.gz
tar zxvf phpmyadmin.tar.gz
mv phpMyAdmin-3.3.9-all-languages phpmyadmin
chmod 755 -R /usr/local/lsws/DEFAULT/html/phpmyadmin
chown nobody:nobody -R /usr/local/lsws/DEFAULT/html/phpmyadmin
-——————可以访问了:(事先需配置好Index Files 加入index.php类型)——
————安装wordpress——
CD网站目录
wget http://cn.wordpress.org/wordpress-3.0.5-zh_CN.zip
unzip wordpress-3.0.5-zh_CN.zip
cp -a wordpress/* /usr/local/lsws/网站目录
rm -rf wordpress
进入PHPmyadmin创建数据库 用户名
进入 http://域名/ 输入数据库信息安装
安装成功!
更新插件时遇到 “要执行请求的操作,WordPress 需要访问您网页服务器的权限。 请输入您的 FTP ”
chown -R nobody:nobody /usr/local/lsws/网站目录
chmod 755 -R /usr/local/lsws/网站目录
————————————————————
/usr/local/lsws/bin/lswsctrl
————————————————————
- Simply run [your_install_dir]/admin/misc/uninstall.sh
and follow the instructions on the screen.
- The following questions will be asked:
- whether to keep the log directory
- whether to keep the configuration directory
- All the directories that are not created by the Installer will not be touched, even they are under [your_install_dir]. But all the files created by the Installer will be removed.
- [your_install_dir] will be removed as well if it is empty.