# ezjail and apache22



## togawa (Oct 7, 2013)

Hello.

I'm using FreeBSD 9.2-RELEASE and sysutils/ezjail.

I installed Apache2.2 from ports to virtual machine in jail, and uncomment this line of /usr/local/etc/apache22/httpd.conf:

```
# Include etc/apache22/extra/httpd-userdir.conf
```
and made /home/togawa/public_html/index.html.

I try to access http://testjail.example.org/~togawa/, but 404 error occurs.  And tail of /var/log/httpd-error.log is

```
[Tue Oct 08 02:17:17 2013] [error] [client 192.168.0.12] File does not exist: /usr/local/www/apache22/data/home
```

Why does Apache access this file, not /home/togawa/public_html/index.html?

Thank you.


----------



## ShelLuser (Oct 8, 2013)

A lot depends on context, for example what's in your version of httpd-userdir.conf and how you configured the website for testjail.example.org. Not to mention what home directory the user account togawa has (I assume /home/togawa because you mentioned it, but it helps to make sure).

Personally I wouldn't rely on that pre-made file but instead simply utilize UserDir within your already existing website configuration.

A good read for setting this up is the mod_userdir page on the Apache website. Hope this gives you some ideas.


----------



## SirDice (Oct 8, 2013)

Where did you create that user? On the host or inside the jail? The jail has no notion of the accounts on the host. For all intents and purposes consider a jail to be a separate machine.


----------



## anlashok (Oct 9, 2013)

Did you enable mod_userdir in httpd.conf?


```
LoadModule userdir_module libexec/apache22/mod_userdir.so
```


----------

