Installation:yum -y install httpd
Support Directory Index:
A. Home index:
Vim/etc/httpd/conf.d/welcome.conf
B. Custom Index styles:
Vim/etc/httpd/conf/httpd.conf
Support for PHP:
Open PathInfo:
Resolving Cross-domain:
To turn on the rewrite function:
To configure a virtual host:
Configuration file Reference:ServerRoot "/etc/httpd" Listen 80Include conf.modules.d/*.confuser apachegroup apacheserveradmin [email Protected]<directory/>allowoverride Nonerequire all Denied</directory>documentroot "/var/www/html" < Directory "/var/www" >allowoverride nonerequire all Granted</directory><directory "/var/www/html" > Header set Access-control-allow-origin *options Indexes followsymlinksindexstylesheet "/css/style.css" IndexOptions Fancyindexing HTMLTable scanhtmltitles foldersfirst namewidth=85 descriptionwidth=128 iconwidth=16 IconHeight=16 Versionsort charset=utf-8allowoverride allrequire all Grantedacceptpathinfo on</directory><ifmodule dir_ Module>directoryindex index.html</ifmodule><files ". ht*" >require all Denied</files>errorlog " Logs/error_log "LogLevel warn<ifmodule log_config_module>logformat"%h%l%u%t \ "%r\"%>s%b \ "%{referer}i\" \ "% {user-agent}i\ "" Combinedlogformat "%h%l%u%t \"%r\ "%>s%b" Common<ifmodule logiO_module> Logformat "%h%l%u%t \"%r\ "%>s%b \"%{referer}i\ "\"%{user-agent}i\ "%I%O" Combinedio</ifmodule> ; Customlog "Logs/access_log" Combined</ifmodule><ifmodule alias_module>scriptalias/cgi-bin/"/var/www/ cgi-bin/"</ifmodule><directory"/var/www/cgi-bin ">allowoverride noneoptions NoneRequire all granted< /directory><ifmodule Mime_module>typesconfig/etc/mime.typesaddtype application/x-compress. Zaddtype application/x-gzip. gz. Tgzaddtype text/html. Shtmladdtype application/x-httpd-php. phtml. PhP3. Incaddoutputfilter includes. Shtml</ifmodule>adddefaultcharset utf-8<ifmodule mime_magic_module> Mimemagicfile conf/magic</ifmodule>enablesendfile onincludeoptional conf.d/*.conf<virtualhost *:80> ServerName virtual.dollar.comDocumentRoot "/var/www/html/virtual/" DirectoryIndex index.php index.html<directory "/var/www/html/virtual/" > Options Indexes followsymlinks allowoverride all Require all GRANted</directory></virtualhost>
CENTOS7 installation configuration Apache (httpd)