您的位置:首页 > 其它

Lamp环境搭建

2013-09-13 20:24 204 查看
一、首先在linux服务器上安装gccgcc-c++,及关闭SELINUX,iptables.#yum-y install gcc-*#vi/etc/sysconfig/selinux 设置为disabled#iptables-F
二、然后编译安装源码包1。cd /lamp/libxml2-2.6.30./configure--prefix=/usr/local/libxml2/make&& make install
2。cd /lamp/libmcrypt-2.5.8./configure--prefix=/usr/local/libmcrypt/make&& make install
3。cd /lamp/libmcrypt-2.5.8/libltdl./configure--enable-ltdl-installmake&& make install
4。cd /lamp/zlib-1.2.3./configuremake&& make install
5。cd /lamp/libpng-1.2.31./configure--prefix=/usr/local/libpng/make&& make install
6mkdir /usr/local/jpeg6mkdir/usr/local/jpeg6/binmkdir/usr/local/jpeg6/libmkdir/usr/local/jpeg6/includemkdir-p /usr/local/jpeg6/man/man1cd/lamp/jpeg-6b./configure--prefix=/usr/local/jpeg6/ --enable-shared --enable-staticmake&& make install
7。cd /lamp/freetype-2.3.5./configure--prefix=/usr/local/freetype/make&& make install
8。cd /lamp/autoconf-2.61./configuremake&& make install

9。cd /lamp/gd-2.0.35./configure--prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/--with-freetype=/usr/local/freetype/
make&& make install

10。cd /lamp/httpd-2.2.9./configure--prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/--with-included-apr --disable-userdir --enable-so--enable-deflate=shared --enable-expires=shared--enable-rewrite=shared --enable-static-support
make&&make install
/usr/local/apache2/bin/apachectlstartecho"/usr/local/apache2/bin/apachectl start" >>/etc/rc.d/rc.sysinit

11.cd /lamp/ncurses-5.6./configure--with-shared --without-debug --without-ada --enable-overwritemake && make install
12.你必须执行的安装MySQL源码分发版的基本命令是:
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -shell> groupadd mysqlshell> useradd -g mysql mysqlshell> cd mysql-VERSIONshell> ./configure --prefix=/usr/local/mysqlshell> makeshell> make installshell> cp support-files/my-medium.cnf /etc/my.cnfshell> cd /usr/local/mysqlshell> ./bin/mysql_install_db --user=mysql //初试化表并且规定用mysql用户来访问shell> chown -R root . //初始化表以后就开始给mysqlroot用户设定访问权限 shell> chown -R mysql varshell> chgrp -R mysql .Shell> ./bin/mysqld_safe --user=mysql & //运行mysql如果出现mysql ended这样的语句,表示Mysql没有正常启动,你可以到log中查找问题,Log文件的通常在/etc/my.cnf中配置。大多数问题是权限设置不正确引起的。 
(以上在VMWareWorkstation CentOS5.5上测试通过)

cp/lamp/mysql-5.0.41/support-files/mysql.server /etc/rc.d/init.d/mysqldchownroot.root /etc/rc.d/init.d/mysqldchmod755 /etc/rc.d/init.d/mysqldchkconfig--add mysqldchkconfig--list mysqldchkconfig--levels 245 mysqld off
最后,配置root用户登录mysql的密码:mysql>SETPASSWORD FOR 'root'@'localhost'=PASSWORD('********');

13.cd /lamp/php-5.2.6./configure--prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr/local/jpeg6/--with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/--with-mcrypt=/usr/local/libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap--enable-mbstring=all --enable-sockets
make&& make install

cpphp.ini-dist /usr/local/php/etc/php.iniecho"Addtype application/x-httpd-php .php .phtml" >>/etc/httpd/httpd.conf/usr/local/apache2/bin/apachectlrestart

14.安装网站加速器Zendcd /lamp/ZendOptimizer-3.2.6-linux-glibc21-i386./install.sh安装时一路回车:注意php配置文件放在/usr/loca/php/etc/
15。安装phpMyadmin cp -[a,r]/lamp/phpMyAdmin-3.0.0-rc1-all-languages /usr/local/apache2/htdocs/phpmyadmin
cd /usr/local/apahce2/htdocs/phpmyadmin/cp config.sample.inc.php config.inc.phpvi config.inc.php/auth_type 'cokie' → 'http'url:http://10.0.162.128/phpmyadmin/index.php 对话框:user:root password:root 进入mysql服务器的密码

本文出自 “mhf_zzjc” 博客,请务必保留此出处http://1meri3a.blog.51cto.com/6176787/1296708
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: