Nginx安装手冊以及图片server部署
1.??????安裝gcc
yum install gcc
?
2.??????安裝pcre,pcre-devel
在zhoulh文件夾下建立source build文件夾
mkdir source build
進入build文件夾
創建pcre文件夾
cd pcre
?
wget?ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.zip
pcre的版本號隨著時間可能會變動。能夠進入
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/查看最新版本號
解壓縮壓縮包
unzip pcre-8.35.zip
?
進入pcre文件夾
cd pcre-8.35
運行第一步:./configure
運行第二步:make
運行第三部:make install
?
3.??????安裝nginx
cd source
下載nginx版本號
最新版本號能夠到http://nginx.org/download/查看
?
解壓縮
?
執行configure,例如以下命令:
開始編譯:
?
開始安裝
?
啟動nginx
輸入http://ip
顯演示樣例如以下畫面,假設未出現例如以下畫面,則查看/etc/sysconfig/iptables文件是否開放80port
?
下面步驟部署圖片server
1.??????改動nginx.conf文件
改動例如以下
user root; worker_processes 1;error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;#pid logs/nginx.pid;events {worker_connections 1024; }http {include mime.types;default_type application/octet-stream;#log_format main '$remote_addr - $remote_user [$time_local] "$request" '# '$status $body_bytes_sent "$http_referer" '# '"$http_user_agent" "$http_x_forwarded_for"';#access_log logs/access.log main;sendfile on;#tcp_nopush on;#keepalive_timeout 0;keepalive_timeout 65;#gzip on;server {listen 80;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;location / {root html;index index.html index.htm;image_filter test;#image_filter resize $arg_w $arg_h;#image_filter crop $arg_w $arg_h;#image_filter rotate $arg_r;#alias /usr/local/nginx/html/image/;}resize為重定義圖片顯示大小 crop為切圖 rotate為旋轉r度,r必須為90的整數
如:http://192.168.3.158/image/1.jpg?
r=180
2.??????測試nginx.conf文件是否正確?
3.??????重新啟動nginx
4.??????輸入地址查看圖片
本文轉自mfrbuaa博客園博客,原文鏈接:http://www.cnblogs.com/mfrbuaa/p/5059831.html,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的Nginx安装手冊以及图片server部署的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ironport对邮件主题中包括特殊字符
- 下一篇: filter 中用spring Stop