Configure httpd for centos so that the LAN can be accessed normally.

Source: Internet
Author: User

[Reprinted with the source: Qian guozheng's column http://blog.csdn.net/qianguozheng/article/details/37611859]

Problem:

If Apache is installed on centos and the server is configured, the local machine can issue questions, but the IP address of the external LAN cannot issue questions.

Solution:

1. modify the configuration file/etc/httpd/CONF/httpd. conf.

<Directory "/var/www/cgi-bin">
AllowOverride none
Options none
Order allow, deny
Allow from all
</Directory>

2. Add port ing. This is the security feature of the centos system and is also the reason for its application to the server.

Method <1>: directly change the firewall configuration file (/etc/sysconfig/iptables)
-A input-p tcp-M state -- state new-m tcp -- dport 8080-J accept
-A input-p tcp-M state -- state new-m tcp -- dport 80-J accept

Method <2>: Command change

/Sbin/iptables-I input-P TCP -- dport 3306-jaccept


Save Configuration

/Etc/rc. d/init. d/iptables save


Restart the service

Service iptables restart

Or/etc/init. d/iptables restart


Check status

/Etc/init. d/iptables status



Start iptables manually:

Enable: chkconfig iptables on Disable: chkconfig iptables off


Disable the service using iptables:

Enable: Service iptables start Disable: Service iptables stop

Exam

[Http://tieba.baidu.com/p/1303031263]

[Http://www.server110.com/linux/201308/528.html]

[Http://www.2cto.com/ OS /201205/132884.html]

[Http://www.cnblogs.com/rockee/archive/2012/05/17/2506671.html]


[Reprinted with the source: Qian guozheng's column http://blog.csdn.net/qianguozheng/article/details/37611859]

Configure httpd for centos so that the LAN can be accessed normally.

Related Article

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.