Difference between revisions of "Getting Started with EPrints 3"

From EPrints Documentation
Jump to: navigation, search
(updated to 3.2.4)
m (updated)
Line 5: Line 5:
  
 
EPrints 3 can run multiple archives under one install. Multiple archives will require giving additional DNS aliases to the machine running EPrints, EPrints can then create all the parts of the apache configuration file needed to run the virtual hosts.
 
EPrints 3 can run multiple archives under one install. Multiple archives will require giving additional DNS aliases to the machine running EPrints, EPrints can then create all the parts of the apache configuration file needed to run the virtual hosts.
 +
 +
Alternatively you can use different ports to distinguish your different repositories hosted by the same server.
  
 
===Running epadmin===
 
===Running epadmin===
Line 38: Line 40:
 
* Create database <Database Name> - Say ''yes'' to launch <tt>epadmin create_db ''archive_id''</tt>, and <tt>epadmin</tt> can create the database and populate it with all the right tables.  If you've already created a database and a user for this archive, say 'no'.
 
* Create database <Database Name> - Say ''yes'' to launch <tt>epadmin create_db ''archive_id''</tt>, and <tt>epadmin</tt> can create the database and populate it with all the right tables.  If you've already created a database and a user for this archive, say 'no'.
 
** Database Superuser Username - 'root' isn't a bad suggestion, but should match your specifications during the MySQL installation.
 
** Database Superuser Username - 'root' isn't a bad suggestion, but should match your specifications during the MySQL installation.
** Database Superuser Password - To create the database and the user, epadmin needs the MySQL Root Password (specified during MySQL installation). This is not saved anywhere.  It is only used to log into MySQL, create the database and create the user with useful access rights. The password is forgotten afterwards, because it's not needed anymore!
+
** Database Superuser Password - To create the database and the user, epadmin needs the MySQL Root Password (specified during MySQL installation). This is not saved anywhere.  It is only used to log into MySQL, create the database and create the user with useful access rights. The password is forgotten afterwards, because it's not needed anymore by this process!
 
* Create database tables - say 'yes' to have epadmin create all the database tables, i.e. initiate the same as with <tt>epadmin create_tables ''archive_id''</tt>.
 
* Create database tables - say 'yes' to have epadmin create all the database tables, i.e. initiate the same as with <tt>epadmin create_tables ''archive_id''</tt>.
 
* Create an initial user - It's a good idea to create a user account for yourself at this point, but you can start the same process by <tt>epadmin create_user ''archive_id''</tt> anytime ...
 
* Create an initial user - It's a good idea to create a user account for yourself at this point, but you can start the same process by <tt>epadmin create_user ''archive_id''</tt> anytime ...
Line 46: Line 48:
 
** Email - Enter your email address so that users can get in contact with you.
 
** Email - Enter your email address so that users can get in contact with you.
 
* Do you want to build the static web pages - There are a number of pages in EPrints which change very rarely.  These are the static pages.  The Home page and the About page are examples of static pages.  Stylesheets are also static.  These pages need to be built, so say 'yes' (otherwise you have to start that process manually later by <tt>generate_static ''archive_id''</tt>).
 
* Do you want to build the static web pages - There are a number of pages in EPrints which change very rarely.  These are the static pages.  The Home page and the About page are examples of static pages.  Stylesheets are also static.  These pages need to be built, so say 'yes' (otherwise you have to start that process manually later by <tt>generate_static ''archive_id''</tt>).
* Do you want to import the LOC subjects - If you will be using the Library Of Congress subject hierarchy, say 'yes'.  Otherwise you will need to create your own subject hierarchy and to import them using [http://wiki.eprints.org/w/API:bin/import_subjects import_subjects].
+
* Do you want to import the LOC subjects - If you will be using the Library Of Congress subject hierarchy, say 'yes'.  Otherwise you will need to create your own subject hierarchy and import it using [http://wiki.eprints.org/w/API:bin/import_subjects <tt>import_subjects</tt>].
 
* Do you want to update the apache config files? (you still need to add the 'Include' line in the very central http.conf, e.g.) - Your archive has a number of files which it uses to configure the web server.  These should be updated, so say ''yes'' or start <tt>generate_apacheconf ''archive_id''</tt> later.
 
* Do you want to update the apache config files? (you still need to add the 'Include' line in the very central http.conf, e.g.) - Your archive has a number of files which it uses to configure the web server.  These should be updated, so say ''yes'' or start <tt>generate_apacheconf ''archive_id''</tt> later.
 
* Before exiting, <tt>epadmin</tt> will display information about configuring the webserver.
 
* Before exiting, <tt>epadmin</tt> will display information about configuring the webserver.
Line 55: Line 57:
  
 
  Create an EPrint Repository
 
  Create an EPrint Repository
 +
 
  Please select an ID for the repository, which will be used to create a directory
 
  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
 
  and identify the repository. Lower case letters and numbers, may not start with
 
  a number. examples: "lemurprints" or "test3"
 
  a number. examples: "lemurprints" or "test3"
 +
 +
Existing repositories:
 +
test
 +
 
  Archive ID? uclapr
 
  Archive ID? uclapr
 
  We need to create /var/lib/eprints3/archives/uclapr, doing it now...
 
  We need to create /var/lib/eprints3/archives/uclapr, doing it now...
 +
 +
Creating initial files:
 +
Installing: /var/lib/eprints3/archives/uclapr/cfg
 +
Installing: ...
 +
:
 +
 +
Ok. I've created the initial config files and directory structure.
 +
I've also created a "disk0" directory under documents/ if you want
 +
your full texts to be stored on a different partition then remove
 +
the disk0, and create a symbolic link to the directory you wish to
 +
store the full texts in. Additional links may be placed here to be
 +
used when the first is full.
 +
 
  Getting uid and gid information for apache
 
  Getting uid and gid information for apache
 
  UID: 48
 
  UID: 48
 
  GID: 48
 
  GID: 48
  Configure vital settings? [yes] ? yes
+
 +
  Configure vital settings? [yes] ?  
 +
Core configuration for uclapr
 +
 +
Please enter the fully qualified hostname of the repository.
 +
 +
For a production system we recommend against using the real hostname of the machine.
 +
 +
Example: uclapr.footle.ac.uk
 
  Hostname? eprints.adastral.ucl.ac.uk
 
  Hostname? eprints.adastral.ucl.ac.uk
  Webserver Port [80] ? 80
+
  Please enter all the aliases which could reach the repository, and indicate if
+
Please enter the port of the webserver. This is probably 80, but you may wish to run apache on a different port if you are experimenting.
you would like EPrints to write a Redirect Rule to redirect requests to this alias to the correct URL.
+
 +
  Webserver Port [80] ?
 +
 +
  Please enter all the aliases which could reach the repository, and indicate if you would like EPrints to write a Redirect Rule to redirect requests to this alias to the correct URL.
 
  Some suggestions:
 
  Some suggestions:
 
  eprints.adastral
 
  eprints.adastral
 
  eprints
 
  eprints
 +
 
  Enter a single hash (#) when you're done.
 
  Enter a single hash (#) when you're done.
 +
 
  Alias (enter # when done) [#] ? eprints.adastral
 
  Alias (enter # when done) [#] ? eprints.adastral
  Redirect entw-server to entw-server.grs.de [yes] ?
+
  Redirect eprints to eprints.adastral.ucl.ac.uk [yes] ?
 
  Alias (enter # when done) [#] ? #
 
  Alias (enter # when done) [#] ? #
 +
 
  Please enter the path part of the repository's base URL. This should probably be '/'.
 
  Please enter the path part of the repository's base URL. This should probably be '/'.
 
  Path [/] ?  
 
  Path [/] ?  
 +
 
  If you will use https for your user pages (including login) enter the https hostname
 
  If you will use https for your user pages (including login) enter the https hostname
 
  here, or leave blank when using http only.
 
  here, or leave blank when using http only.
  Hostname?
+
  HHTPS Hostname [] ?
 +
 
  Administrator Email? *******@adastral.ucl.ac.uk
 
  Administrator Email? *******@adastral.ucl.ac.uk
 +
 +
Enter the name of the repository in the default language. If you wish to enter
 +
other titles for other languages or enter non ascii characters then you may
 +
enter something as a placeholder and edit the XML config file which this
 +
script generates.
 +
 
  Archive Name [Test Repository] ? UCL Adastral Park Repository
 
  Archive Name [Test Repository] ? UCL Adastral Park Repository
  Write these core settings? [yes] ? yes
+
  Write these core settings? [yes] ?
 +
 
 
  Configuring Database for: uclapr
 
  Configuring Database for: uclapr
  Database Name [uclapr] ? *********
+
  Database Name [uclapr] ?  
  MySQL Host [localhost] ? localhost
+
  MySQL Host [localhost] ?
 +
 +
You probably don't need to set socket and port (unless you do!?).
 
  MySQL Port (# for no setting) [#] ?  
 
  MySQL Port (# for no setting) [#] ?  
 
  MySQL Socket (# for no setting) [#] ?  
 
  MySQL Socket (# for no setting) [#] ?  
 
  Database User [******] ?  
 
  Database User [******] ?  
 
  Database Password?  
 
  Database Password?  
  Write these database settings? [yes] ? yes
+
Database Engine [MyISAM] ?
 +
 +
  Write these database settings? [yes] ?  
 +
Wrote /var/lib/eprints3/archives/uclapr/cfg/cfg.d/database.pl
 +
 +
EPrints can create the database, and grant the correct permissions.
 +
 
  Create database "uclapr" [yes] ?  
 
  Create database "uclapr" [yes] ?  
 
  Database Superuser Username [root] ?
 
  Database Superuser Username [root] ?
  Database Superuser Password?  
+
  Database Superuser Password?
 
  Create database tables? [yes] ?
 
  Create database tables? [yes] ?
 +
Creating database tables...
 +
:
 +
 
  Create an initial user? [yes] ?
 
  Create an initial user? [yes] ?
 
  Enter a username [admin] ?
 
  Enter a username [admin] ?
Line 101: Line 155:
 
  Email? *******@adastral.ucl.ac.uk
 
  Email? *******@adastral.ucl.ac.uk
 
  Do you want to build the static web pages? [yes] ?
 
  Do you want to build the static web pages? [yes] ?
 +
 
  Do you want to import the LOC subjects? [yes] ? no (I have a custom subject file)
 
  Do you want to import the LOC subjects? [yes] ? no (I have a custom subject file)
  Do you want to update the apache config files? (you still need to add the 'Include' line) [yes] ? yes
+
  Do you want to update the apache config files? (you still need to add the 'Include' line) [yes] ?  
  
Open a browser, and enter the hostname in the address bar.  You should see your new archive, ready to be [[Branding with confidence|branded]].
+
Finish apache's configuration before its final restart to be ready for opening a browser and watch the homepage of your new archive, ready to be [[Branding with confidence|branded]].
  
If you want to add some more users, use the command <tt>epadmin create_user <repository id></tt>.
+
If you want to add some more users, use the command <tt>epadmin create_user <repository id></tt> or the admin's web dialog.
  
 
==Regular Maintenance==
 
==Regular Maintenance==

Revision as of 11:07, 9 October 2015

Creating an Archive

EPrints 3 can run multiple archives under one install. Multiple archives will require giving additional DNS aliases to the machine running EPrints, EPrints can then create all the parts of the apache configuration file needed to run the virtual hosts.

Alternatively you can use different ports to distinguish your different repositories hosted by the same server.

Running epadmin

Make sure MySQL is actually running.

Change to your eprints user (probably eprints).

Change directory to the eprints directory (/opt/eprints3 by default) and run

bin/epadmin create

You will get the following prompts (note that when you see something in [square brackets], it's the default value and can be selected by simply hitting <enter>):

  • Archive ID - the system name for your archive. It's probably a good idea to think of something short and memorable. Once entered, an archive/<archive_id> directory will be created, and the standard configuration files will be copied in.
  • Configure vital settings - Hit enter to say 'yes'. This will lead to more prompting about core settings:
    • Hostname - What someone will type into a web browser to get to your archive. Make sure that your systems team have a DNS alias pointing to your server for this.
    • Webserver Port - Which port do you want to serve the archive on? The default is 80, so unless you can think of a good reason not to, just hit enter to accept the default.
    • Alias - You can enter any number of aliases that will take users to this archive. Enter a '#' when you don't want to enter any more. You could have your archive served on eprints.myorganisation.org and eprints.myorg.org. As with the Hostname, your systems team need to be informed about these aliases too.
      • Redirect your chosen alias to Hostname - Yes, usually that is your intention.
    • Please enter the path part of the repository's base URL - Make it simple for you and your visitors ... and confirm the suggestion; multiple archives could be managed by different domains or ports!
    • If you will use https for your user pages (including login) enter the https hostname - No doubt, for secure usage you need another name.
    • Administrator Email - Enter the email address of the repository administrator. This will allow your repository users to send email to the right person.
    • Archive Name - The full name of your archive. By default, this will be used on many of the pages, and in the title bar of the browser.
    • Write these core settings - If you don't say 'yes', then you entered all that data for nothing (relaunch the process by epadmin config_core archive_id).
  • Configure database - EPrints makes extensive use of a MySQL database. Enter 'yes' to launch epadmin config_db archive_id.
    • Database Name - The internal name of your database. It makes sense to use the Archive ID for this, but you don't have to. You don't need to create this database, epadmin will do it for you.
    • MySQL Host - The address of the server that the database is running on. If the database is on the same machine as the EPrints installation, confirm 'localhost'.
    • MySQL Port - You probably don't need to enter a value. If you have problems connecting to the database, talk to your systems team.
    • MySQL Socket - As with MySQL Port, it's unlikely that you need to enter anything.
    • Database User - The username with which to log into the MySQL Database. You don't need to create this user, epadmin will do it for you. If you enter a MySQL username that already exists, it will be overwritten by epstats!
    • Database Password - Just confirm the suggested password for the Database User, eprints will keep track of it!
    • Write these database settings - You should write them, or you'll lose them.
  • Create database <Database Name> - Say yes to launch epadmin create_db archive_id, and epadmin can create the database and populate it with all the right tables. If you've already created a database and a user for this archive, say 'no'.
    • Database Superuser Username - 'root' isn't a bad suggestion, but should match your specifications during the MySQL installation.
    • Database Superuser Password - To create the database and the user, epadmin needs the MySQL Root Password (specified during MySQL installation). This is not saved anywhere. It is only used to log into MySQL, create the database and create the user with useful access rights. The password is forgotten afterwards, because it's not needed anymore by this process!
  • Create database tables - say 'yes' to have epadmin create all the database tables, i.e. initiate the same as with epadmin create_tables archive_id.
  • Create an initial user - It's a good idea to create a user account for yourself at this point, but you can start the same process by epadmin create_user archive_id anytime ...
    • Enter a username - The username you will be used to log into EPrints on the home page of the new archive.
    • Select a user type (user|editor|admin) - There are three user roles in EPrints. You probably want to be an administrator, so enter 'admin'.
    • Enter Password - A password for this user. Remember to choose a password that will be hard for someone else to guess!
    • Email - Enter your email address so that users can get in contact with you.
  • Do you want to build the static web pages - There are a number of pages in EPrints which change very rarely. These are the static pages. The Home page and the About page are examples of static pages. Stylesheets are also static. These pages need to be built, so say 'yes' (otherwise you have to start that process manually later by generate_static archive_id).
  • Do you want to import the LOC subjects - If you will be using the Library Of Congress subject hierarchy, say 'yes'. Otherwise you will need to create your own subject hierarchy and import it using import_subjects.
  • Do you want to update the apache config files? (you still need to add the 'Include' line in the very central http.conf, e.g.) - Your archive has a number of files which it uses to configure the web server. These should be updated, so say yes or start generate_apacheconf archive_id later.
  • Before exiting, epadmin will display information about configuring the webserver.

example configuration

The script will run through a number of configuration options, an example of which is listed below. Please change the settings to suit your site configuration.

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: "lemurprints" or "test3"

Existing repositories:
test

Archive ID? uclapr
We need to create /var/lib/eprints3/archives/uclapr, doing it now...

Creating initial files:
Installing: /var/lib/eprints3/archives/uclapr/cfg
Installing: ...
:

Ok. I've created the initial config files and directory structure. 
I've also created a "disk0" directory under documents/ if you want
your full texts to be stored on a different partition then remove 
the disk0, and create a symbolic link to the directory you wish to
store the full texts in. Additional links may be placed here to be
used when the first is full.

Getting uid and gid information for apache
UID: 48
GID: 48

Configure vital settings? [yes] ? 
Core configuration for uclapr

Please enter the fully qualified hostname of the repository. 

For a production system we recommend against using the real hostname of the machine. 

Example: uclapr.footle.ac.uk
Hostname? eprints.adastral.ucl.ac.uk

Please enter the port of the webserver. This is probably 80, but you may wish to run apache on a different port if you are experimenting.

Webserver Port [80] ?

Please enter all the aliases which could reach the repository, and indicate if you would like EPrints to write a Redirect Rule to redirect requests to this alias to the correct URL.
Some suggestions:
eprints.adastral
eprints

Enter a single hash (#) when you're done.

Alias (enter # when done) [#] ? eprints.adastral
Redirect eprints to eprints.adastral.ucl.ac.uk [yes] ?
Alias (enter # when done) [#] ? #

Please enter the path part of the repository's base URL. This should probably be '/'.
Path [/] ? 

If you will use https for your user pages (including login) enter the https hostname
here, or leave blank when using http only.
HHTPS Hostname [] ?

Administrator Email? *******@adastral.ucl.ac.uk

Enter the name of the repository in the default language. If you wish to enter 
other titles for other languages or enter non ascii characters then you may
enter something as a placeholder and edit the XML config file which this
script generates.

Archive Name [Test Repository] ? UCL Adastral Park Repository
Write these core settings? [yes] ?
 
Configuring Database for: uclapr
Database Name [uclapr] ? 
MySQL Host [localhost] ?

You probably don't need to set socket and port (unless you do!?).
MySQL Port (# for no setting) [#] ? 
MySQL Socket (# for no setting) [#] ? 
Database User [******] ? 
Database Password? 
Database Engine [MyISAM] ? 

Write these database settings? [yes] ? 
Wrote /var/lib/eprints3/archives/uclapr/cfg/cfg.d/database.pl

EPrints can create the database, and grant the correct permissions.

Create database "uclapr" [yes] ? 
Database Superuser Username [root] ?
Database Superuser Password?
Create database tables? [yes] ?
Creating database tables...
:

Create an initial user? [yes] ?
Enter a username [admin] ?
Select a user type (user|editor|admin) [admin] ?
Enter Password? *****************
Email? *******@adastral.ucl.ac.uk
Do you want to build the static web pages? [yes] ?

Do you want to import the LOC subjects? [yes] ? no (I have a custom subject file)
Do you want to update the apache config files? (you still need to add the 'Include' line) [yes] ? 

Finish apache's configuration before its final restart to be ready for opening a browser and watch the homepage of your new archive, ready to be branded.

If you want to add some more users, use the command epadmin create_user <repository id> or the admin's web dialog.

Regular Maintenance

EPrints front end web pages and abstracts *are not* automatically updated when you make changes to the repository. To apply your changes and update the web pages:

Generate Views

 eprints@host$ bin/generate_views yourarchivename

Generate Statics

 eprints@host$ bin/generate_static yourarchivename

Generate Abstracts

 eprints@host$ bin/generate_abstracts yourarchivename

Finally a restart of your apache server is recommended, because a lot of settings will only be read initially!