サーバーmacインストールinx環境


この間、プロキシに接触しました。模索の下でinx環境を構築しました。これからmacにnginx環境をインストールする基本的な手順を紹介します。
  • ここでは、ホームbrewを利用してnginxをインストールし、まず端末を開けてインストールコマンドライン
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    を入力してホームbrewをインストールする。公式サイト:http://brew.sh/ 。 以下のヒントがあるならば、macがnginxをインストールしたか、または前回のnginxのインストールに失敗して残りの
    It appears Homebrew is already installed. If your intent is to reinstall you
    should do the following before running this installer again:
        rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
    を残しました。ヒントに従って削除コマンドラインを入力します。
    rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
    は削除した後、インストールコマンドラインを入力します。
  • ホームビューをダウンロードすると、自動的にhomebrewをインストールし、brewボタンでnginx
    brew install nginx
  • をインストールします。
  • インストール後、nginxが正常に動作するかどうかをテストします。
    nginx -t
        :nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
             nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
  • ヒント権限が足りない場合、ファイルを開く権限が必要です。
    chmod 777 file
    file            
  • nginxが正常に動作した後、nginxのプロファイル
    vim /usr/local/etc/nginx/nginx.conf
    server {
            listen       9999(      );
            server_name  localhost;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
            location / {
                root   /Users/loki/Desktop/web/(           );
                index  index.html index.htm;
            }
  • を変更します。
  • プロファイルの変更が完了し、inx
    sudo nginx
  • を起動します。
  • nginxの基本的な使い方