1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

nginx on Ubuntu

Discussion in 'Server Configuration and Hosting' started by Colin Arenburg, Mar 6, 2012.

  1. Colin Arenburg

    Colin Arenburg New Member

    Hey there,

    I would like to move from Apache to Ningx on ubuntu, and after searching google i have not found any helpfully tutorials.

  2. lolmaster

    lolmaster Member

    I think no tutorial for it. It only you uself must:

    1. remove apache
    2. install nginx
    3. write NGINX config for you sites domains. - only uself (for it many TUT how to made NGINX config)

    try to use it script - http://www.btcentral.org.uk/projects/centmin/ not shure if it work for Ubuntu but for CentOS work as me. It script install all that need instead of you
  3. Solidus

    Solidus Well-Known Member

    I suggest using nginx only for static content. Images, css, javascript.
    There's only a small portion of nginx conf you need to edit, like so,

    server {
            listen      8090;
            listen sitename.com:8090;
            server_name  sitename.com;
            access_log  /var/log/nginx/sitename.com.access.log  main;
            location / {
               root  /var/www/sitename.com/public_html;
               index  index.php index.html index.htm;
    (assuming you chose to use port 8090)
    Then you replace static content url's like so,
    Just my suggestion.
  4. Floren

    Floren Well-Known Member

    Just curious, why only static content? Nginx performs a zillion times better compared to Apache, for PHP requests. And that with the cache disabled.
  5. shawn

    shawn Well-Known Member

    I'm pretty much fed up with PHP-FPM.

    I finally got my uploading bug fixed, only to find out that the fix breaks XF's multi-file uploader. That and the account/avatar bug that I can't figure out... just went back to nginx/Apache. The memory footprint for php-fpm is basically the same as my stripped apache. The page loads "feel" faster with PHP-FPM, but I think it's just because everything sort of organically appears, where apache waits a beat, then everything appears mostly all at once. Not sure that one is genuinely faster than the other, though.

    I wouldn't remove Apache first (or at all) if you're installing nginx. If you have multiple external IP addresses, you can set apache to listen both on one external IP and on localhost:80, then set up nginx on another external IP with the reverse proxy stuff to apache (or php-fpm if you prefer). Once you're sure it's all working correctly, change your DNS record to point to the nginx IP address, wait a few days for everyone's records to update, then disable the external IP for apache (so it only listens on

    Doesn't the nginx repo have ubuntu packages? Could always give that a try rather than compiling your own. I switched to their repo (but for RHEL/CentOS) a few months ago.
  6. Adam Howard

    Adam Howard Well-Known Member

    Debian repository directly from Nginx

    This is one of the few areas where Debian actually is released before Ubuntu

    deb http://nginx.org/packages/debian/ squeeze nginx
    deb-src http://nginx.org/packages/debian/ squeeze nginx
  7. Adam Howard

    Adam Howard Well-Known Member

Share This Page