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;
image.png
配置lampp全局可见:cp /opt/lampp/lampp /usr/bin/lampp
配置xampp-mysql全局可见:sudo ln -s /opt/lampp/bin/mysql /usr/bin
- 启动XAMPP
#启动
lampp start 或 /opt/lampp/lampp satrt
#关闭
lampp stop
#重启
lampp restart
#卸载
rm -rf /opt/lampp/
![img_df07c01f708a2133bfca5d6ac581b548.png](https://yqfile.alicdn.com/img_df07c01f708a2133bfca5d6ac581b548.png?x-oss-process=image/resize,w_1400/format,webp)
- 访问测试
-
在浏览器中输入服务器IP地址后回车,可以查看XAMPP首页;
dashboard - 服务器新建php文件:
vi /opt/lampp/htdocs/phpinfo.php
,输入以下代码后,:wq
保存;
<?
phpinfo();
?>
浏览器地址中输入:服务器IP/phpinfo.php,正常情况下,会显示以下页面:
![img_6150122b4f0f26b7a1fee0d1b3c5924c.png](https://yqfile.alicdn.com/img_6150122b4f0f26b7a1fee0d1b3c5924c.png?x-oss-process=image/resize,w_1400/format,webp)
在页面上搜索,可以发现,php默认已经安装并启用了mbstring,curl,pdo拓展,eolinker依赖这些模块;
- 设置mysql允许外部连接
xampp安装的mysql root用户默认是没有密码的,首先进入mysql:
#这里没有密码,直接回车
[root@rethink] /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
![img_310c7eb32e3b2430098b7c6b96baa256.png](https://yqfile.alicdn.com/img_310c7eb32e3b2430098b7c6b96baa256.png?x-oss-process=image/resize,w_1400/format,webp)
将$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页面如下:
![img_9b07a54b6ef2923db16f4e64700324da.png](https://yqfile.alicdn.com/img_9b07a54b6ef2923db16f4e64700324da.png?x-oss-process=image/resize,w_1400/format,webp)
部署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/,出现以下引导页面:
根据指引页面提示,输入相应数据库信息并通过环境监测后,即可安装成功。
![img_3e4651ceea7f9f1a91dfdb1e4f851d6a.png](https://yqfile.alicdn.com/img_3e4651ceea7f9f1a91dfdb1e4f851d6a.png?x-oss-process=image/resize,w_1400/format,webp)
![img_49e9a8381280358c70964bf9c52fb8ab.png](https://yqfile.alicdn.com/img_49e9a8381280358c70964bf9c52fb8ab.png?x-oss-process=image/resize,w_1400/format,webp)
![img_376207ac78d6edbf58e092d08254c09f.png](https://yqfile.alicdn.com/img_376207ac78d6edbf58e092d08254c09f.png?x-oss-process=image/resize,w_1400/format,webp)
![img_e16a1f6f3b8b11bfa253d35e4156fa31.png](https://yqfile.alicdn.com/img_e16a1f6f3b8b11bfa253d35e4156fa31.png?x-oss-process=image/resize,w_1400/format,webp)