サーバーmacインストールinx環境
この間、プロキシに接触しました。模索の下でinx環境を構築しました。これからmacにnginx環境をインストールする基本的な手順を紹介します。ここでは、ホームbrewを利用してnginxをインストールし、まず端末を開けてインストールコマンドライン ホームビューをダウンロードすると、自動的にhomebrewをインストールし、brewボタンでnginx をインストールします。インストール後、nginxが正常に動作するかどうかをテストします。 ヒント権限が足りない場合、ファイルを開く権限が必要です。 nginxが正常に動作した後、nginxのプロファイル を変更します。プロファイルの変更が完了し、inx を起動します。 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
は削除した後、インストールコマンドラインを入力します。brew install 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
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;
}
sudo nginx