Last active
September 26, 2015 06:48
-
-
Save mheiges/1057055 to your computer and use it in GitHub Desktop.
sample Apache HTTP Server virtual host configuration for EuPathDB franchises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### required MACRO Substitutions ####### | |
# %SERVERNAME% - server host name, e.g. adhemar.schistodb.org | |
# manually add a ServerAlias if needed, e.g. www.shistodb.org | |
# %WEBAPP% - name of Tomcat webapp. e.g. schisto.adhemar | |
# %PROJECT% - project name, e.g. SchistoDB | |
# %ADMIN_EMAIL% - administrative email for server, e.g. root@schistodb.org | |
# %TC_PORT% - Tomcat HTTP port | |
# %ORACLE_HOME% - same as $ORACLE_HOME | |
# %LD_LIBRARY_PATH% - $ORACLE_HOME/lib plus any other paths as appropriate | |
########################################## | |
<VirtualHost *:80> | |
ServerName %SERVERNAME% | |
#---------------------------------------------------------------------# | |
# Uncomment and reload to disable site # | |
#---------------------------------------------------------------------# | |
#Redirect 503 / | |
#ErrorDocument 503 '%SERVERNAME% is temporarily offline.' | |
#---------------------------------------------------------------------# | |
# Update ENV (for cgi) # | |
#---------------------------------------------------------------------# | |
SetEnv GUS_HOME /var/www/%SERVERNAME%/gus_home | |
SetEnv PERL5LIB /var/www/%SERVERNAME%/cgi-lib:/var/www/%SERVERNAME%/gus_home/lib/perl | |
SetEnv PROJECT_ID %PROJECT% | |
SetEnv ORACLE_HOME %ORACLE_HOME% | |
SetEnv LD_LIBRARY_PATH %LD_LIBRARY_PATH% | |
DocumentRoot "/var/www/%SERVERNAME%/html" | |
#---------------------------------------------------------------------# | |
# Misc # | |
#---------------------------------------------------------------------# | |
DirectoryIndex home.jsp index.jsp index.html index.shtml index.php | |
ServerAdmin %ADMIN_EMAIL% | |
AddType application/rss+xml .rss | |
AddType application/octet-stream .fasta | |
AddType application/octet-stream .gff | |
AddType video/x-ms-wmv .wmv | |
#---------------------------------------------------------------------# | |
# Rewrite Rules (General, other sites have similar) # | |
#---------------------------------------------------------------------# | |
RewriteEngine on | |
# redirection to Tomcat | |
RewriteRule ^/+$ /%WEBAPP%/ [R,L] | |
ProxyPreserveHost On | |
ProxyPass /%WEBAPP% http://127.0.0.1:%TC_PORT%/%WEBAPP% | |
ProxyPassReverse /%WEBAPP% http://127.0.0.1:%TC_PORT%/%WEBAPP% | |
ProxyPass /webservices http://127.0.0.1:%TC_PORT%/%WEBAPP%/webservices | |
ProxyPassReverse /webservices http://127.0.0.1:%TC_PORT%/%WEBAPP%/webservices | |
# provide uniformly named access to static files (js, css, etc) served by Tomcat | |
ProxyPass /a http://127.0.0.1:%TC_PORT%/%WEBAPP% | |
ProxyPassReverse /a http://127.0.0.1:%TC_PORT%/%WEBAPP% | |
#---------------------------------------------------------------------# | |
# / (DocumentRoot) # | |
#---------------------------------------------------------------------# | |
<Directory "/var/www/%SERVERNAME%/html"> | |
Options Includes FollowSymLinks | |
AllowOverride Limit AuthConfig | |
Order allow,deny | |
Allow from all | |
</Directory> | |
<Location /WEB-INF> | |
deny from all | |
</Location> | |
#---------------------------------------------------------------------# | |
# /cgi-bin # | |
#---------------------------------------------------------------------# | |
ScriptAlias /cgi-bin/ "/var/www/%SERVERNAME%/cgi-bin/" | |
ScriptAlias /bin/ "/var/www/%SERVERNAME%/cgi-bin/" | |
<Directory "/var/www/%SERVERNAME%/cgi-bin"> | |
AllowOverride AuthConfig Limit | |
Options ExecCGI Includes | |
SetOutputFilter Includes | |
Order allow,deny | |
Allow from all | |
</Directory> | |
#---------------------------------------------------------------------# | |
# /common/downloads (allow Indexes) # | |
#---------------------------------------------------------------------# | |
Alias /common/downloads /var/www/Common/prodSiteFilesMirror/downloadSite/%PROJECT% | |
<Directory /var/www/Common/prodSiteFilesMirror/downloadSite/%PROJECT%> | |
Options Indexes FollowSymLinks Includes MultiViews | |
ReadmeName /include/fancyIndexFooter.shtml | |
HeaderName /include/fancyIndexHeader.shtml | |
IndexOptions SuppressHTMLPreamble FancyIndexing FoldersFirst IgnoreCase DescriptionWidth=* | |
IndexIgnore .??* *~ *# README* | |
AllowOverride Indexes | |
Order allow,deny | |
Allow from all | |
</Directory> | |
#---------------------------------------------------------------------# | |
# /common/community (allow Indexes) # | |
#---------------------------------------------------------------------# | |
Alias /common/community /var/www/Common/communityFilesMirror | |
<Directory /var/www/Common/communityFilesMirror> | |
Options Indexes FollowSymLinks Includes MultiViews | |
ReadmeName /include/fancyIndexFooter.shtml | |
HeaderName /include/fancyIndexHeader.shtml | |
IndexOptions SuppressHTMLPreamble FancyIndexing FoldersFirst IgnoreCase DescriptionWidth=* | |
IndexIgnore .??* *~ *# README* | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
#---------------------------------------------------------------------# | |
# /common # | |
#---------------------------------------------------------------------# | |
Alias /common /var/www/Common/prodSiteFilesMirror/auxiliary/%PROJECT% | |
<Directory /var/www/Common/prodSiteFilesMirror/auxiliary/%PROJECT%> | |
Options FollowSymLinks Includes | |
AllowOverride None | |
Order allow,deny | |
Allow from all | |
</Directory> | |
#---------------------------------------------------------------------# | |
# RSS feeds # | |
#---------------------------------------------------------------------# | |
RewriteRule /news.rss /%WEBAPP%/showXmlDataContent.do?name=XmlQuestions.NewsRss [PT] | |
RewriteRule /events.rss /%WEBAPP%/communityEventsRss.jsp [PT] | |
RewriteRule /publications.rss /%WEBAPP%/showXmlDataContent.do?name=XmlQuestions.PublicationsRss [PT] | |
RewriteRule /releases.rss /%WEBAPP%/showXmlDataContent.do?name=XmlQuestions.ReleasesRss [PT] | |
#---------------------------------------------------------------------# | |
# Logging # | |
#---------------------------------------------------------------------# | |
SetEnvIf Remote_Addr "121\.122\.77\.111" self | |
CustomLog /var/log/httpd/%SERVERNAME%/access_log combined env=!self | |
CustomLog /var/log/httpd/%SERVERNAME%/agent_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" | |
ErrorLog /var/log/httpd/%SERVERNAME%/error_log | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment