29.11.12

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
/sw/pkg/apache/bin/apachectl

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'

Apache proxy server (with SSL) - troubleshooting

When SSL connection to server fails, first retry the connection using Chrome. Chrome give more information on the problem.
Below is list of Chrome errors and possible ways to troubleshoot them.

openssl summary

openssl is great tool but it is hard to remember its usage ... here is my summary.


28.11.12

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.


Compile APR

tar -xvzf apr-1.4.6.tar.gz

cd apr-1.4.6/
./configure
make
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
make install

Compile PCRE


cd pcre-8.31
./configure --with-apr=/usr/local/apr
make
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
make install
cd ..