




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、redhat下用nginx+php5搭建高效php应用服务器文件位置php /usr/local/phpphp.ini /etc/php.ininginx /usr/local/nginxmysql /usr/bin/web目录 /var/www准备php环境yum -y install gdyum -y install gd-develyum -y install libmcryptyum -y install libmcrypt-develyum -y install freetypeyum -y install freetype-develyum -y install mysqlyum
2、-y install mysql-develyum -y install libtool-ltdlyum -y install libtool-ltdl-develyum -y install libjpeg-develyum -y install libpng-develyum -y install libmcryptyum -y install libmcrypt-devel安装php模块./configure prefix=/usr/local/php with-config-file-path=/etc with-gd enable-gd-native-ttf with-mysql w
3、ith-iconv-dir with-freetype-dir with-jpeg-dir with-png-dir with-zlib with-libxml-dir enable-xml disable-debug disable-rpath enable-discard-path enable-safe-mode enable-bcmath enable-shmop enable-sysvsem enable-inline-optimization with-curl with-curlwrappers enable-mbregex enable-fastcgi enable-force
4、-cgi-redirect enable-mbstring with-mcryptmakemake install编译lighthttpd得到spawn-fcgi,用来运行fastcgi./configuremakecp ./src/spawn-fcgi /usr/local/php/bin运行fastcgi,-c参数为开启进程数,如果内存大于3gb,可以开至64/usr/local/php/bin/spawn-fcgi -a -p 9000 -c 25 -u www -f /usr/local/php/bin/php-cgi添加用户以及web发布目录/usr/sbin/g
5、roupadd www/usr/sbin/useradd -g www wwwmkdir -p /var/wwwchmod +w /var/wwwchown -r www:www /var/www创建ngnix日志mkdir -p /var/log/nginxchmod +w /var/log/nginxchown -r www:www /var/log/nginx编译安装nginxyum -y install pcre-devel./configure user=www group=www prefix=/usr/local/nginx with-http_stub_status_modul
6、emakemake install配置运行nginxvi /usr/local/nginx/conf/ngnix.confview plaincopy to clipboardprint?#user nobody;worker_processes 10;events ? use epoll;? worker_connections 1024;http ? include conf/mime.types;? default_type application/octet-stream;#log_format main $remote_addr $remote_user $time_local $r
7、equest ? # ”$status” $body_bytes_sent “$http_referer” ? # ”$http_user_agent” “$http_x_forwarded_for”;access_log /var/log/nginx_access.log;sendfile on;? #tcp_nopush on;? #keepalive_timeout 0;? keepalive_timeout 65;? gzip on;? server ? listen 80;? server_name localhost;? charset gb2312;? #access_log l
8、ogs/host.access.log main;? root /var/www;? #error_page 404 /404.html;? # redirect server error pages to the static page /50x.html? #? error_page 500 502 503 504 /50x.html;? location = /50x.html ? root html;? ? location .php?$ ? include conf/fcgi.conf;? fastcgi_pass :9000;? fastcgi_index ind
9、ex.php;? ? #location /.ht ? # deny all;? #? #user nobody;worker_processes 10;events ? use epoll;? worker_connections 1024;http ? include conf/mime.types;? default_type application/octet-stream;#log_format main $remote_addr $remote_user $time_local $request ? # ”$status” $body_bytes_sent “$http_refer
10、er” ? # ”$http_user_agent” “$http_x_forwarded_for”;access_log /var/log/nginx_access.log;sendfile on;? #tcp_nopush on;? #keepalive_timeout 0;? keepalive_timeout 65;? gzip on;? server ? listen 80;? server_name localhost;? charset gb2312;? #access_log logs/host.access.log main;? root /var/www;? #error_
11、page 404 /404.html;? # redirect server error pages to the static page /50x.html? #? error_page 500 502 503 504 /50x.html;? location = /50x.html ? root html;? ? location .php?$ ? include conf/fcgi.conf;? fastcgi_pass :9000;? fastcgi_index index.php;? ? #location /.ht ? # deny all;? #? vi /us
12、r/local/nginx/conf/fcgi.conffastcgi_param gateway_interface cgi/1.1;fastcgi_param server_software nginx;fastcgi_param query_string $query_string;fastcgi_param request_method $request_method;fastcgi_param content_type $content_type;fastcgi_param content_length $content_length;fastcgi_param script_fil
13、ename $document_root$fastcgi_script_name;fastcgi_param script_name $fastcgi_script_name;fastcgi_param request_uri $request_uri;fastcgi_param document_uri $document_uri;fastcgi_param document_root $document_root;fastcgi_param server_protocol $server_protocol;fastcgi_param remote_addr $remote_addr;fas
14、tcgi_param remote_port $remote_port;fastcgi_param server_addr $server_addr;fastcgi_param server_port $server_port;fastcgi_param server_name $server_name;# php only, required if php was built with enable-force-cgi-redirect#fastcgi_param redirect_status 200;fastcgi_param gateway_interface cgi/1.1;fast
15、cgi_param server_software nginx;fastcgi_param query_string $query_string;fastcgi_param request_method $request_method;fastcgi_param content_type $content_type;fastcgi_param content_length $content_length;fastcgi_param script_filename $document_root$fastcgi_script_name;fastcgi_param script_name $fast
16、cgi_script_name;fastcgi_param request_uri $request_uri;fastcgi_param document_uri $document_uri;fastcgi_param document_root $document_root;fastcgi_param server_protocol $server_protocol;fastcgi_param remote_addr $remote_addr;fastcgi_param remote_port $remote_port;fastcgi_param server_addr $server_ad
17、dr;fastcgi_param server_port $server_port;fastcgi_param server_name $server_name;# php only, required if php was built with enable-force-cgi-redirect#fastcgi_param redirect_status 200;/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf启动脚本vi nginx.sh!/bin/shulimit -shn 51200/usr/local/php/bin/spawn-fcgi -a -p 9000 -c 25 -u www -f /usr/local/php/b
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 听读训练考试题及答案
- 天然气管护员考试题库及答案
- 冀教版数学六年级上册1.3 扇形 同步练习(含解析)
- 骨整合电刺激-洞察及研究
- 静脉抽血法试题及答案
- 纪检督察员管理办法
- 财务供热收费管理办法
- it公司取证管理办法
- 营销管理办法明确了
- it数据变更管理办法
- 2025年下半年安徽省港航集团有限公司所属企业社会公开招聘22名考试参考试题及答案解析
- 人教PEP版六年级英语上册全册教案
- 3D打印技术在制造业2025年发展趋势及市场前景可行性分析报告
- 综合楼玻璃安装合同协议书范本模板6篇
- 2025年度集中供暖项目暖气设施安装及售后服务合同
- 护士医护人员职业安全防护培训
- 2025福建厦门市公安局同安分局招聘警务辅助人员50人笔试备考试题及答案解析
- 莲山教学课件下载
- 大学生创新创业基础课件 第7章 创业与创业历程
- 班主任育人故事经验分享陪伴每一名学生慢慢成长模板
- 2025福建漳州闽投华阳发电有限公司招聘52人考试参考题库附答案解析
评论
0/150
提交评论