Skip to main content


Showing posts from November, 2012

Linux useful commands for Apache

When Apache run on linux, there are several usefull commands:

Assumption: Apache is installed on /sw/pkg/apache.

See server status

Validate configuration files
/sw/pkg/apache/bin/httpd -t

Stop apache
/sw/pkg/apache/bin/apachectl -k stop

See server version
/sw/pkg/apache/bin/httpd -v

See who listen on port 80
netstat  | grep 80
netstat -ltnp | grep ':80'

Installing Apache on linux

Summary of page Compiling and Installing - Apache HTTP Server

Download files Download (1) apr (2) apr-util (3) pcre (4) httpd.

apr and apr-utils from  pcre from from
Compile APR tar -xvzf apr-1.4.6.tar.gz

cd apr-1.4.6/
make install
Compile APR-UTIL
tar -xvzf apr-util-1.4.1.tar.gz

cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make install
Compile PCRE
cd pcre-8.31
./configure --with-apr=/usr/local/apr
make install
Compile HTTPD
tar -xvzf httpd-2.4.1.tar.gz

cd httpd-2.4.1
./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/ --prefix=/sw/pkg/apache

make install
cd ..