Lamp环境搭建



一、首先在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-install

make&& make install


4。cd /lamp/zlib-1.2.3

./configure

make&& make install


5。cd /lamp/libpng-1.2.31

./configure--prefix=/usr/local/libpng/

make&& make install


6mkdir /usr/local/jpeg6

mkdir/usr/local/jpeg6/bin

mkdir/usr/local/jpeg6/lib

mkdir/usr/local/jpeg6/include

mkdir-p /usr/local/jpeg6/man/man1

cd/lamp/jpeg-6b

./configure--prefix=/usr/local/jpeg6/ --enable-shared --enable-static

make&& make install


7。cd /lamp/freetype-2.3.5

./configure--prefix=/usr/local/freetype/

make&& make install


8。cd /lamp/autoconf-2.61

./configure

make&& 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/apachectlstart

echo"/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-overwrite

make && 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/mysqld

chownroot.root /etc/rc.d/init.d/mysqld

chmod755 /etc/rc.d/init.d/mysqld

chkconfig--add mysqld

chkconfig--list mysqld

chkconfig--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.ini

echo"Addtype application/x-httpd-php .php .phtml" >>/etc/httpd/httpd.conf

/usr/local/apache2/bin/apachectlrestart



14.安装网站加速器Zend

cd /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.php

vi config.inc.php

/auth_type 'cokie' → 'http'

url:http://10.0.162.128/phpmyadmin/index.php

对话框:user:root password:root 进入mysql服务器的密码



你可能感兴趣的:(linux,服务器)