Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Apr 152010
 

How to tell if Apache 2 is using prefork or worker MPM?

Answer:

If you are running in Red Hat Linux/ Fedora/ CentOS

# httpd -V
....
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
...

If you are running in Debian/ Ubuntu, you can use apache2 -V, which get the same output as above.

Apr 102010
 

Installing Nginx in Ubuntu

Answer:

1. Using aptitude

# sudo aptitude install nginx

2. Start it

# sudo /etc/init.d/nginx start

3. Stop it

# sudo /etc/init.d/nginx stop

4. Restart it

# sudo /etc/init.d/nginx restart

Mar 302010
 

Adding SSL suport in Nginx

Answer:

Assume you have got your certificate file (server.crt) from a CA, and you also have a private key (server.key).

1. Compile Nginx to support SSL

# ./configure --with-http_ssl_module

2. Add the following line in nginx.conf

server {
    server_name YOUR_DOMAINNAME_HERE;
    listen 443;
    ssl on;
    ssl_certificate /usr/local/nginx/conf/server.crt;
    ssl_certificate_key /usr/local/nginx/conf/server.key;
}

3. Restart Nginx

Reference: http://wiki.nginx.org/NginxHttpSslModule