Install and configure Apache HTTP Server in CentOS 7
Install and configure Apache HTTP Server in CentOS 7.
Install httpd with RPM
# Yum-yinstall httpd
// When httpd is installed, the dependency package is automatically installed:
Apr
Apr-util
Httpd-tools
Mailcap
# Rpm-qi httpd
Name: httpd
Version: 2.4.6
Release: 18. el7.centos
Architecture: x86_64
Install Date: Mon 11 Aug 2014 02:44:55 PMCST
Group: System Environment/Daemons
Size: 9793373
License: ASL 2.0
Signature: RSA/SHA256, Wed 23 Jul 2014 11:21:22 pm cst, Key ID 24c6a8a7f4a80eb5
Source RPM: httpd-2.4.6-18.el7.centos.src.rpm
Build Date: Wed 23 Jul 2014 10:49:10 PM CST
Build Host: worker1.bsys.centos.org
Relocations: (not relocatable)
Packager: CentOS BuildSystem Vendor: CentOS
URL: http://httpd.apache.org/
Summary: Apache HTTP Server
Description:
The Apache HTTP Server is a powerful, efficient, and extensible web server.
Modify configuration file
# Cd
/Etc/httpd/conf
# Ls
Httpd. conf
Magic
# Cp httpd. conf httpd. conf. origin // back up the original configuration file
# More httpd. conf
// View the configuration file. We noticed the following Configuration:
DocumentRoot "/var/www/html"
// Pay attention to this configuration.
// This is a new default value of Apache 2.4. All requests are rejected!
<Directory/>
AllowOverride none
Require all denied
</Directory>
// Set to auto start
# Systemctl enable httpd. service
Ln-s '/usr/lib/systemd/system/httpd. service'/etc/systemd/system/multi-user.target.wants/httpd. Service'
// In centos7, chkconfig httpd on is replaced with systemctl enable httpd
Configure the WEB site (assuming the documents under the/wwwroot directory are used)
// Create the directory structure of the two websites and the test page file
# Mkdir/wwwroot/www
# Echo "www. bkjia. local">/wwwroot/www/index.html
# Mkdir/wwwroot/crm
# Echo "crm. bkjia. local">/wwwroot/crm/index.html
// Configure the VM host
# Cd/etc/httpd/
# Mkdirvhost-conf.d
# Echo "Include vhost-conf.d/*. conf"> conf/httpd. conf
# Vi/etc/httpd/vhost-conf.d/vhost-name.conf
// Add the following content
<VirtualHost *: 80>
ServerNamewww. bkjia. local
DocumentRoot/wwwroot/www/
</VirtualHost>
<Directory/wwwroot/www/>
Requireall granted
</Directory>
<VirtualHost *: 80>
ServerNamecrm. bkjia. local
DocumentRoot/wwwroot/crm/
</VirtualHost>
<Directory/wwwroot/crm/>
Require ip192.168.188.0/24 // you can set access restrictions.
</Directory>
-------------------------------------- Split line --------------------------------------
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04
Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)
Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind
Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment
LAMP + Xcache environment setup
-------------------------------------- Split line --------------------------------------