lnmp shell

/etc/init.d/iptables stop

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make cmake gd gd2 gd-devel gd2-devel   libaio

/usr/sbin/groupadd www
/usr/sbin/useradd -g www www

ulimit -SHn 65535


sh -x  /usr/local/sh/tar_all.sh


cd pcre-8.32
./configure --prefix=/usr/local/pcre
make && make install
cd ../


cd openssl-1.0.0e  
 ./config --prefix=/usr/local/openssl   
make
make install  
cd ../


cd nginx-1.5.2
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/source/pcre-8.32 --with-http_realip_module --with-http_image_filter_module  --with-openssl=/usr/local/source/openssl-1.0.0e
make
make install
cd ..


mkdir -p /usr/local/jpeg9

cd jpeg-9/
./configure --enable-shared --enable-static --prefix=/usr/local/jpeg9
make
make install
cd ..


cd libpng-1.6.10
./configure --prefix=/usr/local/libpng
make
make install
cd ..



cd freetype-2.4.12/
./configure --prefix=/usr/local/freetype
make
make install
cd ../


cd libmcrypt-2.5.8/
./configure --prefix=/usr/local/libmcrypt --enable-ltdl-install
make
make install
cd ..

cd mhash-0.9.9.9/
./configure --prefix=/usr/local/mhash
make
make install
cd ../



cd mcrypt-2.6.8/
export  LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib
export  LDFLAGS="-L/usr/local/mhash/lib/ -I/usr/local/mhash/include/"
export  CFLAGS="-I/usr/local/mhash/include/"
./configure --prefix=/usr/local/mcrypt  --with-libmcrypt-prefix=/usr/local/libmcrypt
make
make install
cd ../




groupadd mysql
useradd -g mysql mysql
mkdir -p /usr/local/mysql
mkdir -p /var/data/mysql
chown mysql:mysql -R /usr/local/mysql


cmake  -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
-DMYSQL_DATADIR:PATH=/var/data/mysql \
-DMYSQL_USER=mysql
make
make install



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

//設置mysqld的開機啓動
cp support-files/mysql.server /etc/init.d/mysqld
 chmod 755 /etc/init.d/mysqld      
 chkconfig --add /etc/init.d/mysqld  
chkconfig mysql on


chmod 755 scripts/mysql_install_db
scripts/mysql_install_db  --user=mysql  --basedir=/usr/local/mysql --datadir=/var/data/mysql


export PATH=/usr/local/mysql/bin:$PATH

ln -s /usr/local/mysql/bin/mysql /usr/bin 



/etc/init.d/mysqld start




mysqladmin -u root password 'archermind'

use mysql;
update user set password='archermind' where user = '127.0.0.1';    
delete from user where password="";   
flush privileges;                    

quit;



三、實現MySQL遠程連接的實際操作流程
mysql –u root –p
use mysql;
select user,password,host from user;
update user set host = '192.168.%' where user = '127.0.0.1';   //設置本地用戶可以在任何終端登錄
GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY 'root密碼' WITH GRANT OPTION;  //給root遠程登錄的權限
FLUSH PRIVILEGES;                                              //使設置生效





jpeg9  libpng  freetype  libmcrypt  mcrypt -------------------------


5、編譯安裝PHP 5.5


cd php-5.5.1/
//export LIBS="-lm -ltermcap -lresolv"
//export DYLD_LIBRARY_PATH="/usr/lib/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
//export LD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config  --with-iconv-dir  --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg9 --with-png-dir=/usr/local/libpng --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop  --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring=all --with-mcrypt=/usr/local/libmcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash=/usr/local/mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache  --enable-pdo --with-pdo-mysql --enable-maintainer-zts


---------------------------------------------------------------------------------------------------------------------------------------------------

ln -s /usr/lib64/mysql /usr/lib

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg9 --with-png-dir=/usr/local/libpng --with-zlib --with-libxml-dir=/usr --enable-xml --enable-bcmath --enable-shmop  --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring=all --with-mcrypt=/usr/local/libmcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash=/usr/local/mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache  --enable-pdo --with-pdo-mysql --enable-maintainer-zts --disable-fileinfo

---------------------------------------------------------------------------------------------------------------------------------------------------



make
make install
cd ../


#進行PHP配置文件配置
 cp php.ini-production /usr/local/php/etc/php.ini  
 ./build/shtool install -e ext/phar/phar.phar /usr/local/php/bin/  
 ln -s -f /usr/local/php/bin/phar.phar /usr/local/php/bin/phar
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf


cd /usr/local/php/etc/  
cp php-fpm.conf.default php-fpm.conf  



修改nginx.conf、php.ini、php-fpm.cnf配置文件

啓動php-fpm

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

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

pkill php-fpm



啓動nginx

 /usr/local/nginx/sbin/nginx

/usr/local/nginx/sbin/nginx -s reload

/usr/local/nginx/sbin/nginx -s reopen


測試配置文件是否正確  #./nginx -t 


添加自啓動
#將nginx添加到自啓動中
 echo "/usr/local/nginx/sbin/nginx">> /etc/rc.d/rc.local
#將php添加到自啓動中

 echo "/usr/local/php/sbin/php-fpm start">> /etc/rc.d/rc.local


---------------------------------------------------------------------------------------------------------
  5、編譯安裝PHP擴展
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar zxvf autoconf-latest.tar.gz
cd autoconf-2.69/
./configure --prefix=/Data/apps/libs
make
make install
cd ../

wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar zxvf memcache-2.2.7.tgz
cd memcache-2.2.7/
export PHP_AUTOCONF="/Data/apps/libs/bin/autoconf"
export PHP_AUTOHEADER="/Data/apps/libs/bin/autoheader"
/Data/apps/php/bin/phpize
./configure --with-php-config=/Data/apps/php/bin/php-config
make
make install
cd ../

打開 /Data/apps/php/etc/php.ini 查找 ; extension_dir = "ext"
在其後增加一行:
extension = "memcache.so"
---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------
?配置講解
nginx將會連接回環地址9000端口執行PHP文件,需要使用tcp/ip協議,速度比較慢.建議大家換成使用socket方式連接。將fastcgi_pass 127.0.0.1:9000;改成fastcgi_pass unix:/var/run/phpfpm.sock;
---------------------------------------------------------------------------------------------------
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章