# Map /home/userdir into apache-jail



## bsus (May 1, 2012)

Hello,

Is there a way to mount/map the user data into an (ezjail) so that apache (php) can have access to the files*?* How do I do this secure (ZFS writeable snapshot?)? How do I handle the permissions (home files must be writeable for apache)?

Regards


----------



## SirDice (May 1, 2012)

Use nullfs(5) and mount it read-only.

For example:
`# mount -t nullfs -o ro /home/myhomedir /jails/web/storage/`

Then configure Apache to show the /storage/ directory.


----------



## bsus (May 1, 2012)

I am failing with configuring Apache:

httpd.conf:

```
<Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files" />
    AllowOverride None
    Order allow,deny 
</Directory>
```


```
# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax error on line 172 of /usr/local/etc/apache22/httpd.conf:
Multiple <Directory> arguments not (yet) supported.
```


----------



## SirDice (May 1, 2012)

bsus said:
			
		

> ```
> <Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files" />
> ```


Remove that last slash.


```
<Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files">
```


----------



## bsus (May 1, 2012)

Thank you this was it 

I now decided to *mount -t nullfs* a cloned zfs snapshot because I need _write_ access. Unfortunatly (I am using some WebDAV) I can access my data over the url without authentication but there should only be access through the application. Is there a quick fix or do I have to play around with the apache authentication modules?


----------



## SirDice (May 1, 2012)

I'd add some authentication to it.


----------



## bsus (May 1, 2012)

Hi,

*H*ad to change "AllowOverride All" so that the .htaccess gets used.

Thank you for the support


----------

