Difference between revisions of "API:bin/generate apacheconf"

From EPrints Documentation
Jump to: navigation, search
Line 17: Line 17:
 
<!-- Pod2Wiki=head_synopsis -->
 
<!-- Pod2Wiki=head_synopsis -->
 
==SYNOPSIS==
 
==SYNOPSIS==
'''generate_apacheconf''' ['''options''']  
+
'''generate_apacheconf''' ['''options'''] [<em>repository_id</em>]
 +
 
 +
'''generate_apacheconf''' --replace [repoid]
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 28: Line 30:
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
This script generates the apache config files which will be used by EPrints. In the simple case all you need to do is run this script then add a line to your main apache configuration file - often, but not always, '''/usr/local/apache/conf/httpd.conf'''
+
This script generates the config files to include in your Apache configuration.
 +
 
 +
If you have changed a repository's configuration (hostname/port/path) you can update the configuration for that repository with:
  
  Include /opt/eprints3/cfg/apache.conf
+
  generate_apacheconf --replace [repoid]
 
    
 
    
Or elsewhere if you installed EPrints somewhere other than /opt/eprints3. This file then uses the "Include" directive to include all relevant apache config files from this EPrints installation.
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
  
By default the virtualhost directives are
+
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=head_adding_to_apache_configuration -->
 +
===Adding to Apache Configuration===
 +
To enable EPrints you must add the following line to your main Apache configuration file (<em>/etc/httpd/conf/httpd.conf</em>):
  
  VirtualHost *
+
  Include /opt/eprints3/cfg/apache.conf
 
    
 
    
But the * can be changed to something different by editing the <tt>virtualhost</tt> option in SystemSettings.pm
+
To enable secure (HTTPS) you must add the following line to your SSL VirtualHost:
  
 +
Include /opt/eprints3/cfg/apache_ssl.conf
 +
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 49: Line 62:
 
<!-- Pod2Wiki=head_arguments -->
 
<!-- Pod2Wiki=head_arguments -->
 
==ARGUMENTS==
 
==ARGUMENTS==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_repository_id -->
 +
===repository_id===
 +
 +
Optionally update the given repository's apache configuration only. Will only replace an existing configuration file with the --replace option.
 +
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 58: Line 83:
 
<!-- Pod2Wiki=head_options -->
 
<!-- Pod2Wiki=head_options -->
 
==OPTIONS==
 
==OPTIONS==
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_b_replace -->
 +
==='''--replace'''===
 +
 +
Replace existing configuration files, overwriting any changes made.
 +
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 +
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_b_system -->
 +
==='''--system'''===
 +
 +
Update the system configuration file, overwriting any changes made.
 +
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<span style='display:none'>User Comments</span>
Line 137: Line 186:
 
==='''EPRINTS/cfg/apache.conf'''===
 
==='''EPRINTS/cfg/apache.conf'''===
  
This file is not updated if it already exists, so you can add system-wide apache configuration directives here. By default it just includes the two other system wide files: auto-apache-includes.conf and auto-apache.conf
+
Loads the EPrints environment and repository-specific configuration files.
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_eprints_cfg_auto_apache_includes_conf -->
 
==='''EPRINTS/cfg/auto-apache-includes.conf'''===
 
 
 
This file is updated with Include lines to each of the repository specific apache config files. This file should not be edited by hand,
 
 
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
 
 
 
 
<!-- Pod2Wiki= -->
 
</div>
 
<!-- Pod2Wiki=item_b_eprints_cfg_auto_apache_conf -->
 
==='''EPRINTS/cfg/auto-apache.conf'''===
 
 
 
This file contains the system wide apache directives required by EPrints. This file should not be edited by hand.
 
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 170: Line 195:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_b_eprints_archives_archivedir_cfg_apache_conf -->
+
<!-- Pod2Wiki=item_b_eprints_cfg_apache_ssl_conf -->
==='''EPRINTS/archives/ARCHIVEDIR/cfg/apache.conf'''===
+
==='''EPRINTS/cfg/apache_ssl.conf'''===
  
This file is not updated if it already exists, so you can add repository-specific apache configuration directives here. By default it just includes the automatically generated repository specific file: auto-apache.conf
+
Loads the repository-specific SSL configuration files.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 182: Line 207:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_b_eprints_archives_archivedir_var_auto_apache_conf -->
+
<!-- Pod2Wiki=item_b_eprints_cfg_apache_repoid_conf -->
==='''EPRINTS/archives/ARCHIVEDIR/var/auto-apache.conf'''===
+
==='''EPRINTS/cfg/apache/[repoid].conf'''===
  
This file contains all the configuration directives needed for an repository. This is where the bulk of the configuration appears, the clever stuff, if you will. This file should not be edited by hand.
+
A &lt;VirtualHost&gt; that responds to the configured hostname and port of the repository.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 194: Line 219:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_b_eprints_archives_archivedir_var_auto_secure_conf -->
+
<!-- Pod2Wiki=item_b_eprints_cfg_apache_ssl_repoid_conf -->
==='''EPRINTS/archives/ARCHIVEDIR/var/auto-secure.conf'''===
+
==='''EPRINTS/cfg/apache_ssl/[repoid].conf'''===
  
Only created if the repository has a securehost configured. This file contains all the configuration options that need to be included into the secure server virtualhost.
+
A &lt;Location&gt; that responds to the configured https_root of the repository.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 206: Line 231:
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 
</div>
 
</div>
<!-- Pod2Wiki=item_b_eprints_archives_archivedir_cfg_apachevhost_conf -->
+
<!-- Pod2Wiki=item_b_eprints_archives_repoid_cfg_d_10_base_pl -->
==='''EPRINTS/archives/ARCHIVEDIR/cfg/apachevhost.conf'''===
+
==='''EPRINTS/archives/[repoid]/cfg.d/10_base.pl'''===
  
This file is not updated if it already exists, it is included into the virutalhost in auto-apache.conf so that you can a couple of additional directives if you need to. For example, redirects or additional log directives.
+
Default location for host and path directives used to build the Apache configuration files.
  
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>

Revision as of 13:07, 17 June 2010

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

generate_apacheconf - Create the apache config files needed for EPrints

User Comments


SYNOPSIS

generate_apacheconf [options] [repository_id]

generate_apacheconf --replace [repoid]

User Comments


DESCRIPTION

This script generates the config files to include in your Apache configuration.

If you have changed a repository's configuration (hostname/port/path) you can update the configuration for that repository with:

generate_apacheconf --replace [repoid]
 

User Comments


Adding to Apache Configuration

To enable EPrints you must add the following line to your main Apache configuration file (/etc/httpd/conf/httpd.conf):

Include /opt/eprints3/cfg/apache.conf
 

To enable secure (HTTPS) you must add the following line to your SSL VirtualHost:

Include /opt/eprints3/cfg/apache_ssl.conf
 

User Comments


ARGUMENTS

User Comments


repository_id

Optionally update the given repository's apache configuration only. Will only replace an existing configuration file with the --replace option.

User Comments


OPTIONS

User Comments


--replace

Replace existing configuration files, overwriting any changes made.

User Comments


--system

Update the system configuration file, overwriting any changes made.

User Comments


--help

Print a brief help message and exit.

User Comments


--man

Print the full manual page and then exit.

User Comments


--quiet

Be vewwy vewwy quiet. This option will supress all output unless an error occurs.

User Comments


--verbose

Explain in detail what is going on. May be repeated for greater effect.

User Comments


--version

Output version information and exit.

User Comments


FILES

User Comments


EPRINTS/cfg/apache.conf

Loads the EPrints environment and repository-specific configuration files.

User Comments


EPRINTS/cfg/apache_ssl.conf

Loads the repository-specific SSL configuration files.

User Comments


EPRINTS/cfg/apache/[repoid].conf

A <VirtualHost> that responds to the configured hostname and port of the repository.

User Comments


EPRINTS/cfg/apache_ssl/[repoid].conf

A <Location> that responds to the configured https_root of the repository.

User Comments


EPRINTS/archives/[repoid]/cfg.d/10_base.pl

Default location for host and path directives used to build the Apache configuration files.

User Comments