| 安装httpd | #yum install httpd -y | |
| 创建网站下载目录 +赋权 | #cd /var/www/ #mkdir www #chmod -R 755 /var/www/www/ | |
| 创建http文件软链目录 | #nano /etc/httpd/conf.d/www.conf 文件www.conf内容如下: Alias / /var/www/www/ <Directory /var/www/www/> Options Indexes FollowSymLinks Order Deny,Allow Allow from all </Directory> |
|
| 更新配置文件外网访问权限 | #nano /etc/httpd/conf/httpd.conf <Directory “/var/www”> AllowOverride None # Allow open access: Require all granted </Directory> | |
| 开启开机自启动+防火墙端口 | #systemctl enable httpd #firewall-cmd –permanent –add-service=http #firewall-cmd –reload | |
| 开启服务 | #systemctl enable httpd #systemctl restart httpd #systemctl status httpd | |
| 测试页面 | #nano /var/www/www/index.html >> Hello World ! |