LoginSignup
2
0

More than 3 years have passed since last update.

virtualbox(centos)でnginx+phpの環境を作る

Posted at

内容

タイトル通り。今更apacheとかだせーよって人のために。

下ごしらえ

公式手順書
http://nginx.org/en/linux_packages.html#stable

epalも使うかもしれないからいれておく
sudo yum install epel-release

nginxは標準のリポジトリに追加されているのでリポジトリをアップデートする。
sudo yum update

nginx php php-fpmのインストール

yum install nginx
yum install php5
yum install php5-fpm

nginx

nginxを起動
sudo systemctl start nginx

ステータスを確認
sudo systemctl status nginx

エラーログの在り処
/var/log/nginx/error.log

通信の設定

php-fpm側

/etc/php5/fpm/pool.d/www.conf
+ listen = 127.0.0.1:9000

nginx側

/etc/nginx/nginx.conf
fastcgi_pass 127.0.0.1:9000;

php-fpmを再起動させる
sudo service php-fpm restart

nginxも
sudo nginx -s reload

参考にさせていただいたサイト

https://qiita.com/jshimazu/items/01f6abc2c3f3e1667d45
http://zemuriya.hatenablog.com/entry/2015/08/02/131133

2
0
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
2
0