Apache configuration, apache
The yum source of centos for redhat6.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!
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:
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 intranet port forwarding
Http://www.cnblogs.com/xiaobo-Linux/p/4630944.html