How to install apache without a linux or unix package installer?
-
Link: http://httpd.apache.org
Ever wondered why your apache directory layout is different? Take a look at this link:
https://wiki.apache.org/httpd/DistrosDefaultLayoutDownload the software from main site or one of the many mirror sites.
Note: apache advise to use the mirror sites to save on bandwidth.$ wget -L http://mirror.catn.com/pub/apache/httpd/httpd-2.4.25.tar.gz --2017-01-25 08:52:07-- http://mirror.catn.com/pub/apache/httpd/httpd-2.4.25.tar.gz Resolving mirror.catn.com (mirror.catn.com)... 87.124.126.49 Connecting to mirror.catn.com (mirror.catn.com)|87.124.126.49|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 8460433 (8.1M) [application/x-gzip] Saving to: ‘httpd-2.4.25.tar.gz’
Verity the integrity of the downloaded file using the keys.
Download the .asc and keys from the main site not the mirror. http://www.apache.org/dist/httpd/
$ wget -L http://www.apache.org/dist/httpd/httpd-2.4.25.tar.gz.asc $ wget -L http://www.apache.org/dist/httpd/KEYS
Import the keys, in this case for gpg
In this case the signature was signed by: httpd-2.4.25.tar.* are signed by Jim Jagielski 791485A8, check your signature at the end of the web page: http://httpd.apache.org/download.cgi$ gpg --import KEYS gpg --verify httpd-2.4.25.tar.gz.asc httpd-2.4.25.tar.gz
Pre-reqs are
Installing apr and apr util, going through the downloading and verifying the integrity of the files.
Download the files from http://apr.apache.org/download.cgi and install into srclib, where you are working from eg: <apache source dir>/srclib/ Create a directory called apr and apr-util and extract the files into these directories, without the version number on them, e.g:$ pwd /var/tmp/httpd-2.4.25/srclib $ ls apr apr-util Makefile.in
Make sure you have the gcc compiler, make, & pcre development tools installed . see this link under requirements: https://httpd.apache.org/docs/2.4/install.html
Compile & Install the software
Note: Here I have just used /usr/local, if I didn't specify the --prefix, the install would have defaulted to /usr/local/apache2, which is better as it keeps all apache related files under that directory.$ gzip -d httpd-2.4.25.tar.gz $ tar xvf httpd-2.4.25.tar $ cd httpd-2.4.25 $ ./configure --with-included-apr --prefix=/usr/local $ make $ sudo make install $ sudo /usr/local/bin/apachectl -k start $ ps -ef | grep httpd root 31320 1 0 10:14 ? 00:00:00 /usr/local/bin/httpd -k start daemon 31321 31320 0 10:14 ? 00:00:00 /usr/local/bin/httpd -k start daemon 31322 31320 0 10:14 ? 00:00:00 /usr/local/bin/httpd -k start daemon 31323 31320 0 10:14 ? 00:00:00 /usr/local/bin/httpd -k start
Test it
$ curl http://localhost <html><body><h1>It works!</h1></body></html>
© Lightnetics 2024