一、安装启动httpd/apache服务
在root用户下进行
-
yum install httpd 安装httpd服务
-
service httpd start 启动httpd服务
-
systemctl status httpd 查看httpd服务是否正常
如上图就是正常运行
-
systemctl stop firewalld 关闭防火墙!!关了才能访问到服务
-
配置文件中修改监听端口并重启服务 service httpd restart
-
访问对应ip对应端口能看到服务启动. http:xxx:80
二、安装ftp服务
-
yum install -y vsftpd 安装ftp服务
-
service vsftpd start 启动ftp服务
-
service vsftpd status 查看服务是否启动
- vim /etc/vsftpd/vsftpd.conf 修改配置文件
加入一行*# allow_writeable_chroot=YES*
- service vsftpd restart 重启服务
三、搭建服务器
-
mkdir -p /home/ftp 创建主目录
-
mkdir -p /home/ftp/version 创建存放文件目录
-
/var/www/html 下创建软连接
-
访问服务器
- vim /etc/vsftpd/vsftpd.conf 设置匿名用户权限
anonmous_enalbe=YES
#local_enable=YES
write_enable=YES
#local_umask=022
anon_umask=022 #设置新增文件权限umask
anon_upload_enable=YES #允许上传
anon_mkdir_write_enable=YES #允许下载
anon_other_write_enable=YES #允许修改或删除文件
- 配置点击文件直接下载
vim /etc/mime.types
application/octet-stream bin lha lzh exe class so dll img iso txt
text/plain项去掉该文件类型