linux及案例-operation运维第三天_第1页
linux及案例-operation运维第三天_第2页
linux及案例-operation运维第三天_第3页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

NSDOperationLNMPLNMPLNMP环问方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步骤二:启动服这里需要注意的是,如果服务器上已经启动了其他80端口的服务软件(如httpd),则需要先关闭该服务,否则会出现。[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平问沿用练,通过调整Nginx服务端配置,实现以下目标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~]#步骤三:创建PHP页面,测LNMP架构能否解析PHP页[root@svr5~]#vim 码需要修改为实际mysql,无则留空即可echo"linkdb}echo"linkdb}客户端使用浏览器服务器PHP首页文档,检验是否成功 [root@svr5~]#firefox地址重问沿用练,通过调整Nginx服务端配置,实现以下目标所有的重定向所有 下资源的请求,重定向至实现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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论