记录我的一些生活写照、无聊的牢骚、内心世界的活动 注册 | 登陆

Linux/Centos安装Litespeed+PHP+MYSQL+PHPMYADMIN教程

Linux/Centos安装Litespeed+PHP+MYSQL+PHPMYADMIN教程

系统环境和程序版本介绍:

系统是 Centos 5 32bit

Litespeed 是官方提供的免费版本:lsws-4.0.17-std-i386-linux.tar.gz
Mysql 是 5.1.35版本
Php 升级使用的是 5.2.14版本

第一:

yum -y install yum-fastestmirror
yum -y update
yum -y remove httpd
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar
yum -y install libtool libtool-libs kernel-devel autoconf213
yum -y install libjpeg libjpeg-devel libpng libpng-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel
yum -y install bzip2-devel 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 unzip vixie-cron
yum -y install fonts-chinese scim-chewing scim-pinyin scim-tables-chinese
export PHP_AUTOCONF=/usr/bin/autoconf-2.13
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13
wget -c http://catlnmp.googlecode.com/files/libiconv-1.13.1.tar.gz
tar zxvf libiconv-1.13.1.tar.gz
cd libiconv-1.13.1/
./configure --prefix=/usr/local
make
make install
cd ../
wget -c http://catlnmp.googlecode.com/files/libevent-1.4.14b-stable.tar.gz
tar zxvf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable/
./configure --prefix=/usr
make
make install
cd ../
wget -c http://catlnmp.googlecode.com/files/libmcrypt-2.5.8.tar.gz
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 ../../
wget -c http://catlnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz
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
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

wget -c http://catlnmp.googlecode.com/files/mcrypt-2.6.8.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure
make
make install
cd ../
wget -c http://catlnmp.googlecode.com/files/google-perftools-1.6.tar.gz
tar zxvf  google-perftools-1.6.tar.gz
cd google-perftools-1.6/
./configure
make && make install
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig
cd ../

第2:安装数据库

tar -zxvf mysql-5.1.35.tar.gz
cd mysql-5.1.35
./configure –prefix=/usr/local/mysql –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
/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 11111 (这个是数据库密码)
/etc/init.d/mysql restart
第3:安装Litespeed

 

tar zxvf lsws-4.0.17-std-i386-linux.tar.gz
cd lsws-4.0.17
sh install.sh
(1).其中会出现授权协议,–More–<27%>这样子,直接按空格翻页即可。
Do you agree with abot license ? 输入 Yes
(2)询问litespeed安装路径?可直接回车默认
Destination [/usr/local/lsws]:/usr/local/litespeed
(3).输入管理员用户名,回车使用默认admin
User name [admin]:
二次重复管理员密码。
(4)输入管理员邮箱,回车使用默认:
Email address [root@localhost]:
(5).Litespeed启动用户及组,回车使用默认即可:
User [nobody]:
Group [nogroup]:
(6)输入web服务端口,普通的网站服务为80。
HTTP PORT [8088]:80
(7) 是否安装php,选择y,然后默认即可,后台有很多php版本选择安装:
Setup up PHP [Y/n]:Y
(8)是否安装AWSatas,选n即可,说实话这个没啥大用:
Would you like to install AWStats Add-on module [y/N]?N
(9)是否设置litespeed为开机自动启动,这个要看个人选择,小夜选Y:
Would you lite to have LiteSpeed Web Server started automatically
when the server restarts [Y/n]?Y
(10)安装完成后,是否启动,Y即可:
[OK] The startup script has been successfully installed!
Would you like to start it right now [Y/n]?
现在可以通过http://ip:7080/进入后台管理
现在先不要关闭SSH连接,等啊还要用到.
第4:升级PHP版本到 5.2.14
1.登陆后台 Actions 菜单 Compile PHP
2.选择5.2.14,点击后面的 next
在 Configure Parameters 项里输入下面代码,其它默认即可,Suhosin和Mail Header 都不要,需要eAccelerator 的可以选上,输入下面的PHP功能组件,点 Build PHP 5.2.14
–with-litespeed –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config   –with-zlib –with-gd –enable-shmop –enable-track-vars –enable-sockets –enable-sysvsem –enable-sysvshm –enable-magic-quotes –enable-mbstring –with-iconv
3.千万不要刷新或其它操作,静等出现提示信息 Next 。
4.会给您一行代码,您需要在ssh里面运行:
/usr/local/lsws/phpbuild/buildphp_manual_run.sh
5.如果一切顺利,当你看到监视php编译检查的步骤提示 **COMPLETE** 的时候,那就已经OK了
6.点击菜单 Actions 里面的 Graceful Restart 重启litespeed。您可以访问 http://ip/phpinfo.php,如果确认显示php信息,则表示安装成功
第5:安装phpmyadmin
因为Litespeed 默认的web目录 :

 

/usr/local/lsws/DEFAULT/html
所以进入其目录:
cd /usr/local/lsws/DEFAULT/html/
下载 phpmyadmin,解压
wget -c http://soft.vpser.net/datebase/phpmyadmin/phpmyadmin.tar.gz
tar zxvf phpmyadmin.tar.gz
最后通过访问
http://ip/phpmyadmin/index.php来管理你的数据库.

« 上一篇 | 下一篇 »

发表评论

评论内容 (必填):