LAMP LNMP环境

 以前整理的LAMP 跟 LNMP环境配置。 

LAMP环境:

cd /lamp/libxml2-2.6.30

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

make 

make install

 

cd /lamp/libmcrypt-2.5.8

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

make 

make install

 

cd /lamp/libmcrypt-2.5.8/libltdl

./configure --enable-ltdl-install

make

make install

 

cd /lamp/zlib-1.2.3

./configure

make

make install 

 

cd /lamp/libpng-1.2.31

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

make

make install

 

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

cd /lamp/jpeg-6b

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

make

make install

 

cd /lamp/freetype-2.3.5

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

make

make install

 

cd /lamp/autoconf-2.61

./configure

make 

make install

 

cd /lamp/gd-2.0.35

./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/

make

make install

 

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/apachectl start

echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.sysinit

 

cd /lamp/ncurses-5.6

./configure --with-shared --without-debug --without-ada --enable-overwrite

make 

make install

 

groupadd mysql

useradd -g mysql mysql

cd /lamp/mysql-5.0.41

./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all

make

make install

 

cp support-files/my-medium.cnf /etc/my.cnf

/usr/local/mysql/bin/mysql_install_db --user=mysql

chown -R root /usr/local/mysql

chown -R mysql /usr/local/mysql/var

chgrp -R mysql /usr/local/mysql

 

/usr/local/mysql/bin/mysqld_safe  --user=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 --levels 245 mysqld off

 

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

 

cp php.ini-dist /usr/local/php/etc/php.ini

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

/usr/local/apache2/bin/apachectl restart

LNMP环境:

cd /lnmp/ncurses-5.6

./configure --with-shared --without-debug --without-ada --enable-overwrite

make 

make install

 

-----------------------------------------------------------mysql数据库需要ncusers库------------------------------------------

 

groupadd mysql

useradd -g mysql mysql

cd /lamp/mysql-5.0.41

./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all --with-plugins=all 指定安装全部存储引擎

make

make install

 

cp support-files/my-medium.cnf /etc/my.cnf

/usr/local/mysql/bin/mysql_install_db --user=mysql

chown -R root /usr/local/mysql

chown -R mysql /usr/local/mysql/var

chgrp -R mysql /usr/local/mysqls

 

/usr/local/mysql/bin/mysqld_safe  --user=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 --levels 245 mysqld off

 

 

-------------------------------------------------------------------php安装----------------------------------------------------

cd /lnmp/libxml2-2.6.30

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

make 

make install

 

cd /lnmp/libmcrypt-2.5.8

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

make 

make install

 

cd /lnmp/libmcrypt-2.5.8/libltdl

./configure --enable-ltdl-install

make

make install

 

cd /lnmp/zlib-1.2.3

./configure

make

make install 

 

cd /lnmp/libpng-1.2.31

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

make

make install

 

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

cd /lnmp/jpeg-6b

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

make

make install

 

cd /lnmp/freetype-2.3.5

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

make

make install

 

cd /lnmp/autoconf-2.61

./configure

make 

make install

 

cd /lnmp/gd-2.0.35

./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/

make

make install

 

cd /lnmp/php-5.2.6

./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/  --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-fastcgi --enable-fpm

make

make install 

 

cp php.ini-disk /usr/local/php/etc/php.ini 

 

报错1 找不到libjpeg.so 安装libjpeg-devel 

报错2 找不到libldtl.so.3 这个是路径不对 做个软连接过来 

ln -s /usr/local/lib/libldtl.so.3 /usr/lib/

 

/usr/local/php/sbin/php-fpm start

 

 

--------------------------------------------------------Nginx需要系统安装了openssl-devel pcre-devel zlib-devel库文件---------------------------------------

 

cd /lnmp/nginx-0.7.69

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_ssl_module 

 

make 

make install

 

/usr/local/nginx/bin/nginx 启动nginx

/usr/local/nginx/bin/nginx -t 检查配置文件是否错误

kill -HUP `cat /usr/local/nginx/logs/nginx.pid` 平滑重启nginx服务

你可能感兴趣的:(lamp,lnmp环境)