The yum source of CentOS for RedHatLinux6.4 Enterprise Edition. Install and configure apache. 1. yum online installation of Apache generally does not use yum online installation because if apache breaks down, the yum installation process may depend on the installation package. Yum online installation command: yuminstallhttpd *-y2, start httpd service command:/etc/init. d/httpdrestart
RedHat yum source of CentOS for Linux 6.4 Enterprise Edition.
Install and configure apache.
1. install Apache online on yum
Generally, you do not use yum for online installation because if apache breaks down, the yum installation package may depend on the installation package.
Yum online installation command: yum install httpd *-y
2. Start the httpd service
Command:/etc/init. d/httpd restart
Cause:
You need to modify the host domain name.
Modify the file: vi/etc/hosts
Restart:/etc/init. d/httpd restart.
3. Configure the publishing file and directory
The default directory is/var/www/html.
The corresponding file is index.html.
You can first write a home page and put it below: vi/var/www/html/index.html
Write a few sentences.
To access this server: Enter the IP address in the address bar of the browser.
Inaccessible!
This involves the firewall problem!
Run iptables-nL.
Run iptables-F.
Iptables-nL
You can try again!
However, in this case, you must disable the firewall, so you need to configure the firewall:
Open the iptables configuration file vi/etc/sysconfig/iptables.
Add a port 80:
-A RH-Firewall-1-INPUT-m state-state NEW-m tcp-p tcp-dport 80-j ACCEPT
That's all!
Set your own release directory below (if you do not need the default directory/var/www/html /)
Run vi/etc/httpd/conf/httpd. conf.
Edit this file:
Comment out the original default directory and change it to your own directory. Input content.
Then, create the release directory and the release file mkdir-p/home/web/in the modified directory/
Edit index.html in vi/home/web/index.html.
Restart the httpd service:/etc/init. d/httpd restart
However, this interface is displayed:
Because selinux has insufficient permissions, we must set the security context of the default release directory:
Install software for security context modification:
Enter the command: yum install policycore *-y
Modify the security context of/home/web
Enter the command: semanage foontext-a-t httpd_sys_content_t '/home (/.*)? '
Restorecon-RvvF/home/
Check the security context of/home/web. The security context is indeed accessible:
Then you can access the IP Address:
Start Apache automatically upon startup:
Vim etc/rc. local and add/etc/init. d/httpd restart!
Finally, how to access the vro's subip address through the Internet:
You need to configure the port ing lan ip address in the vro.
Allow Internet access to the Intranet port forwarding http://www.linuxidc.com/Linux/2015-07/119778.htm
Ubuntu Server 14.04 Install Web Server (Linux + Apache + MySQL + PHP) http://www.linuxidc.com/Linux/2015-06/119061.htm
Install and configure the PHP environment (Apache2) http://www.linuxidc.com/Linux/2015-05/118062.htm in Linux
How does Apache Rewrite in Ubuntu enable http://www.linuxidc.com/Linux/2010-10/29027.htm?
Several highlights of http://www.linuxidc.com/Linux/2015-01/111914.htm after Apache 14.04 upgrade to 2.2 in Ubuntu 2.4
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04Http://www.linuxidc.com/Linux/2013-06/86250.htm
Compile and install LAMP (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm in CentOS 5.9
Source code construction of Web Server Architecture in RedHat 5.4 LAMP environment and application PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm
LAMP source environment to build WEB Server Linux + Apache + MySQL + PHP http://www.linuxidc.com/Linux/2013-05/84882.htm
Apache details: Click here
Apache: Click here
For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-07/119781.htm