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

nginx automated installer

Discussion in 'Workarounds and Optimization' started by blargman, Feb 17, 2010.

Thread Status:
Not open for further replies.
  1. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    Evidently I don't know hot to post in the right forum.

    This is an automated nginx installer for cpanel. Integrates so that domain adding/removal is all done automatically.
    Some people had asked for cpanel support. In lieu of that, this does pretty much everything I can think of that they would do. It creates a vhost for each domain/addon/subdomain and serves up static content.

    Let me know if you have any thoughts/questions or better yet suggestions.

    Updated
    http://blargman.com/public.tar (nginx-0.7.67)
    http://blargman.com/publicnginxv8.tar (nginx-0.8.41)
     
    #1 blargman, Feb 17, 2010
    Last edited: Jun 19, 2010
  2. xanubi

    xanubi Member

    Joined:
    Jun 28, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Anyone have tried this?
     
  3. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    Did you have a question on it?
     
  4. erikg

    erikg New Member

    Joined:
    Jul 14, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    This script works wonderfully even for people who don't know how to properly use NGINX. Thanks Blargman you saved my day! :D
     
  5. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    hah, full disclosure, I should say I work with Erikg :p , but thanks Erik.
     
  6. xanubi

    xanubi Member

    Joined:
    Jun 28, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I would like to know if i install this on a production server that have 20 configured domains, each one with subdomains and domain addons, will the install create the correct configuration for that existing vhosts?
     
  7. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    That is correct xanubi. It pulls all of the domains/subdomains from the machine via the cpanel userdata files as well as the Cpanel XML API.
     
  8. bhanuprasad1981

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    i have got nginx installed by some other guys before , if i use this will it update old ? what version of nginx this installs stable or developer ?
     
  9. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    It currently installs the latest stable 0.7.65. If you install it, it would overwrite your nginx.conf with it's own so it would upgrade it in a sense. Though I would suggest making a backup of your config. Running ./nginxinstaller uninstall and then running ./nginxinstaller install. Just to be sure any of your old config was not still lingering.

    Do you have old configuration data that you wish to keep?
     
  10. texo

    texo Member

    Joined:
    Mar 28, 2007
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    blargman, thank you very much for this. I've gone through your readme, but could you --please -- post a step-by-step for those of us who don't quite know where to start with the files we've downloaded from you?
     
  11. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    Hey Texo, usage is just install and uninstall as far as the nginxinstaller script goes.

    cd /usr/local/src
    wget blargman.com/public.tar
    tar xf public.tar
    cd publicnginx
    ./nginxinstaller install


    Let me know if there is something else or if you have any questions
     
  12. texo

    texo Member

    Joined:
    Mar 28, 2007
    Messages:
    143
    Likes Received:
    0
    Trophy Points:
    16
    Awesome, thank you. Two more questions, please:

    does this replace apache or work in tandem, serving static files and passing everything else on to apache

    would you be offering support for $$$/hour? :)
     
  13. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    I plan on shortly adding fcgi support to complete replace apache. Currently it serves up static content and passes php to Apache.

    I'm willing to help you with whatever you may need with it.
     
  14. xanubi

    xanubi Member

    Joined:
    Jun 28, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I would like to give some sugestions, based on what i see after install and production.

    ======================
    1) createvhosts.py
    ======================
    Add more file types, like this:
    location ~* \.(gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|htm|html|txt|js|css|exe|zip|rar|gz|tgz|uha|7z|doc|docx|xls|xlsx|pdf)$ {

    ======================
    2) STATUSURL="http://localhost/whm-server-status"
    ======================
    On files:
    /usr/local/apache/bin/apachectl
    /etc/rc.d/init.d/httpd

    Change the line:
    STATUSURL="http://localhost/whm-server-status"
    To:
    STATUSURL="http://localhost:8081/whm-server-status"

    ======================
    3) Service and Chkcfg
    ======================
    Edit file /etc/chkserv.d/chkservd.conf and add nginx:1

    Add a file named nginx to /etc/chkserv.d/ and inside put this:
    service[nginx]=x,x,x,service nginx restart,nginx,root


    :::::::::::::::::::::::::::::::::::::::::::::::::::::

    That's it. With this settings, the "apache status" option of cpanel will work again, and the nginx service will be monitored and you can choose it from cpanel option "service manager". I hope this helps.
     
  15. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    No problem. I added these for you.
     
  16. nixell

    nixell New Member

    Joined:
    Sep 24, 2007
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    i will testing it :) thanks
     
  17. 9xlinux

    9xlinux Member

    Joined:
    Dec 20, 2009
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    How nginx can be uninstall and switch back to apache in case of any issue??
     
  18. blargman

    blargman Member

    Joined:
    Sep 11, 2007
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    ./nginxinstaller uninstall

    This will remove it completely and set you back to Apache only.
     
  19. 9xlinux

    9xlinux Member

    Joined:
    Dec 20, 2009
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    /etc/init.d/nginx restart
    Restarting nginx daemon: nginx[warn]: duplicate MIME type "text/html" in /etc/nginx/nginx.conf:22
    What I need to do?
     
    #19 9xlinux, Feb 23, 2010
    Last edited: Feb 23, 2010
  20. xanubi

    xanubi Member

    Joined:
    Jun 28, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    I had that problem. Edit the /etc/nginx/nginx.conf and remove the word text/html. Don't worry, nginx will serve html files the same way.
     
Thread Status:
Not open for further replies.

Share This Page