Under the use of Linux vsftpd + nginx to build a file server

1. Install and check whether they have installed vsftpd

yum -y install vsftpd // 安装
rpm -qa | grep vsftpd // 查看是否已经安装

2. vsftpd configuration file

After successful installation, there /etc/vsftpd/vsftpd.conf file is vsftpd configuration file

Such as configuration, after successful login to access files

3. Add users

useradd ftpadmin // 添加用户
passwd ftpadmin // 为用户设置密码,输入两次

4.vsftpd common operations command

service vsftpd start // 启动Vsftpd服务
service vsftpd stop // 停止Vsftpd服务的命令
service vsftpd restart // 重新启动Vsftpd服务
service vsftpd status // 检查Vsftpd服务状态
chkconfig vsftpd on // 设置开机启动vsftpd服务

5. Installation nginx

First install dependencies

yum install gcc-c++ // 安装gcc
yum install -y pcre pcre-devel // PCRE pcre-devel 安装
yum install -y zlib zlib-devel // zlib 安装
yum install -y openssl openssl-devel // OpenSSL 安装

Then go to the official website to download .gz package nginx

Download: https://nginx.org/en/download.html

tar -zxvf nginx-1.12.1.tar.gz // 解压nginx
cd nginx-1.12.1
make
make install // 编译安装

6. Configure nginx (configured according to their needs)

Usually installed by default path /usr/local/nginx/conf/nginx.conf

server {
        listen 80; # 监听端口
        server_name  localhost; # 请求地址
        index  index.html index.htm index.php;
        location /images {
                root /home/ftpfile/;   # vsftpd文件路径
                autoindex on;
        }
}

7.nginx commonly used commands

whereis nginx // 查找nginx安装路径
cd /usr/local/nginx/sbin/
./nginx   (启动)
./nginx -s stop (停止)
./nginx -s quit  (关闭)
./nginx -s reload (重启)

8. Configure the result of a successful visit

Published 21 original articles · won praise 0 · Views 599

Guess you like

Origin blog.csdn.net/Stodger0216/article/details/104333491