LoginSignup
10
10

More than 5 years have passed since last update.

Nginxで複数サイト運用

Last updated at Posted at 2014-09-04

環境:Ubuntu14.04 nginx 1.4.6 postgress 9.3.5

http://site/でGitlab
http://site:8000/でWordPress
(8080は別サービスMonitorixで利用中)
WordPressはnginxなのでphp-fpmを利用

nginxの設定

/etc/nginx/sites-available/gitlab
/etc/nginx/sites-available/wordpress
を用意してsites-enableにシンボリックリンクを作成する

最初にGitlabをインストールした時の設定で
/etc/nginx/sites-available/default
もsites-enable/にシンボリックリンクしていてハマった。

site-enableにシンボリックリンクはgitlabとwordpressのみで良かった。

ドキュメントの位置指定で最初Aliasを使おうとしてたけど上手く行かず。結果どちらのファイルでもドキュメントの位置はrootで指定しちゃってOK。

wordpressの例
server{
       listen 8000; <<<ここを変える
       root /home/wordpress;<<<ここも変える
       access_log /var/log/nginx/wp_access.log;<<ログも変えておく
       error_log /var/log/nginx/wp_error.log;

       location / {
           index index.php;
       }
        location ~ \.php$ {
           fastcgi_pass unix:/var/run/php5-fpm.sock;
           fastcgi_index index.php;
           fastcgi_split_path_info^/.+\.php(.+)$;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           fastcgi_intercept_errors on;
           include fastcgi_params;
        }


} 

postgresqlでのWordPress設定

あとで書く。

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10