Install the Apache service by source code
1. Yum install-y gcc * install the gcc Environment
Yum install-y openssl * install the openssl Software Package
2. Download the httpd source code package;
Tar-xzvf httpd-2.2.9.tar.gz-C/usr/src unzip the source package to the/usr/src directory <source package directory>
3. Mkdir-p/usr/local/apache2
4../configure -- prefix =/usr/local/apache2 -- enable-so
-- Enable-rewrite -- enable-ssl -- with-ssl =/usr/lib
-- Enable-suexec -- with-suexec-caller = daemon
-- With-suexec-docroot =/usr/local/apache2
5. Make compile the server program
6. Make install the server program
7./usr/local/apache2/bin/apachectl start to start the httpd service
8./usr/local/apache2/bin/apachectl-t syntax check
Change the httpd Startup Mode:
1. Copy the http script to the/etc/rc. d/init. d directory:
Cp-a apachectl/etc/rc. d/init. d/httpd
2. vi httpd
# Chkconfig: 345 70 70
# Description: apache
3. Add httpd to the startup Item:
Chkconfig -- add httpd
4. Check whether the httpd service exists:
Chkconfig -- list httpd
The root directory of the Apache server after the source code is installed:
/Usr/local/apache2/
Log File:
/Usr/local/apache2/logs/
Httpd main configuration file:
/Usr/local/apache2/conf/httpd. conf
Root directory of the Hhttp server webpage:
/Usr/local/apache2/htdocs/
Create a virtual WEB host:
Cd/usr/local/apache2/htdocs/create a virtual directory bkjiacom
Mkdir bkjiacom
Cd benetcom
Cp/usr/local/apache2/htdocs/index.html./create a test webpage
Vi index.html
Cd/usr/local/apache2/conf/Add VM Configuration
Vi httpd. conf
: R extra/httpd-vhosts.conf
<VirtualHost *: 80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/usr/local/apache2/docs/bkjiacom"
ServerName www.bkjia.com
# ServerAlias www.dummy-host.example.com
ErrorLog "logs/bkjia.com-error_log"
CustomLog "logs/bkjia.com-access_log" common
</VirtualHost>
Location of the Apache configuration file installed with RPM:
/Etc/httpd/Apache service program root directory
/Etc/httpd/conf/httpd. conf main configuration file
/Var/www/html webpage document default root directory
/Var/log/httpd/error_log Error log File
/Var/log/httpd/access_log access log file
Install a Web Server on Ubuntu Server 14.04 (Linux + Apache + MySQL + PHP)
Install and configure the PHP environment in Linux (Apache2)
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
Apache details: click here
Apache: click here
This article permanently updates the link address: