系統安裝在 Ubuntu 14.04.5 LTS 程序

系統安裝在 Ubuntu 14.04.5 LTS 程序

從 @ibm1204 採自動升級 新安裝在 @ibm1204 http://xxx.xxx.xxx.36/powebehttp://xxx.xxx.xx.36/webgame

注意, http://xxx.xxx.xx.36/powebe 用的是新程式 2012-07-07 版
新版的稱為 powebe , 有 ./powebe/index.php 檔, 會將位置自動轉移到 ./powebe/www 之下
舊版的稱為 webgame , 直接進入 ./webgame/scm_webgame/www 還原用程式備份 2012-04-10 版
  • 主程式位置放在 /var/www/
上次安裝紀錄可以, 但這次好像不能放在 /home/yinung/
  1. 在 ubuntu 的 LAMPP 安裝好後, 進入 phpmyadmin, 新增一個名為 scm_webgame 的資料庫
記得編輯 php.ini 讓 upload 檔案 size 可以大一點, 可參考 http://yinung2.blogspot.com/2011/03/wordpress.html
  1. mysql 5.7.20 版的新增 user, 比較複雜一點
參見這一篇: http://yinung2.blogspot.tw/2018/01/access-denied-for-user-rootlocalhost.html
簡單地說, 安裝了 mysql-5.7.20 在 mint 18 (ubuntu 16.04) 之後, 想 (依以前的方式) 利用 phpmyadim 來增加資料庫和新 user, 結果: phpmyadmin 無法登入!!!
改用 terminal 指令模式, 輸入, 注意root 預密碼沒有, 直接按 Enter
mysql -u root -p
Enter password:
代表需要先設定 root 的密碼, 仍在 mysql> 的指令模式下, 更新 root 的密碼為, 例如 66666666 :
mysql> UPDATE mysql.user SET authentication_string = PASSWORD('66666666') WHERE User = 'root' AND Host = 'localhost';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

如果看到像以上的回應, 就成功了。打 exit 離開 mysql, 再重新啟動 mysql:

mysqladmin shutdown
service mysql start
回到 phpmyadmin, 應該就可以新增名為 scm_webgame; 其權限為對 scm_webgame 資料庫 的全部
  1. 將 powebe 的主程式上傳至 /var/www/

4.1 編輯其中的 /home/YourName/powebe/scm_webgame/etc/configuration.php

sudo vi /home/YourName/powebe/scm_webgame/etc/configuration.php
檔案、和網址根目錄 (網址根目錄更動好像沒有作用…)

define(‘DIR_FS_HTTP’, ‘/var/www/powebe/’); // 檔案根目錄路徑 define(‘DIR_WS_HTTP’, ‘/powebe/’); // 網址根目錄路徑

舊程式則用這指令,
sudo vi /var/www/webgame/scm_webgame/etc/includes/configuration.php
改 configuration.php 裡面的這幾行
define(‘DIR_FS_HTTP’, ‘/var/www/webgame/scm_webgame/’); // 檔案根目錄路徑
define(‘DIR_WS_HTTP’, ‘/scm_webgame/’); // 網址根目錄路徑
  1. 變更網站實體目錄位置: 修改 /etc/apache2/sites-available/000-default.conf
sudo vi /etc/apache2/sites-available/000-default.conf
網站根目錄原始設成 DocumentRoot /var/www/html
改成安裝 wordpress, 所以在此檔中設定
DocumentRoot /var/www/wordpress
加入以下指令, 即可自訂 /webgame 為虛擬網址

Alias /powebe “/var/www/webgame/scm_webgame/www”
Alias /webgame /home/yinung/powebe/scm_webgame/www

5.1 啟動 000-default.conf 設定檔 用指令檢查

ls /etc/apache2/sites-enabled
如果目錄是空的, 則表示未啟動000-default.conf 設定檔.需要下指令, 或者用 ln -ls 應該也可以
a2ensite

終端機會回應:

Your choices are: 000-default default-ssl
Which site(s) do you want to enable (wildcards ok)?

打 000* 即可。好了可再次下 ls /etc/apache2/sites-enabled 檢查, 應該有如下出現

000-default.conf
  1. 虛擬子目錄是定義在 : /etc/apache2/mods-enabled/alias.conf
sudo vi /etc/apache2/mods-enabled/alias.conf
新增兩行
Alias /webgame "/var/www/webgame/scm_webgame/www"
Alias /powebe "/var/www/powebe"
  1. 重新啟動 apache2
sudo service apache2 restart