Difference between revisions of "How to add a subdirectory that runs PHP scripts"
(→Edit [eprint install dir]/archives/[archive]/cfg/cfg.d/urls.pl) |
(fixed broken link) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
In this example, we are adding a 'blog' directory, perhaps to host wordpress. | In this example, we are adding a 'blog' directory, perhaps to host wordpress. | ||
| − | ===Edit | + | ===Edit [eprint install dir]/archives/[archive]/cfg/cfg.d/[[20_baseurls.pl]]=== |
Amend this line to include the directory you want to make an exception for. | Amend this line to include the directory you want to make an exception for. | ||
Here we are adding the directory /blog/ to the array. | Here we are adding the directory /blog/ to the array. | ||
| − | $c->{[[rewrite_exceptions]]} = [ '/cgi/', '/archive/', ''''/blog/'''']; | + | $c->{[[Rewrite_Exceptions|rewrite_exceptions]]} = [ '/cgi/', '/archive/', ''''/blog/'''']; |
Save and close. | Save and close. | ||
| Line 24: | Line 24: | ||
Allow from all | Allow from all | ||
</Directory> | </Directory> | ||
| + | |||
| + | ===EPrints 3.3+ Edit: cfg/apache/[archiveid].conf=== | ||
| + | |||
| + | And add the following above the existing <tt>Location</tt>: | ||
| + | |||
| + | Include [eprint install dir]/archives/[archiveid]/cfg/apachevhost.conf | ||
| + | |||
| + | Or, to overwrite your existing Apache conf (losing any changes!): | ||
| + | |||
| + | ./bin/generate_apacheconf --replace [archiveid] | ||
===Restart Apache=== | ===Restart Apache=== | ||
/etc/init.d/apache2 force-reload | /etc/init.d/apache2 force-reload | ||
Latest revision as of 12:10, 30 January 2022
In this example, we are adding a 'blog' directory, perhaps to host wordpress.
Contents
Edit [eprint install dir]/archives/[archive]/cfg/cfg.d/20_baseurls.pl
Amend this line to include the directory you want to make an exception for.
Here we are adding the directory /blog/ to the array.
$c->{rewrite_exceptions} = [ '/cgi/', '/archive/', '/blog/'];
Save and close.
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>
EPrints 3.3+ Edit: cfg/apache/[archiveid].conf
And add the following above the existing Location:
Include [eprint install dir]/archives/[archiveid]/cfg/apachevhost.conf
Or, to overwrite your existing Apache conf (losing any changes!):
./bin/generate_apacheconf --replace [archiveid]
Restart Apache
/etc/init.d/apache2 force-reload