Tools: RHEL7.5, Ubuntu kylin18.04
Apache Server: RHEL7.5
ip:192.168.1.176
Test machine: Ubuntu kylin18.04
ip:192.168.1.179
--------------------------------------------------------------------------------------------------------------- ----------
********************************************************************************************************
1. Turn off SELinux and firewalls
Setenforce 0 #临时关闭SELINUX
Systemctl Stop Firewalld #关闭防火墙
#永久关闭SElinux
Vim/etc/sysconfig/selinux
#修改其中语句
Selinux=enforcing---> selinux=disabled
2. Create the Web root directory
Mkdir/web
3. Writing the configuration file/etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"---------->documentroot "/web"
#配置文档根目录
<directory "/var/www/html" >------------><directory "/web" >
#配置默认文档
<ifmodule dir_module>
DirectoryIndex index.html
<IfModule>
|
|
<ifmodule dir_module>
DirectoryIndex index.htm
<IfModule>
#配置默认文档
4. Writing index.htm
Vim/web/index.htm
Hello World
5. Turn on httpd service
Systemctl Start httpd
6. Testing
Enter http://192.168.1.176 in the test machine browser
Enter http://127.0.0.1 in the server browser
Ret Hat configuration Apache Service