日期:2014-05-16  浏览次数:20775 次

linux配置FTP服务并通过ngnix下载
  1. useradd rcms
    • 输入两遍密码 rcms
  2. 创建目录
    • mkdir -p /data/cache1/rcms/download
  3. 修改rcms的ftp目录
    • vi /etc/passwd
    • rcms:x:500:500::/data/cache1/rcms:/bin/bash
  4. 修改vsftpd配置
    • vi /etc/vsftpd/vsftpd.conf
    • chroot_local_user=YES
    • service vsftpd restart
    • chown rcms.rcms /data/cache1/rcms -R
  5. 用nginx发布
    • nginx安装包
    • cd /usr/local
    • scp root@192.168.6.153:/data/cache5/rcms_software/nginx/nginx-0.7.67.tar.gz .

    • tar zxvf nginx-0.7.67.tar.gz
    • cd nginx-0.7.67
    • 解压后安装
      • ./configure 
        make && make install
    • 将环境变量加入/etc/profile的 path中
    • vi /etc/profile
    • /usr/local/nginx/sbin
    • source /etc/profile
    • 修改nginx配置文件
      • vi /usr/local/nginx/conf/nginx.conf
        
        写入以下配置
        worker_processes  2;
        events {
            worker_connections  1024;
        }
        
        http {
            include       mime.types;
            default_type  application/octet-stream;
            #default_type  text/plain;
            
            sendfile        on;
            keepalive_timeout  65;
            #gzip  on;
            
            server {
                listen          80;
                location / {
                    root /data/cache1/rcms;
                }
            }
        }
        
    • 启动nginx
      • nginx