Linux under Apache Add default Port method

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.