利用nginx在服务器搭建下载功能,

安装Nginx,pcre
mkdir /usr/local/nginx
tar zxvf pcre-8.12.tar.gz
cd pcre-8.12
./configure --prefix=/usr/local/pcre
make && make install
tar zxvf nginx-1.0.12.tar.gz

tar zxvf nginx-1.0.12.tar.gz
cd nginx-1.0.12
./configure --prefix=/usr/local/nginx/ --with-pcre=/opt/pcre-8.12
make && make install
vi /usr/local/nginx/conf/nginx.conf

#user www www;
worker_processes 8;
error_log /usr/local/nginx/logs/error.log crit;
pid    /usr/local/nginx/logs/nginx.pid;
 
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 010000
00 10000000;
worker_rlimit_nofile 51200;
 
events {
    use epoll;
    worker_connections 51200;
}
 
http {
   include    mime.types;
  default_type application/octet-stream;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
  access_log off;
  sendfile on;
  tcp_nodelay on;
  tcp_nopush   on;
  keepalive_timeout 30;
 
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 32k;
  fastcgi_buffers 8 32k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 256k;
  fastcgi_intercept_errors on;
  open_file_cache max=51200 inactive=20s;
  open_file_cache_valid 30s;
  open_file_cache_min_uses 1;
 
  gzip on;
  gzip_min_length 1k;
  gzip_buffers   4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types    text/plain application/x-javascript text/css application/xml;
  gzip_vary on;
  #if you modify nginx source,please hidden follow
  #server_tokens off;
  log_format access '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" $http_x_forwarded_for';
    include     /usr/local/nginx/conf/vhost/*.conf;
}

虚拟主机配置

mkdir /usr/local/nginx/conf/vhost
cd /usr/local/nginx/conf/vhost
vi hosts.conf

server {
  listen    80;
  server_name 42.62.XX.
  index index.html index.htm index.php;
  root /game/;
 
 
  error_page 502 = /502.html;
  location ~* ^/upload/.*\.(php|php5)$ {
          deny all;
  }
#  location ~ .*\.(php|php5)?$ {
#        #fastcgi_pass unix:/tmp/php-cgi.sock;
#    fastcgi_pass 127.0.0.1:9000;
#    fastcgi_index index.php;
#    include fastcgi.conf;
#  }
 
 
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|mp3)$ {
    expires   30d;
  }
 
  location ~ .*\.(js|css)?$ {
    expires   12h;
  }
#access_log /data/webroot/nginx/logs/access.log access;
#error_log /data/webroot/nginx/logs/error.log error;
}

#/usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful

#/usr/local/nginx/sbin/nginx -s reload

此时在服务器上创建 /game 目录, 把需要被下载的资源放目录里面就可以了。

标签:
下载服务器

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“CentOS利用Nginx搭建下载功能服务器”

暂无“CentOS利用Nginx搭建下载功能服务器”评论...

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。