The code is as follows |
Copy Code |
/etc/sysconfig/iptables |
Change
The code is as follows |
Copy Code |
/etc/httpd/conf/httpd.conf |
File
Found it
The code is as follows |
Copy Code |
#Listen 12.34.56.78:80 Listen 80 Listen #我添加的默认端口 |
Modify Save
The code is as follows |
Copy Code |
Semanage port-a-T http_port_t-p TCP 66 |
#输入这个命令 or httpd will fail to start.
Wait a little bit.
The code is as follows |
Copy Code |
./etc/rc.d/init.d/httpd Start #启动httpd |
Apache MySQL and other services to modify the default port does not start the solution normally
Now talk about the solution:
Method One: Close SELinux
This is the quickest and most direct way, and it is a common way for many people to sacrifice the security of the system.
You can completely shut down or set the SELinux mode into a tolerant mode, either way.
Close the method thoroughly:
The code is as follows |
Copy Code |
$ vim/etc/selinux/config
|
Add a # Sign in front of the selinux=enforcing and comment it out.
#SELINUX =enforcing
Then add a new line
The code is as follows |
Copy Code |
Selinux=disabled
|
Save, exit, reboot the system
Set as tolerant mode method:
The code is as follows |
Copy Code |
$ setenforce 0 |