centos7:搭建ShowDoc

1、nginx
    yum install -y epel-release
    yum install -y nginx
    cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
#修改nginx配置文件
    vim /etc/nginx/nginx.conf
        38     server {
        39         listen       80 default_server;
        40         listen       [::]:80 default_server;
        41         server_name  _;
        42         root         /var/www/html;
        43         index        index.php index.html;
        44 
        45         # Load configuration files for the default server block.
        46         include /etc/nginx/default.d/*.conf;
        47 
        48         location / {
        49         }
        50 
        51         error_page 404 /404.html;
        52             location = /40x.html {
        53         }
        54 
        55         error_page 500 502 503 504 /50x.html;
        56             location = /50x.html {
        57         }
        58         location ~ .php$ {
        59             root            /var/www/html;
        60             fastcgi_pass    127.0.0.1:9000;
        61             fastcgi_index   index.php;
        62             fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        63             include         fastcgi_params;
        64         }
        65         location ~ /.ht {
        66             deny all;
        67         }
        68     }
    systemctl start nginx
    systemctl enable nginx

2、PHP
    yum install -y php php-gd php-fpm php-mcrypt php-mbstring php-mysql php-pdo
    systemctl start php-fpm
    systemctl enable php-fpm
#下载安装PHP的依赖管理工具,Composer
    curl -sS https://getcomposer.org/installer | php
    cp composer.phar /usr/local/bin/composer
    composer config -g repo.packagist composer https://packagist.phpcomposer.com
    cd /var/www/html
    composer create-project showdoc/showdoc
    chmod a+w showdoc/install
    chmod a+w showdoc/Sqlite
    chmod a+w showdoc/Sqlite/showdoc.db.php 
    chmod a+w showdoc/Public/Uploads/
    chmod a+w showdoc/Application/Runtime/
    chmod a+w showdoc/server/Application/Runtime
    chmod a+w showdoc/Application/Common/Conf/config.php 
    chmod a+w showdoc/Application/Home/Conf/config.php 

3、访问
    http://host-ip/showdoc/install

    

    

    

4、禁止注册
    cp /var/www/html/showdoc/server/Application/Api/Controller/UserController.class.php{,.bak}
    vim /var/www/html/showdoc/server/Application/Api/Controller/UserController.class.php
        7     //注册
        8     public function register(){
        9         $this->sendError(10101,'no register');
        10       return;

猜你喜欢

转载自blog.csdn.net/qq_34889607/article/details/81359600