Download httpd-2.2.26.tar.gz (download address), execute
sudo tar xzfv httpd-2.2.26.tar.gz cd httpd-2.2.26sudo./configure--prefix=/usr/local/apache2--enable-module= Most--enable-rewrite--enable-shared=max--enable-so
If you are prompted with the following error:
Checking for C compiler default output file name ... Configure:error:c compiler cannot create executables
The reason is that Libc6-dev is not installed, performing
sudo apt-get install build-essential
It's OK.
Then re-execute:
sudo ./configure--prefix=/usr/local/apache2--enable-module=most--enable-rewrite--enable-shared=max-- Enable-so
No error, then execute
sudo makesudo make Installsudo groupadd apachesudo useradd-g Apache apachesudo passwd apachesudo chown-r apache:apache/ Usr/local/apache2
Modify the Apache configuration file to perform
sudo vi/usr/local/apache2/conf/httpd.conf
Found it
User Nobodygroup #-1
Modified into
User Apachegroup Apache
Found it
#ServerName www.example.com:80
Switch
ServerName *:80
Save!
Execute command
Sudo/usr/local/apache2/bin/apachectl start
Launch Apache.
Open Browser, Access http://localhost
If all goes well, you should see the Apache test page. Congratulations, Apache's installed!
The commands to restart and close the Apache service are:
Sudo/usr/local/apache2/bin/apachectl Restartsudo/usr/local/apache2/bin/apachectl Stop