https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
(16)
vim /etc/apt/sources.list.d/nginx.list
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx
apt-get update
apt-get install nginx
systemctl enable nginx
systemctl restart nginx
systemctl status nginx
(18)
vim /etc/apt/sources.list.d/nginx.list
deb http://nginx.org/packages/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/ubuntu/ bionic nginx
apt-get update
apt-get install nginx
systemctl enable nginx
systemctl restart nginx
systemctl status nginx
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
(9)
vim /etc/apt/sources.list
deb http://nginx.org/packages/debian/ stretch nginx
deb-src http://nginx.org/packages/debian/ stretch nginx
apt-get update
apt-get install nginx
systemctl enable nginx
systemctl restart nginx
systemctl status nginx
(7)
vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
yum info nginx
yum install nginx
systemctl enable nginx
systemctl restart nginx
systemctl status nginx
- Windows Server
(2012R2)
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
https://qiita.com/sugasaki/items/83542f5614bc54a9475f
https://qiita.com/mas0061/items/877f4bdd1856093492ae
--インストール
公式Windows版バイナリをダウンロードし展開
nginx.exeのあるフォルダに移動
start nginx
※起動しない場合はログを確認し、ポートが使用されている場合はポートを変更
C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\logs
error.log
C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\conf
nginx.conf
listen 80;
↓
listen 8080;
--接続確認
http://localhost:8080
--サービス化
.NET Framework 3.5を「役割と機能の追加」からインストール
nginx -s stop
winsw-2.3.0-bin.exeをダウンロードし
nginx.exeのあるフォルダに配置
設定ファイル作成
C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1
winsw-2.3.0-bin.xml
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<logpath>C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\logs</logpath>
<logmode>roll</logmode>
<depend></depend>
<executable>C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\nginx.exe</executable>
<startargument></startargument>
<stopexecutable>C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\nginx.exe</stopexecutable>
<stopargument>-s</stopargument>
<stopargument>stop</stopargument>
</service>
C:\Users\Administrator\Downloads\nginx-1.16.1\nginx-1.16.1\winsw-2.3.0-bin.exe install