Difference between revisions of "How to add a subdirectory that runs PHP scripts"

From EPrints Documentation
Jump to: navigation, search
(Created page with '== Make an Exception in urls.pl == Go to: [eprint install dir]/archives/[archive]/cfg/cfg.d/urls.pl Amend this line to include the directory you want to make an exception for. …')
 
Line 1: Line 1:
== Make an Exception in urls.pl ==
+
===Edit [eprint install dir]/archives/[archive]/cfg/cfg.d/[[urls.pl]]===
  
Go to:
+
Amend this line to include the directory you want to make an exception for. In this example, we are adding a blog directory, perhaps to host wordpress.
[eprint install dir]/archives/[archive]/cfg/cfg.d/urls.pl
 
  
Amend this line to include the directory you want to make an exception for.
+
$c->{[[rewrite_exceptions]]} = [ '/cgi/', '/archive/', ''''/blog/''''];
 
 
$c->{rewrite_exceptions} = [ '/cgi/', '/archive/', ''''/blog/''''];
 
  
 
Here we are adding the directory /blog/ to the array.
 
Here we are adding the directory /blog/ to the array.
  
Close that and open this file:
+
===Edit: [eprint install dir]/archives/[archive]/cfg/[[apachevhost.conf]]===
[eprint install dir]/archives/[archive]/cfg/apachevhost.conf
 
  
 
And add the following.
 
And add the following.
  
''Alias /blog/ /path/to/blog/
+
  Alias /blog/ /path/to/blog/
<Location "/blog">
+
  <Location "/blog">
  AddHandler php5-script php
+
      AddHandler php5-script php
  DirectoryIndex index.php
+
      DirectoryIndex index.php
</Location>  
+
  </Location>  
<Directory /path/to/blog>
+
  <Directory /path/to/blog>
  Order allow,deny
+
      Order allow,deny
  Allow from all
+
      Allow from all
</Directory>''
+
  </Directory>
  
Restart Apache
+
===Restart Apache===

Revision as of 21:27, 18 February 2010

Edit [eprint install dir]/archives/[archive]/cfg/cfg.d/urls.pl

Amend this line to include the directory you want to make an exception for. In this example, we are adding a blog directory, perhaps to host wordpress.

$c->{rewrite_exceptions} = [ '/cgi/', '/archive/', '/blog/'];

Here we are adding the directory /blog/ to the array.

Edit: [eprint install dir]/archives/[archive]/cfg/apachevhost.conf

And add the following.

  Alias /blog/ /path/to/blog/
  <Location "/blog">
     AddHandler php5-script php
     DirectoryIndex index.php
  </Location> 
  <Directory /path/to/blog>
     Order allow,deny
     Allow from all
  </Directory>

Restart Apache