Replace apache for nginx

Posted on Tue Apr 17 @ 14:58:47

So today I replaced apache2 with nginx on my slice at slicehost and here is how I've done that.

First of all download nginx form here and unpack it somwere. The installation is a standard source installation. I've done it like this on my Debian Etch slice.



    # ./configure  --with-http_ssl_module 
       --sbin-path=/usr/local/nginx \ 
       --conf-path=/usr/local/nginx/nginx.conf \
       --pid-path=/usr/local/nginx/nginx.pid 
    # make
    # sudo make install


After that I've customized nginx.conf for my needs following this example and I also used this startup script that I also customized. Now all that I needed to do was to copy the nginx startup script into /etc/init.d, make it executable, stop apache and start nginx. 



    # sudo cp /somewhere/nginx /etc/init.d/nginx
    # sudo chmod +x /etc/init.d/nginx
    # sudo update-rc.d nginx defaults
    # sudo update-rc.d -f apache2 remove 
    # sudo invoke-rc.d apache2 stop<br />
    # sudo invoke-rc.d nginx start


And that's it. Hope it helps someone :)
I will still keep apache installed. I might have some use of it somewhere or sometime :)

P.S. The nginx.conf example I am refering to is customized for a rails application using a cluster of two mongrel instances. For other examples please see here.

Posted in Linux, 2 Comments Comments

Comments

 Šime on 18 Apr at 00:31:18

You are aware of http://deb.wapper.ru/nginx/ are you?

 Ivica on 18 Apr at 16:57:00

No, I was not aware of that. Tnx for the information. I must admit I didn't even try to search for a deb package. Still the general idea of the post applies.

COMMENTS ARE DISABLED

About me

Me
Full name: Ivica Munitic Age: 30
Profession: Developer
Email: ivica@munitic.com.hr

Latest articles

Categories

Archive

Feeds

Log in



 

Webfaction