Article Directory
Error report phenomenon:
When running the h container with the new httpd image, the port is not mapped successfully
[root@localhost apache]# docker run -d -p 8080:80 httpd:centos
Solution:
When the blogger went back to check the executed script run.sh and found
[root@localhost apache]# vim run.sh
#!/bin/bash
rm -rf /run/httpd* ##这样就是将httpd的所有文件删除了,是错误的
exec /usr/sbin/apachectl -D FOREGROUND
The correct one should be
[root@localhost apache]# vim run.sh
#!/bin/bash
rm -rf /run/httpd/* ##应该是将httpd的下的子文件(包括PID文件等)删除
exec /usr/sbin/apachectl -D FOREGROUND
You can also visit the website after re-run