EPrints

EPrints

EPrints is an open-source software used to build digital repositories, such as institutional repositories, research archives, or academic document collections. Developed by the University of Southampton in 2000, EPrints is designed to manage, store, and publish scholarly works such as journal articles, theses, research reports, and academic data.

1. System Requirements

System requirements for EPrints 3.4:

  • Apache with mod_perl
  • MySQL

Before starting the deployment, prepare the following:

  • A VPS or server with Ubuntu 24.04 LTS OS
  • SSH access to the server
  • A domain already pointed to the server

2. Server Preparation

Update the system

sudo apt update
sudo apt upgrade -y

Install the required packages.

sudo apt install perl libncurses6 libselinux1 apache2 libapache2-mod-perl2 libxml-libxml-perl \
libunicode-string-perl libterm-readkey-perl libmime-lite-perl libmime-types-perl libdigest-sha-perl \
libdbd-mysql-perl libxml-parser-perl libxml2-dev libxml-twig-perl libarchive-any-perl libjson-perl \
liblwp-protocol-https-perl libtext-unidecode-perl lynx wget ghostscript poppler-utils antiword elinks \
texlive-base texlive-base-bin psutils imagemagick adduser tar gzip unzip libsearch-xapian-perl \
libtex-encode-perl libio-string-perl libdbd-mysql-perl git xpdf python3-html2text make -y

Install MySQL

sudo apt install mysql-server -y	

3. Create a Database

Log in to MySQL.

sudo mysql

Create a database and user.

CREATE USER 'eprints'@'localhost' IDENTIFIED by 'rahasia';
GRANT ALL PRIVILEGES ON *.* TO 'eprints'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

4. Create a User

Create the user eprints.

sudo useradd -d /opt/eprints3 -s /bin/bash eprints

Create the eprints3 directory.

sudo mkdir /opt/eprints3
sudo chown eprints:eprints /opt/eprints3
sudo chmod 2775 /opt/eprints3	

Open the envvars configuration.

sudo nano /etc/apache2/envvars

Change APACHE_RUN_USER and APACHE_RUN_GROUP.

export APACHE_RUN_USER=eprints 
export APACHE_RUN_GROUP=eprints

Restart apache2

sudo systemctl restart apache2

5. Download EPrints

Switch to the eprints user.

sudo su - eprints

Download the source code via git clone.

git clone https://github.com/eprints/eprints3.4.git /opt/eprints3

6. Create a Repository

Use tags/v3.4.6.

cd /opt/eprints3
git checkout tags/v3.4.6

Create a new repository.

bin/epadmin create pub

Enter the Archive ID, for example, repository.

Archive ID? repository

Press ENTER (to select the default [yes]) for Configure vital settings?.

Configure vital settings? [yes] ? ENTER

Enter the domain/subdomain, for example, repository.universitas.ac.id.

Hostname? repository.universitas.ac.id

For the next configuration, press ENTER.

Webserver Port [80] ? ENTER
Alias (enter # when done) [#] ? ENTER
Path [/] ? ENTER

Enter the domain again for HTTPS.

HTTPS Hostname [] ? repository.universitas.ac.id

For the HTTPS port, press ENTER.

Secure Webserver Port [443] ? ENTER

Enter the repository administrator’s email address.

Administrator Email? [email protected]

Enter the archive name and organization name.

Archive Name [Test Repository] ? Contoh Repository
Organisation Name [Organisation of Test] ? Contoh Organisasi

Save the core settings, press ENTER.

Write these core settings? [yes] ? ENTER

For Configure database, press ENTER.

Configure database? [yes] ? ENTER

For database configuration, press ENTER.

Database Name [repository] ? 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 [repository] ? ENTER
Database Password [jzYV9w9HdzSjhEH5] ? ENTER
Database Engine [InnoDB] ? ENTER

Write these database settings? [yes] ? ENTER
Create database "repository" [yes] ? ENTER

Enter the eprints MySQL username and password.

Database Superuser Username [root] ? eprints
Database Superuser Password? 
Create database tables? [yes] ? ENTER

Create an administrator account.

Create an initial user? [yes] ? 
Enter a username [admin] ? 
Select a user type (user|editor|admin) [admin] ? 
Enter Password? 
Email? [email protected]

Next, press ENTER.

Do you want to build the static web pages? [yes] ? ENTER
Do you want to import the LOC subjects and sample divisions? [yes] ? ENTER
Do you want to update the apache config files? (you still need to add the 'Include' line) [yes] ? ENTER

Exit the eprints user and switch to the sudo user.

exit

7. Apache Configuration

Add the eprints configuration to apache.conf.

echo "Include /opt/eprints3/cfg/apache.conf" | sudo tee -a /etc/apache2/apache2.conf

Restart apache2

sudo systemctl restart apache2

Access http://repository.universitas.ac.id has been installed.

8. Install SSL

Install certbot

sudo apt install certbot python3-certbot-apache -y

Request an SSL certificate.

sudo certbot --non-interactive \
    -m [email protected] \
    --agree-tos \
    --no-eff-email \
    --apache certonly \
    -d repository.universitas.ac.id	

Switch to the eprints user.

sudo su - eprints

Create the ssl directory inside the archive directory.

mkdir /opt/eprints3/archives/repository/ssl

Create the securevhost.conf file inside the ssl directory.

nano /opt/eprints3/archives/repository/ssl/securevhost.conf

Enter the configuration.

<VirtualHost *:443>

 ServerName repository.universitas.ac.id:443

 ErrorLog /var/log/apache2/repository.universitas.ac.id_error.log
 TransferLog /var/log/apache2/repository.universitas.ac.id_access.log
 LogLevel warn

 SSLEngine on
 SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
 SSLHonorCipherOrder on
 SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256

 SSLCertificateFile /etc/letsencrypt/live/repository.universitas.ac.id/fullchain.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/repository.universitas.ac.id/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/repository.universitas.ac.id/chain.pem

 SetEnvIf User-Agent ".*MSIE.*" \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0

 CustomLog /var/log/apache2/repository.universitas.ac.id_access.log \
 "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


 Include /opt/eprints3/cfg/apache_ssl/repository.conf
 
 PerlTransHandler +EPrints::Apache::Rewrite

</VirtualHost>

Regenerate the Apache configuration for EPrints.

/opt/eprints3/bin/generate_apacheconf --system --replace

Exit the eprints user.

exit

Add the securevhost.conf configuration to the apache.conf file.

echo "Include /opt/eprints3/archives/repository/ssl/securevhost.conf" | sudo tee -a /etc/apache2/apache2.conf

Enable the ssl module and restart apache2.

sudo a2enmod ssl
sudo systemctl restart apache2

Access https://repository.universitas.ac.id, SSL has been installed.