SSDB圖形界面管理工具:phpssdbadmin安裝部署


環境: 14.04.1-Ubuntu

1、安裝Nginx

apt-get install nginx

ubantu安裝完Nginx后,文件結構大致為:

  所有的配置文件都在 /etc/nginx下;

  啟動程序文件在 /usr/sbin/nginx下;

  日志文件在 /var/log/nginx/下,分別是access.log和error.log;

  並且在 /etc/init.d下創建了nginx啟動腳本

安裝完成后可以嘗試啟動nginx:

/etc/init.d/nginx start

然后能通過瀏覽器訪問到 http://localhost/, 一切正常,如不能訪問請檢查原因。

2、安裝PHP 和php-fpm

sudo apt-get install php5-fpm
sudo apt-get install php5-gd  # Popular image manipulation library; used extensively by Wordpress and it's plugins.
sudo apt-get install php5-cli   # Makes the php5 command available to the terminal for php5 scripting
sudo apt-get install php5-curl    # Allows curl (file downloading tool) to be called from PHP5
sudo apt-get install php5-mcrypt   # Provides encryption algorithms to PHP scripts
sudo apt-get install php5-mysql   # Allows PHP5 scripts to talk to a MySQL Database 
sudo apt-get install php5-readline  # Allows PHP5 scripts to use the readline function

查看php5運行進程:

ps -waux | grep php5

啟動關閉php5進程

sudo service php5-fpm stop
sudo service php5-fpm start
sudo service php5-fpm restart
sudo service php5-fpm status

3、配置php和nginx

nginx的配置文件 /etc/nginx/nginx.conf中include了/etc/nginx/sites-enabled/*,因此可以去修改/etc/nginx/sites-enabled下的配置文件

vi /etc/nginx/sites-available/default

做如下修改:

location ~ \.php$ {
        #       fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                # With php5-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
                # With php5-fpm:
        #       try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

還需要在/etc/nginx/fastcgi_params添加如下兩句:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;

然后reload Nginx:

sudo service nginx reload

4、驗證php是否配置成功

新建phpinfo.php文件:

sudo vim /usr/share/nginx/html/phpinfo.php

內容如下:

<?php phpinfo(); ?>

然后通過瀏覽器訪問:http://localhost/phpinfo.php
能夠看到php的詳細信息則說明配置成功。
php配置成功

5、下載phpssdbadmin

下載phpssdbadmin到/usr/share/nginx/html目錄下:

cd /usr/share/nginx/html
git clone https://github.com/ssdb/phpssdbadmin.git

5、配置phpssdbadmin

修改phpssdbadmin的配置,修改app/config/config.php,將host和port改為ssdb配置的值:

'ssdb' => array(  
    'host' => '127.0.0.1',  
    'port' => '8888',  
),  
# 如果使用新版的phpssdbadmin,還需要修改用戶名和密碼,因為原始密碼太簡單不允許登錄:
'login' => array(
                'name' => 'jinghao',
                'password' => 'jinghao123', // at least 6 characters
        ),

修改nginx的配置文件:

vim /etc/nginx/sites-enabled/default

添加:

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

重啟nginx,然后訪問http://localhost/phpssdbadmin ,出現登錄頁面則配置成功。

登陸頁面
詳情界面

最后, 如果認為配置麻煩的同學,可以試試這個: https://github.com/jhao104/SSDBAdmin


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM