linux及案例-operation運維第三天_第1頁
linux及案例-operation運維第三天_第2頁
linux及案例-operation運維第三天_第3頁
已閱讀5頁,還剩3頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

NSDOperationLNMPLNMPLNMP環(huán)問方MySQLcmake,MySQLmysql_install_dbLinuxmhash、libiconv、步[root@svr5~]#yum-ygroupinstall"Developmenttools""Additional[root@svr5~]#yum-yinstallgccopenssl-develpcre-develzlib-..[root@svr5~]#useradd–s/sbin/nologin[root@svr5~]#tar-zxvfnginx-[root@svr5~]#cdnginx-[root@svr5nginx-1.2.0]#./configure>--prefix=/usr/local/nginx>--user=www--group=www>--with-http_ssl_module--with-http_flv_module>--with-http_stub_status_module>--with-http_gzip_static_module..[root@svr5~]#make&&make..[root@svr5~]#tar-zxvfcmake-[root@svr5~]#cdcmake-[root@svr5cmake-]#./bootstrap--[root@svr5cmake-]#make&&make[root@svr5cmake-]#/usr/local/cmake/bin/cmake--ncmakeversion4)mysql[root@svr5~]#useradd–s/sbin/nologin[root@svr5~]#tar-zxvfmysql-[root@svr5~]#cdmysql-[root@svr5mysql-5.5.13]#/usr/local/cmake/bin/cmake>-DCMAKE_INSTALL_PREFIX=/usr/local/mysql>-DSYSCONFDIR=/etc-DMYSQL_DATADIR=/usr/local/mysql/data>-DMYSQL_TCP_PORT=3306>-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock>-DMYSQL_USER=mysql-DEXTRA_CHARSETS=all>-DWITH_SSL=system-DENABLED_LOCAL_INFILE=1[root@svr5mysql-5.5.13]#make&&make[root@svr5mysql-5.5.13]#chown-Rmysql.mysql[root@svr5mysql-5.5.13]#cd[root@svr5mysql]#./scripts/mysql_install_db>--user=mysql--[root@svr5mysql]#lsmysqlperformance_schematest5)安裝mhash、libiconv、、php[root@svr5~]#tar-zxvfmhash-[root@svr5~]#cdmhash-[root@svr5mhash-]#[root@svr5mhash-]#make&&make[root@svr5~]#tar-zxvflibiconv-[root@svr5libiconv-1.13]#cdlibiconv-[root@svr5libiconv-1.13]#[root@svr5libiconv-1.13]#make&&make[root@svr5~]#tar-zxvf-[root@svr5~]#cd-[root@svr5-2.5.8]#[root@svr5-2.5.8]#make&&make[root@svr5-2.5.8]#ldconfig-[root@svr5-2.5.8]#cdlib[root@svr5libl]#./configure--with-gmetad--enable-gexec>--enable-l-[root@svr5libl]#make&&make[root@svr5~]#ln-sv/usr/local/lib/*[root@svr5~]#ln-sv/usr/local/lib/libmhash.*[root@svr5~]#ln-sv/usr/local/lib/libicon*[root@svr5~]#tar-zxvfphp-[root@svr5~]#cdphp-[root@svr5php-5.4.9]#./configure>--prefix=/usr/local/php5>--with-config-file-path=/usr/local/php5/etc>--with-mysql=/usr/local/mysql>--with-mysqli=/usr/local/mysql/bin/mysql_config>--enable-fpm--enable-[root@svr5php-5.4.9]#makeZEND_EXTRA_LIBS='-[root@svr5php-5.4.9]#make[root@svr5php-5.4.9]#cpphp.ini-production步驟二:啟動服這里需要注意的是,如果服務器上已經(jīng)啟動了其他80端口的服務軟件(如httpd),則需要先關閉該服務,否則會出現(xiàn)。[root@svr5~]#servicehttpd [root@svr5~]#chkconfighttpd[root@svr5~]#/usr/local/nginx/sbin/nginx-c[root@svr5~]#netstat-utnlp|grep 0 [root@svr5mysql]#cp [root@svr5mysql]#cp/usr/local/mysql/support-files/mysql.server>[root@svr5mysql]#od+x[root@svr5mysql]#chkconfigadd[root@svr5mysql]#chkconfigmysqld[root@svr5~]#servicemysqld[root@svr5~]#echo“/usr/local/mysql/lib/”>>[root@svr5~]#[root@svr5~]#vim..export[root@svr5~]#sourceLNMP平問沿用練,通過調(diào)整Nginx服務端配置,實現(xiàn)以下目標Fast-CGIPHPPHPPHP方圖-Nginxphp-fpmPHPlisten=pm.max_children=pm.start_servers=pm.min_spare_servers=pm.max_spare_servers=步默認安裝完php后,會自動生成一個php-fpm參考模板,我們需要該模板,并進行適當修改[root@svr5~]#cd[root@svr5etc]#cpphp-fpm.conf.defaultphp-fpm.conf2)php-fpmphp-fpm[root@svr5etc]#vim/usr/local/php5/etc/php-pid=run/php-error_log=log/php-log_level=daemonize=user=group=listen=pm=pm.max_children=pm.start_servers=pm.min_spare_servers=pm.max_spare_servers=[root@svr5~]#cdphp-[root@svr5fpm]#cpinit.d.php-fpm/etc/rc.d/init.d/php-[root@svr5fpm]#od+x/etc/rc.d/init.d/php-[root@svr5fpm]#chkconfig--addphp-[root@svr5fpm]#servicephp-fpm[root@svr5fpm]#psaux|grepphp-步驟二:修改Nginx配置文件并啟動服[root@svr5~]#vimlocation/rootindexindex.phpindex.html}location~\.php$rootfastcgi_passfastcgi_indexfastcgi_paramSCRIPT_FILENAMEinclude}[root@svr5~]#vim..fastcgi_param $fastcgi_param fastcgi_param $[root@svr5~]#步驟三:創(chuàng)建PHP頁面,測LNMP架構能否解析PHP頁[root@svr5~]#vim 碼需要修改為實際mysql,無則留空即可echo"linkdb}echo"linkdb}客戶端使用瀏覽器服務器PHP首頁文檔,檢驗是否成功 [root@svr5~]#firefox地址重問沿用練,通過調(diào)整Nginx服務端配置,實現(xiàn)以下目標所有的重定向所有 下資源的請求,重定向至實現(xiàn)IE瀏覽器和火狐瀏覽器不同的頁方Nginxrewriteregexreplacement步Nginx[root@svr5~]#vim..serverlistenlocation/rootindexindex.html rewrite^/htt //地址重寫,將被重 rewrite^/image/(.*)$/picture/$1break; //所有/image if($http_user_agent~MSIE) rewrite^(.*)$/nginx-ie/$1}if($http_user_agent~Firefox) rewrite^(.*)$/nginx-firefox/$1}}}步驟二:客戶端測客戶端使用瀏覽器測試各個頁面的是否被重定向防止盜問 其他,使用本的、資如果有引入,則重定向至一個錯誤頁方Nginx防止盜鏈需要使用的是valid_referers,來定

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論