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

環境: 14.04.1-Ubuntuphp

一、安裝Nginx

  1. apt-get install nginx

ubantu安裝完Nginx後,文件結構大體爲:html

全部的配置文件都在 /etc/nginx下 ;mysql

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

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

而且在  /etc/init.d下建立了啓動腳本nginxgithub

安裝完成後能夠嘗試啓動nginx:sql

 
  1. /etc/init.d/nginx start

而後能經過瀏覽器訪問到 http://localhost/, 一切正常,如不能訪問請檢查緣由。ubuntu

 

二、安裝PHP 和php

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

查看php5運行進程:vim

 
 
  1. ps -waux | grep php5

打開關閉php5進程瀏覽器

 
 
  1. sudo service php5-fpm stop
  2. sudo service php5-fpm start
  3. sudo service php5-fpm restart
  4. sudo service php5-fpm status

 

三、配置php和nginx

nginx的配置文件 /etc/nginx/nginx.conf中include了/etc/nginx/sites-enabled/*,所以能夠去修改/etc/nginx/sites-enabled下的配置文件

vi /etc/nginx/sites-available/default

作以下修改:

 
  1. location ~ \.php$ {
  2. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  3. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  4.  
  5. # With php5-cgi alone:
  6. # fastcgi_pass 127.0.0.1:9000;
  7. # With php5-fpm:
  8. # try_files $uri =404;
  9. fastcgi_pass unix:/var/run/php5-fpm.sock;
  10. fastcgi_index index.php;
  11. include fastcgi_params;
  12.  
  13. }

還須要在/etc/nginx/fastcgi_params添加以下兩句:

 
  1. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  2. fastcgi_param PATH_INFO $fastcgi_script_name;

而後reload Nginx:

 
  1. sudo service nginx reload

四、驗證php是否配置成功

新建phpinfo.php文件:

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

內容以下:

 
  1. <?php phpinfo(); ?>

而後經過瀏覽器訪問: http://localhost/phpinfo.php 

可以看到php的詳細信息則說明配置成功。

五、下載phpssdbadmin

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

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

 

五、配置phpssdbadmin

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

 
  1. 'ssdb' => array(
  2. 'host' => '127.0.0.1',
  3. 'port' => '8888',
  4. ),

若是使用新版的phpssdbadmin,還須要修改用戶名和密碼,由於原始密碼太簡單不容許登陸:

 
  1. 'login' => array(
  2. 'name' => 'jinghao',
  3. 'password' => 'jinghao123', // at least 6 characters
  4. ),

 

修改nginx的配置文件:

 
  1. vim /etc/nginx/sites-enabled/default

添加:

 
  1. location /phpssdbadmin {
  2. try_files $uri $uri/ /phpssdbadmin/index.php?$args;
  3. index index.php;
  4. }

而後訪問 http://localhost/phpssdbadmin ,出現登陸頁面則配置成功。

 

 

 

參考:

http://blog.csdn.net/skyie53101517/article/details/46053767

http://blog.csdn.net/cool_sti/article/details/41517991

http://ubuntuhandbook.org/index.php/2013/10/install-nginx-php5-mysql-lemp-ubuntu-1310/

https://github.com/ssdb/phpssdbadmin 

 

 

轉載請註明來源:http://my.oschina.net/jhao104/blog/711052  

相關文章
相關標籤/搜索