0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows10でNginxをインストール

Posted at

環境

Windows10
nginx-1.23.4

インストールとサービス化

・任意の場所に解凍したnginx-1.23.4内にあるnginx.exeをダブルクリックで起動
http://localhost/にアクセスしてアクセスできればインストール完了

・下記のサイトにてwinsw-2.9.0-bin.exeをダウンロード
 https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/
・nginx-1.23.4フォルダ内にwinsw-2.9.0-nginxsvc.exeとリネームして保存
・nginx-1.23.4フォルダ内winsw-2.9.0-nginxsvc.xmlを新規作成

<service>
  <id>nginx</id>
  <name>nginx</name>
  <description>nginx</description>
  <logpath>c:\nginx\logs</logpath>(任意変更)
  <logmode>roll</logmode>
  <depend></depend>
  <executable>c:\nginx\nginx.exe</executable>(任意変更)
  <startargument></startargument>
  <stopexecutable>c:\nginx\nginx.exe</stopexecutable>(任意変更)
  <stopargument>-s</stopargument>
  <stopargument>stop</stopargument>
</service>

・管理者権限CMDで下記コマンド

C:\nginx>winsw-2.1.2-nginxsvc.exe install

・INFO - Installing the service with id 'nginx'と出ればサービス化完了
・サービスから削除するときは下記のコマンド

C:\nginx\winsw-2.1.2-nginxsvc.exe uninstall

参考にさせて頂いたサイト

https://qiita.com/sugasaki/items/83542f5614bc54a9475f
https://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/
http://nginx.org/en/docs/windows.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?