centos 6.3安装nginx  搭建文件服务器

1、配置CentOS 6.2 第三方yum源(CentOS默认的标准源里没有nginx软件包):

yum install wget    #安装下载工具wget
wget http://www.atomicorp.com/installers/atomic  #下载atomic yum源
sh ./atomic   #安装
yum check-update  #更新yum软件包

或者直接添加源:

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

2、安装nginx:


yum install nginx      #安装nginx,根据提示,输入Y安装即可成功安装

#修改配置文件,这里省略,主要是将目录指定到 /home/ngmsw-files

service nginx start    #启动
chkconfig  nginx on    #设为开机启动


3、安装vsftpd:


yum install vsftpd # 按y安装成功


4、新建ftp用户:


useradd -d /home/ngmsw-files -M nmswxt_files

#设置密码, passwd nmswxt_files # 回车后 输入2次密码
#修改/etc/vsftpd/vsftpd.conf

#错误解决:530 This FTP server is anonymous only
将local_enable=YES前的#(注释)取消;
在anonymous_enable=YES前加上#。
# 错误解决:500 OOPS: vsftpd: security: 'one_process_model' is anonymous only 
one_process_model=yes 改成 one_process_model=no
#修改读写
write_enable=YES

# 用户指定到目录
chown nmswxt_files:nmswxt_files /home/nmswxt_files
# 目录权限
chmod 777 -R  /home/nmswxt_files


 如果还是出现 ftp用户无权限新增文件或者目录的情况,参考下面:


#查看SELinux设置
getsebool -a|grep ftp

#etsebool使用-P参数,无需每次开机都输入这个命令
setsebool -P ftp_home_dir 1