Nginx missing commands

Nginx-Logo-02

All of us living in the debian based world (ubuntu) have grown accustomed to a2ensite/a2dissite/etc scripts that come with apache to help manage your vhosts. Nginx was sadly left out of these cool commands so I’ve decided to add them here.

You can run this script and it will add these beloved commands as “n2ensite” and “n2dissite”

wget http://www.hax.nu/files/n2ensite -O /usr/bin/n2ensite
chmod 755 /usr/bin/n2ensite
ln -s /usr/bin/n2ensite /usr/bin/n2dissite

Then on debian/ubuntu based systems install the bash autocomplete:

wget http://www.hax.nu/files/nginx-autocomplete \
-O /etc/bash_completion.d/nginx
. /etc/bash_completion

Test your new commands:

n2ensite <tab>
n2dissite

Goodluck! Feel free to leave a comment below with feedback and corrections. Also if you found this helpful and would like occasional updates of things happening in this arena subscribe to the newsletter. Thanks!

No Comments Yet

Leave a Reply

Your email address will not be published. Required fields are marked *