How to install nginx as a service on Windows Server 2012


Install nginx

Download the latest stable version from http://nginx.org/en/download.html

Extract the zip file to c:\nginx (or your preferred installation path)

Check nginx installation

Command: C:\nginx\nginx.exe

Go to http://localhost, you should see a welcome to nginx page.

Stop nginx

C:\nginx\nginx.exe –s stop

Install .net 3.5

Follow the instructions at http://www.danielclasson.com/install-net-framework-35-server-2012/

Install winsw

[list_icon color=”blue” type=”icon_arrow”]

[/list_icon]

Create a XML file mynginx.xml

<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<executable>c:\nginx\nginx.exe</executable>
<logpath>c:\nginx\</logpath>
<logmode>roll</logmode>
<depend></depend>
<startargument>-p c:\nginx</startargument>
<stopargument>-p c:\nginx -s stop</stopargument>
</service>

Install nginx service

C:\nginx.exe\mynginx.exe install

Manage service

Open PowerShell and type in service.msc

You should see the nginx service in the list, now you can manage nginx like any other windows service. Your install nginx is complete.

install nginx


BY: SOFTWARE DEVELOPER AT INFOWARE STUDIOS


Enhanced by Zemanta

Interesting Infoware Studios Bookmarks

0
  Related Posts
  • No related posts found.