Linux+XAMPP+eolinker開源版v3.2.4
阿新 • • 發佈:2019-01-11
eolinker 是一個由國人開源的介面管理系統(AMS),特性及介紹詳見開源中國-eolinker首頁.
搭建步驟參考:eolinker開源指南
系統環境:CentOS Linux release 7.3.1611 x86_64 GNU/Linux
工具準備
eolinker開源版(碼雲):
git clone https://gitee.com/eoLinker-API-Management/eoLinker-OS_3.X-CHN.git
xampp
選擇XAMPP for Linux(7.2.1 / PHP 7.2.1)
下載完成後是一個.run檔案。
安裝XAMPP
- 將下載完成的xampp和eolinker.zip上傳到伺服器;
- 給xampp安裝包賦予可執行的許可權;
chmod 777 xampp-linux-x64-7.2.1-0-installer.run
- 執行
./chmod 777 xampp-linux-x64-7.2.1-0-installer.run
進行安裝操作,安裝過程遇到確認的地方都選擇Y;
配置lampp全域性可見:cp /opt/lampp/lampp /usr/bin/lampp
配置xampp-mysql全域性可見:sudo ln -s /opt/lampp/bin/mysql /usr/bin
4. 啟動XAMPP
#啟動
lampp start 或 /opt/lampp/lampp satrt
#關閉
lampp stop
#重啟
lampp restart
#解除安裝
rm -rf /opt/lampp/
- 訪問測試
- 在瀏覽器中輸入伺服器IP地址後回車,可以檢視XAMPP首頁;
- 伺服器新建php檔案:
vi /opt/lampp/htdocs/phpinfo.php
,輸入以下程式碼後,:wq
儲存;
- 在瀏覽器中輸入伺服器IP地址後回車,可以檢視XAMPP首頁;
<?
phpinfo();
?>
瀏覽器地址中輸入:伺服器IP/phpinfo.php,正常情況下,會顯示以下頁面:
在頁面上搜索,可以發現,php預設已經安裝並啟用了mbstring,curl,pdo拓展,eolinker依賴這些模組;
- 設定mysql允許外部連線
xampp安裝的mysql root使用者預設是沒有密碼的,首先進入mysql:
#這裡沒有密碼,直接回車
[[email protected]] /opt/lampp/bin/mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.30-MariaDB Source distribution
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> set password =password('your passwd');
Query OK, 0 rows affected (0.00 sec)
#設定完成後,還需要給root使用者開放許可權:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your passwd' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> \q;
Bye
還需要修改phpmyadmin的配置檔案:vi /opt/lampp/phpmyadmin/config.inc.php
將$cfg['Servers'][$i]['password'] = '';
設定成剛才修改的root密碼,儲存後關閉,重啟xampp:lampp restart
- 訪問phpMyAdmin
在瀏覽器中輸入:伺服器IP/phpmyadmin/, 可能會出現Access forbidden,按照提示資訊修改配置檔案httpd-xampp.conf:
vi /opt/lampp/etc/extra/httpd-xampp.conf
在第21行加上一句Require all granted
,然後重啟xammp服務:lampp restart
, 就可以實現遠端訪問了。
phpMyAdmin頁面如下:
部署eolinker
- 在
/opt/lampp/htdocs/
目錄下新建目錄:mkdir eolinker
,將eolinker壓縮包移動到此目錄下,然後解壓:unzip eolinker_os_3.2.4.zip
- 專案目錄需要具有完全的讀寫許可權(777),用於寫入配置檔案。
chmod -R 777 /opt/lampp/htdocs/eolinker/
- 新建一個數據庫,用於儲存專案資料。可以通過phpMyAdmin新建,也可以通過命令列新建;
下面是通過命令列建立:
$ /opt/lampp/bin/mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 128
Server version: 10.1.30-MariaDB Source distribution
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database eolinker_os;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| eolinker_os |
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
6 rows in set (0.00 sec)
MariaDB [(none)]> \q;
Bye
- 瀏覽器訪問專案:伺服器IP/eolinker/,出現以下引導頁面:
根據指引頁面提示,輸入相應資料庫資訊並通過環境監測後,即可安裝成功。