如何在 Ubuntu 20.04 LTS 上安装 EPrints

在本教程中,我们将向您展示如何在 Ubuntu 20.04 LTS 上安装 EPrints。 对于那些不知道的人,EPrints 是一个免费的开源文档管理系统软件,通常作为大学存储库实现,用于存储科学工作文档,例如论文、论文、论文和研究期刊。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我将向您展示在 Ubuntu 20.04 (Focal Fossa) 上逐步安装 EPrints。 对于 Ubuntu 18.04、16.04 和任何其他基于 Debian 的发行版,如 Linux Mint,您可以按照相同的说明进行操作。

在 Ubuntu 20.04 LTS Focal Fossa 上安装 EPrints

步骤 1. 首先,通过运行以下命令确保所有系统包都是最新的 apt 终端中的命令。

sudo apt update sudo apt upgrade

步骤 2. 安装 LAMP 堆栈。

需要 Ubuntu 20.04 LAMP 服务器。 如果您没有安装 LAMP,您可以在此处按照我们的指南进行操作。

步骤 3. 在 Ubuntu 20.04 上安装 EPrints。

默认情况下,EPrints 在 Ubuntu 基础存储库中不可用。 现在我们将 EPrints 软件包存储库添加到您的 Ubuntu 系统:

echo "deb https://deb.eprints.org/3.4/stable/ ./" > /etc/apt/sources.list.d/eprints.list

接下来,导入 GPG 密钥:

wget -O - https://deb.eprints.org/keyFile | apt-key add -

之后,更新 apt 使用以下命令存储库并安装 EPrints:

sudo apt install update sudo apt install eprints

步骤 4. 配置 MariaDB。

默认情况下,MariaDB 未加固。 您可以使用 mysql_secure_installation 脚本。 您应该仔细阅读以下每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录、删除测试数据库和访问安全 MariaDB:

mysql_secure_installation

像这样配置它:

- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y

接下来,我们需要登录 MariaDB 控制台并为 EPrints 创建一个数据库。 运行以下命令:

mysql -u root -p

这将提示您输入密码,因此输入您的 MariaDB 根密码并点击 Enter. 登录到数据库服务器后,您需要为 EPrints 安装创建一个数据库:

CREATE DATABASE eprints_db; CREATE USER 'eprintspuser'@'localhost' IDENTIFIED BY 'Your-Strong-Passwd'; GRANT ALL PRIVILEGES ON `eprints_db`.* TO 'eprintsuser'@'localhost'; FLUSH PRIVILEGES;

步骤 5. 配置 EPrint。

首先,我们更改为 EPrints 用户并导航到 /usr/share/EPrints 目录:

su eprints cd /usr/share/eprints

接下来,从归档创建开始:

./bin/epadmin create zero

选择您自己的配置:

-bash-4.1$ ./bin/epadmin create  Create an EPrint Repository  Please select an ID for the repository, which will be used to create a directory and identify the repository. Lower case letters and numbers, may not start with a number. examples: "idrootprints" or "test123"  Archive ID? idrootrepo    Configure vital settings? [yes] ? ENTER Core configuration for idrootrepo  Hostname? testprint  Webserver Port [80] ? ENTER   Enter a single hash (#) when you're done.  Alias (enter # when done) [#] ? testprint.local Redirect testprint.local to testprint [yes] ?   Alias (enter # when done) [#] ? ENTER  Path [/] ? ENTER  HTTPS Hostname [] ? ENTER  Administrator Email? [email protected]  Archive Name [Test Repository] ? ENTER  Organisation Name [Organisation of Test] ? ENTER  Write these core settings? [yes] ? ENTER  Configure database? [yes] ?   Configuring Database for: idrootrepo Database Name [testrepo] ? ENTER MySQL Host [localhost] ? ENTER  You probably don't need to set socket and port (unless you do!?). MySQL Port (# for no setting) [#] ? ENTER MySQL Socket (# for no setting) [#] ? ENTER Database User [testrepo] ? ENTER Database Password [nxxxxuAw] ? ENTER  Database Engine [InnoDB] ? ENTER  Write these database settings? [yes] ?  ENTER  Create database "testrepo" [yes] ? ENTER  Database Superuser Username [root] ? eprints  Database Superuser Password? nxxxxuAw #the same password previously  Create database tables? [yes] ? ENTER  Create an initial user? [yes] ? ENTER  Enter a username [admin] ? ENTER  Select a user type (user|editor|admin) [admin] ? ENTER   Enter Password? 'Choose_your_strong_password' Email? [email protected]  Successfully created new user:        ID: 1 Do you want to build the static web pages? [yes] ? ENTER   Do you want to import the LOC subjects? [yes] ? ENTER  You must restart apache for any changes to take effect!

Save 和 close 然后,重新启动 Apache 网络服务器,以便进行更改:

sudo a2dissite 000-default.conf sudo a2ensite eprints.conf sudo systemctl restart apache2

步骤 6. 访问 EPrints Web 界面。

成功安装后,打开您喜欢的浏览器并导航到 URL https://server-ip-address/. 如果您使用防火墙,请打开端口 80 以启用对控制面板的访问。

恭喜! 您已成功安装 EPrints。 感谢您使用本教程在 Ubuntu 20.04 LTS Focal Fossa 系统上安装 EPrints。 如需更多帮助或有用信息,我们建议您查看 EPrints 官方网站.