Apache Static Web page
1. Installation
Yum Install Httpd-y
2. Configuration files
Cd/etc/httpd/conf
VI httpd.conf
httpd.conf File Individual line explanation
var email view Mail
ServerName www.example.com:80 Remove comments or you will see a message similar to the error
documentroot/var/www/html static Web page storage location
DirectoryIndex Default Open Homepage
Loglevel warn log level
Logfmart log Format
Alias Virtual Name
AddType adding modules
Virutal Hosting Virtual Host (01. IP 02. Domain name 03. Port)
Service httpd Start
Service iptables status Shutdown firewall
View SELinux modified SELinux values
Vi/etc/selinux/config
Selinux=disabled
Apache script installation and setup
VI myhttp.sh
#!/bin/bash
Yum Install Httpd-y
Rpm-qa|grep httpd && echo "httpd has been created"
Cd/etc/httpd/conf
MV Httpd.conf Httpd.conf.bak
awk '/ServerName www\.example/{print "ServerName www.example.com:80"; Netxt}{print} '
Rm-f Httpd.comf.bak
Server httpd Restart
Chkconfig httpd on
echo "Test HTML page" >/var/www/html/index.html
echo "Now can interview the page by Brower"
Phase IV 10_linux Apache installation and configuration