在 Nginx + PHP-uWSGI + Percona Server 环境下安装 PKP Open Conference Systems

Update 2016-02-12:修复了Nginx下PATH_INFO 兼容设置带来的伪静态URL无法使用问题。

服务器配置

  • Ubuntu 14.04.3 LTS (GNU/Linux 3.16.0-60-generic x86_64)
  • Nginx 1.9.11
  • PHP 5.5.9-1ubuntu4.14
  • Percona Server 5.6.28-76.1

安装流程

Nginx配置文件/etc/nginx/conf.d/ocs.conf :

server {
    listen       80;
    listen       [::]:80;
    server_name  ocs.example.com;

    root   /usr/share/nginx/ocs;

    location / {
        index  index.php;
        try_files $uri $uri/ /index.php?$args;
    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # pass the PHP scripts to uWSGI server
    # See: https://blog.phoenixlzx.com/2015/12/21/migrating-to-uwsgi/
    #
    location ~ \.php {
        include uwsgi_params;
        uwsgi_modifier1 14;
        uwsgi_pass unix:/var/run/uwsgi-php.sock;
    }
}

建立数据库和相应用户:

-- mysql -u root -p
CREATE DATABASE ocs DEFAULT CHARACTER SET utf8;
CREATE USER 'ocsuser'@'localhost' IDENTIFIED BY 'your-great-unhackable-password';
GRANT ALL ON ocs.* TO 'ocsuser'@'localhost' ;
FLUSH PRIVILEGES;
QUIT;

建立文件存储目录:

sudo mkdir /usr/share/nginx/ocs/files
sudo chown -R www-data:www-data /usr/share/nginx/ocs/files

然后访问网站根目录完成安装流程。

参考资料

在 Nginx + PHP-uWSGI + Percona Server 环境下安装 PKP Open Conference Systems》上有2条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据