On 03/16/16 20:58, Alan Corey wrote:
> I don't have enough room in / to have my htdocs there so I want to
> move it to /usr/htdocs. This is in 5.7.   No problem I thought, I've
> had to do it before.  So my /etc/httpd.conf looks like this:
> chroot "/usr/htdocs"

hint: the default is /var/www.  NOT /var/www/htdocs.

> server "d530.my.domain" {
>   listen on * port 80
> }
> And I get logging into /usr/htdocs/logs but httpd doesn''t seem to
> find files in /usr/htdocs.  I get a 404 error that says OpenBSD httpd
> in it but it can't find even index.html which does exist.

actually, it doesn't.  man httpd.conf
     chroot directory
             Set the chroot(2) directory.  If not specified, it
             defaults to /var/www, the home directory of the www user.
             Set the document root of the server.  The directory is a
             pathname within the chroot(2) root directory of httpd.
             If not specified, it defaults to /htdocs.

You are trying to serve /usr/htdocs/htdocs/index.html, and that is a
good 404.

I verified that I could chroot to my /tmp dir and serve a file out of
/tmp/htdocs/ with no problem.

> I've played
> with htdocs vs htdocs/.  If I comment out the chroot line it finds
> files in /var/www/htdocs.  My /usr is in a different MBR partition
> (actually an exended one) with 129 gigs free.

and this is also wrong.
Your webserver should NOT be in /.
Your /usr should not have 129G free.
Your web server should not be in /usr.
You really need to be reloading that system with a less insane
partitioning plan.  Then you don't have to worry about moving the
chroot.  It can be done.  But don't.  Just don't.  Not for this reason.
 You need to upgrade soon anyway.  Good time to rebuild properly.


Reply via email to