查看gcc是否安装:rpm -q gcc
查看gcc-c++是否安装:rpm -q gcc-c++
安装gcc:yum install gcc
安装gcc-c++:yum install gcc-c++
查看apache是否安装:rpm -qa | grep httpd
确保apache未启动:service httpd status
查看进程是否启动:ps -le | grep httpd
卸载rpm软件包安装的apache:yum remove httpd
查看mysql是否安装:rpm -qa | grep mysql
确保mysql未启动:service mysqld status
查看进程是否启动:ps -le | grep mysql
查看php是否安装:rpm -qa | grep php
禁用selinux:vi /etc/sysconfig/selinux 设置SELINUX=disabled
关闭防火墙:iptables -F
脚本批解压压缩包
vi tar.sh
cd /lamp
ls *.tar.gz > ls.list
for TAR in `cat ls.list`
do
tar -zxf $TAR
done
sh -x tar.sh
1、解压解包 .tar.gz tar -zxf
2、./configure 配置
3、make 编译
4、make install 安装、拷贝
安装php需要的libxml2
cd libxml2-2.6.30
./configure --prefix=/usr/local/libxml2/
make
make install
卸载libxml2
rm -rf /usr/local/libxml2
rm -rf /lamp/libxml2-2.6.30
安装libmcrypt
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt/
make
make install
cd libltdl
./configure --enable-ltdl-install
make
make install
安装zlib
cd zlib-1.2.3
./configure
make
make install
安装libpng
cd libpng-1.2.31
./configure --prefix=/usr/local/libpng/
make
make install
安装jpeg-6b
cd jpeg-6b
mkdir /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
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make
make install
安装freetype
cd freetype-2.3.5
./configure --prefix=/usr/local/freetype/
./configure --prefix=/usr/local/freetype/
make
make install
安装autoconf
cd /autoconf-2.61
./configure ; make ; make install
yum install libtool yum install libtool-ltdl 如果没有安装就安装
安装gd
cd gd-2.0.35
./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/
make
make install
安装apache
cd 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
如果要支持svn则为如下:
./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 --enable-dav --enable-maintainer-mode
make
make install
启动apache:/usr/local/apache2/bin/apachectl start
查看是否有进程启动:ps -le | grep httpd
如果没有关闭selinux:chcon -t texrel_shlib_t /usr/local/apache2/modules/mod_rewrite.so
apache开机自启动
echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.sysinit
或
echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.local
安装ncurses(mysql编译必须)
cd ncurses-5.6
./configure --with-shared --without-debug --without-ada --enable-overwrite
make
make install
安装mysql
添加组:groupadd mysql
查看添加的组:grep mysql /etc/group
添加用户:useradd -g mysql mysql
查看用户:grep mysql /etc/passwd
cd mysql-5.0.41
./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all
make
make install
生成配置文件:[root@localhost mysql-5.0.41]# cp support-files/my-medium.cnf /etc/my.cnf
创建mysql数据库授权表:[root@localhost mysql-5.0.41]# /usr/local/mysql/bin/mysql_install_db --user=mysql
安装目录所有者改变成root:chown -R root /usr/local/mysql
数据目录所有者改变成mysql:chown -R mysql /usr/local/mysql/var
再把mysql目录的所有组改变成mysql:chgrp -R mysql /usr/local/mysql
ls -ld /usr/local/mysql
ls -ld /usr/local/mysql/var
启动mysql:/usr/local/mysql/bin/mysqld_safe --user=mysql &
查看进程是否存在:ps -le | grep mysqld netstat -an | grep 3306
进入客户端:/usr/local/mysql/bin/mysql -u root
设置密码:mysql> SET PASSWORD FOR 'root'@'localhost'=PASSWORD('1234');
mysql开机自启动
cp /lamp/mysql-5.0.41/support-files/mysql.server /etc/rc.d/init.d/mysqld
chown root.root /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld chkconfig --level 245 mysqld off 不是必须
安装php
cd 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
yum install libtool yum install libtool-ltdl 如果没有安装就安装
make
make install
复制php配置文件:cp php.ini-dist /usr/local/php/etc/php.ini
修改apache配置文件:vi /etc/httpd/httpd.conf
AddType application/x-gzip .gz .tgz 之后加上 Addtype application/x-httpd-php .php .phtml
默认打开index.php:DirectoryIndex index.html 之后加上 index.php
重启apache:/usr/local/apache2/bin/apachectl restart
测试:
vi /usr/local/apache2/htdocs/test.php
<?
phpinfo();
?>
安装zendoptimizer
cd ZendOptimizer-3.2.6-linux-glibc21-i386
./install .sh
安装phpMyAdmin
cp -a /lamp/phpMyAdmin-3.0.0-rc1-all-languages /usr/local/apache2/htdocs/phpmyadmin
cd /usr/local/apache2/htdocs/phpmyadmin
cp config.sample.inc.php config.inc.php
vi config.inc.php
$cfg['Servers']['$i']['auth_type']='cookie'; 改成 $cfg['Servers']['$i']['auth_type']='http';
打开链接:192.168.0.106/phpmyadmin/index.php