linux教程-第十七章lnmp环境搭建_第1页
linux教程-第十七章lnmp环境搭建_第2页
linux教程-第十七章lnmp环境搭建_第3页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

第十七章LNMP境搭供一种快速高效多并发的web服务。在静态页面的处理上Nginx的确胜目前还是有很多者对Nginx比较热衷,随着Nginx的技术逐渐成熟,它在web服务领域的地位越来越高。【MySQL安装mysql到/usr/local/src/cd/usr/local/src/-解

/downloads/linux/mysql-5.0.86-linux-i686-tarzxvf/usr/local/src/mysql-5.0.86-linux-i686-icc-把解压完的数据移动到mvmysql-5.0.86-linux-i686-ii-glibc23mysqluseradd初始化数据cdmkdir/data/mysql;chown-Rmysql:mysql./scripts/mysql_install_db--user=mysql-- 拷贝配置cp 拷贝启动文件并修改其属cpsupport-files/mysql.server od755/etc/init.d/mysqld修改启vim 把启动加入系统服务项,并设定开机启动,启动mysqlchkconfig--addmysqldchkconfigmysqldonservicemysqldstart/data/mysql.err【php的安装这里要先一下,针对Nginx的php安装和针对apache的php安装是有区别Nginxphpfastcginginxuseraddcd /downloads/linux/php-

情况下,phpfastcgitarzxvfphp-gzip-cdphp-5.2.10-fpm-0.5.13.diff.gz|patch-dphp-5.2.10-p1cdphp-5.2.10./configure----with-config-file---with-mysql=/usr/local/mysql--with-mysql---with-libxml-dir--with-gd--with-jpeg-dir--with-png---with-freetype-dir--with-iconv-dir--with-zlib---with-mcrypt=/usr/local/--enable---enable-gd-native-ttf--enable-ftp--enable-mbstring--enable---enable-zend-multibyte--disable-ipv6--enable-fastcgi--enable-fpmmake&&makeinstallmkdircpphp.ini-dist/usr/local/php/etc/php.inivim/usr/local/php/etc/php-fpm.conf<valuename="listen_address">/tmp/php-fcgi.sock</value>这一行要改成这样,这里这样修改了以后,在配置nginx的时候就需要注意这个路径了。Unixuserof/usr/local/php/sbin/php-fpm

Unixgroupof【nginx安装以及配置cd tarzxvfnginx-0.9.6.tar.gzcdnginx-./configure----sbin---conf---error-log---http-log---pid---lock---http-client-body-temp---http-proxy-temp---http-fastcgi-temp-path=/dev/shm/nginx_temp/fastcgi----group=www--with-cpu-opt=pentium4F--without---without-poll_module--with-http_realip_module--with---with-http_gzip_static_module--with---without-http_ssi_module--without---without-http_geo_module--without---without-http_map_module--without---without-mail_imap_module--without-mail_smtp_module--with-pcremake&&makeinstallmkdirpcre-7.8.tar.gz,并解压到/usr/local/src/pcre-7.8,编写nginx的启动,并加入系统服vi/etc/init.d/nginx#chkconfig:-30#description:httpservice.#SourceFunctionLibrary#NginxSettingsstart(){echo-n$"Starting$prog:"mkdir-p/dev/shm/nginx_tempdaemon$NGINX_SBIN-c$NGINX_CONF}stop()}}}

returnecho-n$"Stop$prog:killproc-p$NGINX_PID$NGINX_SBIN-TERMrm-rf/dev/shm/nginx_tempreturnecho-n$"Reloading$prog:killproc-p$NGINX_PID$NGINX_SBIN-HUPreturn$NGINX_SBIN-c$NGINX_CONF-return}case"$1"

exit

od755/etc/init.d/nginxchkconfig--addnginxchkconfignginxonnginxvim/usr/local/nginx/conf/nginx.confuserwwwwww;worker_processeserror_log/usr/local/nginx/logs/nginx_error.logcrit;pid/usr/local/nginx/var/nginx.pid;#Specifiesthevalueforumfiledescriptorsthatcanbeopenedbythisprocess.{useepoll;}{includeserver_names_hash_bucket_size2048;server_names_hash_max_sizelog_formatcombined_realip'$remote_addr$http_x_forwarded_for[$time_local]''$host"$request_uri"$status'sendfileon;tcp_nopushon;keepalive_timeout30;client_header_timeout3m;client_body_timeout3m;send_timeout3m;connection_pool_size256;large_client_header_buffers84k;request_pool_size4k;output_buffers432k;postpone_output1460;client_max_body_size10m;proxy_temp_path/usr/local/nginx/proxy_temp;fastcgi_intercept_errorson;tcp_nodelayon;gzipon;gzip_buffers48k;p_levelgzip_http_versiongzip_typestext/plainapplication/x-javascripttext/csstext/htm{listen80;indexindex.htmlindex.htmindex.php;root/data/www;location\.php${includefastcgi_passunix:/php-fcgi.sock;fastcgi_indexin

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论