一下为手敲可能会有错误的单词或使用空格不当,自行处理


安装vsftpd

yum -y install vsftpd

开机启动

chkconfig vsftpd on

创建用户

useradd xurui

设置密码

echo "1qaz2wsx" |passwd xurui --stdin

启动服务

/etc/init.d/vsftpd start

查看状态

/etc/init.d/vsftpd status

重启服务

/etc/init.d/vsftpd restart

停止服务

/etc/init.d/vsftpd stop

【至于配置文件/etc/vsftpd/vsftpd.conf内的参数开始问题,根据实际情况在另行配置】



安装nginx

安装依赖

yum -y install zlib* pcre*

tar zxvf nginx-1.13.4.tar.gz

cd  nginx-1.13.4

./configure --prefix=/usr/local/nginx     安装模块参数这里不重要,安不安都无所谓

make && make install


创建vsftpd服务器的存放位置

mkdir -p /home/xurui/www

cd /home/xurui/www

mkdir -p downloads  p_w_picpaths  music  videos


配置nginx.conf文件,这是我粘贴出来自己的,可以直接用。

[root@amunlinux conf]# cat nginx.conf

user  root;

worker_processes  1;


events {

    worker_connections  1024;

}

http {

    include       mime.types;

    default_type  application/octet-stream;



    sendfile        on;

    keepalive_timeout  65;



    server {

        listen       80;

        server_name  localhost;



       location / {

            root   html;

            index  index.html index.htm;

       }

location /p_w_picpaths {

            root   /home/xurui/www/;

           autoindex on;

}

error_page  404  /404.html;

error_page   500 502 503 504  /50x.html;

error_log  /var/log/nginx/debug.log debug;

        location = /50x.html {

            root   html;

        }

location ^~ /packages {

    root /home/xurui/www/downloads;

    autoindex on;

    autoindex_exact_size on;

    autoindex_localtime on;

    allow all;

}

location ^~ /music {

    root /home/xurui/www/;

    autoindex on;

    autoindex_exact_size on;

    autoindex_localtime on;

    allow all;

}

location ^~ /videos {

    root /home/xurui/www/;

    autoindex on;

    autoindex_exact_size on;

    autoindex_localtime on;

    allow all;

}

location ^~ /html5 {

    root /home/xurui/www/;

    autoindex on;

    autoindex_exact_size on;

    autoindex_localtime on;

    allow all;

}

location = /404.html {

    root   /usr/share/nginx/html;

}

    }

}


按照我的配置重启nginx

nginx -s reload


测试:

在windows窗口“双击计算机” --> “点击上方输入栏-输入 ftp://你的ip地址进行登录”--> “之后右键点击空白处-登录按钮输入用户名和密码进行登录”

端口是21

用户名就是你设置的useradd那个

密码就是设置的密码

c542429adb90fdd521d6b176f4d8ae04.png-wh_

28ca1f5041e6b247f49aa829311c2219.png-wh_


登录成功


最后进行网页测试:

输入ip地址即可

http://192.168.200.203/p_w_picpaths/ 回车即可。

后期的代码可以进行单独存档。

fe9bd0a334250d32256b148ed04b5263.png-wh_




安装全部完成。


END