Oracle Linux/Apache httpd
From r00tedvw.com wiki
(Difference between revisions)
Line 1: | Line 1: | ||
=Installing Apache HTTPD from source= | =Installing Apache HTTPD from source= | ||
More recently CVEs have been discovered in the latest versions of httpd available from the repos, which presents a problem for administrators since they cannot easily upgrade to a patched version. For such cases, sometimes manually compiling httpd from source is the only temporary solution until the repositories are updated or backported. | More recently CVEs have been discovered in the latest versions of httpd available from the repos, which presents a problem for administrators since they cannot easily upgrade to a patched version. For such cases, sometimes manually compiling httpd from source is the only temporary solution until the repositories are updated or backported. | ||
+ | |||
==Remove if already installed== | ==Remove if already installed== | ||
If you already have httpd installed, remove it. | If you already have httpd installed, remove it. | ||
<nowiki>~$ sudo yum remove httpd -y</nowiki> | <nowiki>~$ sudo yum remove httpd -y</nowiki> | ||
+ | |||
==Install dependencies, download and unpack source== | ==Install dependencies, download and unpack source== | ||
Install the epel repo, then grab some needed packages. | Install the epel repo, then grab some needed packages. | ||
Line 19: | Line 21: | ||
<nowiki>~$ cp -r /tmp/apache/apr-1.6.5 /tmp/apache/httpd-2.4.35/srclib/apr | <nowiki>~$ cp -r /tmp/apache/apr-1.6.5 /tmp/apache/httpd-2.4.35/srclib/apr | ||
~$ cp -r /tmp/apache/apr-util-1.6.1 /tmp/apache/httpd-2.4.35/srclib/apr-util</nowiki> | ~$ cp -r /tmp/apache/apr-util-1.6.1 /tmp/apache/httpd-2.4.35/srclib/apr-util</nowiki> | ||
+ | |||
+ | ==Compile time== | ||
+ | It's easiest just to be within the directory. | ||
+ | <nowiki>~$ cd /tmp/apache/httpd-2.4.35</nowiki> | ||
+ | Now lets build the conf and then compile including SSL support (mod-ssl) | ||
+ | <nowiki>~$ ./buildconf | ||
+ | ~$ ./configure --enable-ssl --enable-so --enable-http2 --with-mpm=event --with-included-apr --with-ssl=/usr/local/openssl --prefix=/usr/local/apache2 | ||
+ | ~$ make</nowiki> |
Revision as of 15:12, 8 October 2018
Contents[hide] |
Installing Apache HTTPD from source
More recently CVEs have been discovered in the latest versions of httpd available from the repos, which presents a problem for administrators since they cannot easily upgrade to a patched version. For such cases, sometimes manually compiling httpd from source is the only temporary solution until the repositories are updated or backported.
Remove if already installed
If you already have httpd installed, remove it.
~$ sudo yum remove httpd -y
Install dependencies, download and unpack source
Install the epel repo, then grab some needed packages.
~$ sudo yum install epel-release -y ~$ sudo yum install autoconf expat-devel libtool libnghttp2-devel pcre-devel -y
Next we need to download apache httpd and (2) of apache's runtime libraries.
~$ curl -L https://github.com/apache/httpd/archive/2.4.35.tar.gz -o /tmp/apache/2.4.35.tar.gz --create-dirs ~$ curl -L https://github.com/apache/apr/archive/1.6.5.tar.gz -o /tmp/apache/1.6.5.tar.gz --create-dirs ~$ curl -L https://github.com/apache/apr-util/archive/1.6.1.tar.gz -o /tmp/apache/1.6.1.tar.gz --create-dirs
untar them
~$ tar -zxvf 2.4.35.tar.gz -C /tmp/apache/ ~$ tar -zxvf 1.6.5.tar.gz -C /tmp/apache/ ~$ tar -zxvf 1.6.1.tar.gz -C /tmp/apache/
Move APR libraries into place. Make sure the new directory names do not have a version number.
~$ cp -r /tmp/apache/apr-1.6.5 /tmp/apache/httpd-2.4.35/srclib/apr ~$ cp -r /tmp/apache/apr-util-1.6.1 /tmp/apache/httpd-2.4.35/srclib/apr-util
Compile time
It's easiest just to be within the directory.
~$ cd /tmp/apache/httpd-2.4.35
Now lets build the conf and then compile including SSL support (mod-ssl)
~$ ./buildconf ~$ ./configure --enable-ssl --enable-so --enable-http2 --with-mpm=event --with-included-apr --with-ssl=/usr/local/openssl --prefix=/usr/local/apache2 ~$ make