Skip to content

Instantly share code, notes, and snippets.

@otiai10
Last active December 24, 2015 09:49
Show Gist options
  • Save otiai10/6779454 to your computer and use it in GitHub Desktop.
Save otiai10/6779454 to your computer and use it in GitHub Desktop.
VPSをDebian7.1wheezyにしたのでサーバセットアップのログを取っておこうと思ったわけ 2
@otiai10
Copy link
Author

otiai10 commented Oct 8, 2013

apache2のインストールとリバースプロキシ設定

インストール

www15224uf% sudo apt-get install apache2

proxyモジュールを有効にする

http://otiai10.hatenablog.com/entry/2013/02/12/162501

www15224uf% sudo a2enmod proxy
www15224uf% sudo a2enmod proxy_http
www15224uf% sudo a2enmod proxy_connect

httpd.confを編集する

/etc/apache2/conf.d/httpd.confであった。/etc/apache2/httpd.confでうまくいってたのはなぜだ?

<VirtualHost *:80>
    ServerName yourservicename.com
    ServerAdmin [email protected]

    ProxyRequests off
    ProxyPass / http://applicationserver.com:7777/
    <Location />
        ProxyPassReverse http://applicationserver.com:7777/
        ProxyPassReverseCookieDomain localhost yourservicename.com
        ProxyPassReverseCookiePath / /
        Order allow,deny
        # Allow Allでいいのかな?
        Allow from all
    </Location>
</VirtualHost>

apache restart

www15224uf% sudo /etc/init.d/apache2 restart

@otiai10
Copy link
Author

otiai10 commented Jun 19, 2014

ちょっと訂正

ユーザ関係

  1. suでrootに
  2. apt-getでsudoをinstall
  3. visudoも一緒に入ってくるから一般ユーザをsudoerに追加
  4. exitで一般ユーザに戻る

nginx

  1. sudo apt-get install nginx
  2. sudo which nginx (入ってる確認)
  3. exitで一般ユーザに戻る
  4. sudo nginx
  5. なんも記述無いけどデフォルトのドキュメントルートは/usr/share/nginx/index.htmlっぽい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment