First write down the basic steps:
- 1. Environment preparation: turn off the firewall (you can't access it if you don't turn it off, I just have a simple configuration here, the actual deployment project should have specific settings), turn off selinux (tried it, it's fine if you don't turn it off, generally it's turned off) Configure ip
- 2. Install the package
- 3. Modify the configuration file
- 4. Restart the service
- 5. Test
Environment preparation:
Turn off the firewall: service firewalld stop (temporary shutdown) chkconfig firewalld off (permanent shutdown)
Shut down selinux: setenforce 0 (to permanently shut down, modify the configuration file)
The ip has been allocated: it is to use the automatically allocated ip address (nat mode)
Install the package:
yum -y insatll httpd
Modify the configuration environment:
vim /etc/httpd/conf/httpd.conf
Modify the content
Add a default page (restart the service later)
Restart the service:
service httpd restart
test:
Google Chrome opens 192.168.18.133:
Open 192.168.18.133\junjind.txt:
We copy the source code of Baidu homepage to index.html, and we will see the following effect: