lnmp環境
mysql至5.x之後編譯安裝需要使用cmake工具了,所以需要先安裝cmake
cmake-3.3.1安裝
#原始碼目錄
cd /opt/modules/cmake-3.3.1
./configure
make
make install
mysql安裝
groupadd mysql
useradd -g mysql mysql
#安裝依賴庫
yum install -y ncurses ncurses-devel
#原始碼目錄
cd /opt/source/mysql-5.6.24
cmake -dcmake_install_prefix=/opt/lnmp/mysql/5.6.24 -ddefault_charset=utf8 -dmysql_datadir=/opt/lnmp/data/mysql/5.6.24 -dmysql_user=mysql -dmysql_tcp_port=3306 -ddefault_collation=utf8_general_ci
#安裝錯誤,重新cmake的時候,需要先刪除cmakecache檔案
[rm cmakecache.txt]
make
make install
#安裝目錄
cd /opt/lnmp/mysql/5.6.24
cp my-default.cnf /etc/my.cnf
#初始化系統表
./scripts/mysql_install_db –basedir=/opt/lnmp/mysql/5.6.24/ –datadir=/opt/lnmp/data/mysql/5.6.24 –user=mysql –defaults-file=/etc/my.cnf
#啟動服務
./bin/mysqld_safe –defaults-file=/etc/my.cnf &
nginx安裝
#安裝依賴庫
yum install -y installzlib zlib-devel openssl openssl-devel
yum -y install pcre pcre-devel
#原始碼目錄
cd /opt/source/nginx-1.9.1
./configure –prefix=/opt/lnmp/nginx/1.9.1
make
make install
#安裝目錄
cd /opt/lnmp/nginx/1.9.1/
./sbin/nginx &
#暴力關閉伺服器防火牆
service iptables stop
#測試瀏覽器可以訪問
php安裝
#安裝依賴庫[至少我沒找到yum源]
#mhash
cd /opt/source/mhash-0.9.9.9
./configure
make
make install
#libmcrypt
cd /opt/source/libmcrypt-2.5.8
./configure
make
make install
#mcrypt
export ld_library_path=/usr/local/lib:ld_library_path
cd /opt/source/mcrypt-2.6.8
./configure
make
make install
yum install -y libxml2 libxml2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
./configure –prefix=/opt/lnmp/php-5.6.9 –with-libxml-dir=/usr/local/lib –with-zlib-dir=/usr/local/lib –with-mysql=/opt/lnmp/mysql/5.6.24 –with-mysqli=/opt/lnmp/mysql/5.6.24/bin/mysql_config –with-png-dir=/usr/local –with-jpeg-dir=/usr/local –with-curl=/usr/lib –with-freetype-dir=/usr/include/freetype2/freetype/ –with-gd –enable-soap –enable-sockets –enable-xml –enable-mbstring –enable-fpm –enable-pcntl –enable-bcmath –enable-calendar –enable-zip –enable-maintainer-zts
#安裝目錄有點錯位了
cd /opt/lnmp/php-5.6.9
cp ./etc/php-fpm.conf.default ./etc/php-fpm.conf
#啟動php-fpm
./sbin/php-fpm &
vi /opt/lnmp/nginx/1.9.1/conf/nginx.conf
#開啟php支援
location ~ \.php$
成功!
編譯安裝lamp
1,停止防火牆及不必要的服務 etc init.d rpcbind stop etc init.d cups stop etc init.d postfix stop etc init.d qpidd stop etc init.d nfslock stop chkconfig rpcbind of...
LAMP編譯安裝
1 準備安裝環境 yum install y gcc pcre devel openssl devel expat devel 2 解壓縮 3 以 with included apr方式安裝httpd 4 切換目錄 至此httpd編譯安裝完成,後續的善後工作處理 7 建立apache系統使用者,供h...
lamp安裝步驟 編譯
1,停止防火牆及不必要的服務 etc init.d rpcbind stop etc init.d cups stop etc init.d postfix stop etc init.d qpidd stop etc init.d nfslock stop chkconfig rpcbind of...