LinuxCentos安装Litespeed+PHP+MYSQL+PHPMYADMIN教程

    技术2022-07-06  191

    http://rootzone.net/zh-CN/setup-unmanaged-vps-with-litespeed-php-and-mysql/

    http://www.wowtutorial.org/tutorial/2.html

    http://www.blogtopsites.com/outpost/2418766d6534bb558e370c45336a41c4

    本文教程非原创,采集众家之长,综合小夜(419.at)和vpsbeta.com两家的测试使用所写,本站现在用的就是Litespeed+PHP+MYSQL+PHPMYADMIN.

    本站用的vps是

    hostrail优惠后1.2美元每月256M内存的VPS

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

    系统是 Centos 5 32bit

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

    第一:

    yum -y install yum-fastestmirroryum -y updateyum -y remove httpdyum -y install patch make gcc gcc-c++ gcc-g77 flex bison taryum -y install libtool libtool-libs kernel-devel autoconf213yum -y install libjpeg libjpeg-devel libpng libpng-develyum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-develyum -y install file glib2 glib2-devel bzip2 diff* openldap-develyum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogsyum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-develyum -y install openssl openssl-devel vim-minimal unzip vixie-cronyum -y install fonts-chinese scim-chewing scim-pinyin scim-tables-chineseexport PHP_AUTOCONF=/usr/bin/autoconf-2.13export PHP_AUTOHEADER=/usr/bin/autoheader-2.13wget -c http://dl.awlsh.com/litespeed/libiconv-1.13.1.tar.gztar zxvf libiconv-1.13.1.tar.gzcd libiconv-1.13.1/./configure –prefix=/usr/localmakemake installcd ../wget -c http://dl.awlsh.com/litespeed/libevent-1.4.14b-stable.tar.gztar zxvf libevent-1.4.14b-stable.tar.gzcd libevent-1.4.14b-stable/./configure –prefix=/usrmakemake installcd ../wget -c http://dl.awlsh.com/litespeed/libmcrypt-2.5.8.tar.gztar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8/./configuremakemake install/sbin/ldconfigcd libltdl/./configure –enable-ltdl-installmakemake installcd ../../wget -c http://dl.awlsh.com/litespeed/mhash-0.9.9.9.tar.gztar zxvf mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9/./configuremakemake installcd ../ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.laln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.soln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.aln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.laln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.soln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

    wget -c http://dl.awlsh.com/litespeed/mcrypt-2.6.8.tar.gztar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8/./configuremakemake installcd ../wget -c http://dl.awlsh.com/litespeed/google-perftools-1.6.tar.gztar zxvf  google-perftools-1.6.tar.gzcd google-perftools-1.6/./configuremake && make installecho "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf/sbin/ldconfigcd ../

    第2:安装数据库

    wget -c http://soft.vpser.net/datebase/mysql/mysql-5.1.35.tar.gz 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

     

    wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.17-std-i386-linux.tar.gz 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 automaticallywhen 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来管理你的数据库.

     

     


    最新回复(0)