I try to compile Apache 2.4.28 from source, I can't use command
apt-get install apache2
Because this command install Apache 2.4.18 only.
Here is my install step:
-
Install dependency
apt-get install build-essential apt-get install libexpat1-dev apt-get install libpcre3-dev libssl-dev
-
Download apache2.4.28
cd /usr/local/src wget http://mirrors.viethosting.com/apache//apr/apr-1.6.2.tar.gz wget http://mirrors.viethosting.com/apache//apr/apr-util-1.6.0.tar.gz wget http://archive.apache.org/dist/httpd/httpd-2.4.28.tar.gz
-
Compile apache 2.4.28
tar xzvf apr-1.6.2.tar.gz tar xzvf apr-util-1.6.0.tar.gz tar xzvf httpd-2.4.28.tar.gz mv apr-1.6.2/ httpd-2.4.28/srclib/apr mv apr-util-1.6.0/ httpd-2.4.28/srclib/apr-util ./configure --prefix=/etc/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
make && make install
ln -s /etc/apache2/bin/apachectl /etc/init.d/apache update-rc.d apache defaults----> It has this warning "insserv: warning: script 'apache' missing LSB tags and overrides" service apache start
After performing the above steps, Apache 2.4.28 has been run. But I when I use
apache2 -v ----> it's not show the version of apache2
Then I install PHP5.6 like this:
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6
When I use this command it not only install php5.6 but also install apache2.4.18 and when I test PHP by:
echo "hello world"; ----> it not show any thing.
And
root@ubuntu:~# ps -aux | grep httpd
root 991 0.0 0.1 75268 3848 ? Ss 02:47 0:00 /usr/local/apache2/bin/httpd -k start
@Edit: as the comment I change:
./configure --prefix=/etc/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
to
./configure --prefix=/usr/local/apache2 --enable-mods-shared="reallyall" --enable-mpms-shared="all"
Please help me, thank in advance.
Best Answer
I believe you have done several things wrong. First this line:
should have been:
Your
--prefix
option during compile is wrong. I advice you remove it and fix that--prefix
optionHow to compile:
Download the source file for the version you want
Install build requirements:
Install
Zlib
for compresssion with these steps:Compile apache with these steps:
Move the downloaded
apache
source file into/usr/local/src
, thenIf you get
APR
error run :If successful run:
Check to see if it's working:
http://localhost
or your machine ip address and you should see a message saying "It works!"Enable
boot startup
:Add to default
runlevels
:Source:
http://www.linuxpathfinder.com/install-apache-from-source-on-ubuntu