Skip to content

Instantly share code, notes, and snippets.

@adini121
Last active September 18, 2022 08:30
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adini121/f84c8c92e246359dd6bc to your computer and use it in GitHub Desktop.
Save adini121/f84c8c92e246359dd6bc to your computer and use it in GitHub Desktop.
Install Apache server without root privileges : The definitive guide (Linux/Unix only)

A definitive guide for installing Apache-httpd server without root privileges | Only for unix-like systems

During the work of my thesis I had to run php based applications on a linux server where I had no root privileges. Hence I dug up on the web and I present to you

a way to install apache httpd at any desired location.

./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache 
--enable-deflate --enable-expires --enable-headers --enable-usertrack 
--enable-cgi --enable-rewrite --enable-so --enable-vhost-alias  
--with-apr=/home/nisal/apache/httpd-2.4.17/srclib/apr-1.5.2/ --with-apr-util=/home/nisal/apache/httpd-2.4.17/srclib/apr-util-1.5.4/ 
--prefix=/home/nisal/apache/httpd-2.4.17/ 
--with-pcre=/home/nisal/apache/httpd-2.4.17/pcre/pcre-8.37/

#####APR

cd apr-1.5.2/
./configure --prefix=/home/nisal/apache/httpd-2.4.17/srclib/apr-1.5.2
vim configure
make
make install

#####APR-Utils

cd apr-util-1.5.4/
ls
./configure --prefix=/home/nisal/apache/httpd-2.4.17/srclib/apr-util-1.5.4 --with-apr=/home/nisal/apache/httpd-2.4.17/srclib/apr-1.5.2/
make
make install

#####PCRE

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.zip
cd pcre-8.37/
./configure --prefix=/home/nisal/apache/httpd-2.4.17/pcre/pcre-8.37/
 make
 make install
@wahyudi-arifandi
Copy link

wahyudi-arifandi commented Sep 18, 2022

apr-util has dependency to expat.
Without having this dependency, you will get following error when performing make to apr-util.

... fatal error: expat.h: No such file or directory

To solve, you need to install expat.
Its source code can be downloaded from: https://github.com/libexpat/libexpat/releases.
To install from source code:

./configure --prefix=</path-to-expat-installation-dir>
make
make install

Then, when performing configure to apr-util, you need to do following:

./configure --prefix=</path-to-apr-util-installation-dir> --with-apr=</path-to-apr-installation-dir> --with-expat=</path-to-expat-installation-dir>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment