nginx(Ubuntu) †nginxはオープンソースのWebサーバーである。 ダウンロード †Linux用のアーカイブをGlassFish Server Open Source Edition 4.0 Downloadからダウンロードする。 インストール †Ctrl+Alt+Tで端末を起動する。 sudo apt-get install nginx
sudo gedit /etc/nginx/nginx.conf sudo gedit /etc/nginx/sites-available/default sudo /etc/init.d/nginx restart /etc/nginx/nginx.confの設定を行う。 http { ## # Basic Settings ## upstream web { #AP1 server AP1.local:28080 weight=1 max_fails=1 fail_timeout=10; #AP2 server AP2.local:28080 weight=1 max_fails=1 fail_timeout=10; #sticky cookie; } (以下変更なしのため省略) /etc/nginx/sites-available/defaultの設定を行う。 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules proxy_pass http://web; } (以下変更なしのため省略) nginxの起動と終了は下記のコマンドで行う。PCの起動時には自動的に起動される。 sudo /etc/init.d/nginx start sudo /etc/init.d/nginx stop
cat /var/log/nginx/error.log コメント † |