Nginx をインストールし Apache サーバのコンテンツを表示させてみようと思った。 
だいぶ前から Nginx に興味を持っていたが、昨日のこと下北沢の OpenSource Cafe で開かれた東京コンクリート・ファイ部の「 爆速!concrete5超高速環境を構築しよう」 の話の中に Nginx が出てきたので、改めて作業をしてみようと思ったのである。 
Nginx のインストールは homebrew を使って次のように行った。
$brew tap homebrew/dupes 
Warning: Already tapped! 
$brew tap homebrew/versions 
Warning: Already tapped! 
$brew tap homebrew/homebrew-php 
Warning: Already tapped! 
$brew install nginx 
==> Installing nginx dependency: pcre 
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.37.yos...
######### 100.0% 
==> Pouring pcre-8.37.yosemite.bottle.tar.gz 
/usr/local/Cellar/pcre/8.37: 146 files, 5.9M 
==> Installing nginx 
==> Downloading https://homebrew.bintray.com/bottles/nginx-1.8.0.y...
######### 100.0% 
==> Pouring nginx-1.8.0.yosemite.bottle.tar.gz 
==> Caveats 
Docroot is: /usr/local/var/www 
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that 
nginx can run without sudo. 
nginx will load all files in /usr/local/etc/nginx/servers/. 
To have launchd start nginx at login: 
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents 
Then to load nginx now: 
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist 
Or, if you don't want/need launchctl, you can just run: 
nginx 
==> Summary 
/usr/local/Cellar/nginx/1.8.0: 7 files, 964K 
Nginx の設定を行い起動させると忽ちエラーの嵐となりその対策に幾日もかかることとなった。 
ようやく Nginx が起動していることを確認できたのは 2015.08.06(木)であった。 
$sudo nginx 
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) 
nginx: [emerg] still could not bind() 
$sudo lsof -i :80 
COMMAND PID USER FD TYPE  DEVICE SIZE/OFF NODE NAME 
nginx1300 root 6u IPv4 0x45bcdca151b2ad05 0t0 TCP *:http (LISTEN) 
nginx1301 nobody 6u IPv4 0x45bcdca151b2ad05 0t0 TCP *:http (LISTEN) 
しかし、Nginx で Apache サーバのコンテンツを表示させてることは未だ出来ていない。
 
0 件のコメント:
コメントを投稿