Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache + sftp chroot jail |
|
Author |
|
darkapec
Joined: 12 Nov 2014 Posts: 2 Location: Michigan
|
Posted: Wed 12 Nov '14 22:01 Post subject: Apache + sftp chroot jail |
|
|
I have a chroot jail setup for a directory "/home/jail/Videos/" I am trying to also make that directory visible via apache without removing the chroot jail. Apache was able to view this directory prior to setting up the chroot, so I assume this has something to do with permissions.
Code: |
jake@Kratos:~$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu 14.04)
Server built: Jul 22 2014 14:36:38
|
Code: | The current permissions are:
/home/jail/videos | jake:jake 0755
/home/jail | root:root 0755
|
Code: | Relevant Apache Config:
<VirtualHost *:80>
DocumentRoot /home/jail
ServerName media.****.net
IndexOptions FancyIndexing FoldersFirst
IndexOrderDefault Ascending Name
# Other directives here
</VirtualHost> |
Code: | Apache Error log:
[Tue Nov 11 10:49:41.447083 2014] [autoindex:error] [pid 10043] [client 70.88.120.107:56702] AH01276: Cannot serve directory /home/jail/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) fou$
[Tue Nov 11 11:19:42.339439 2014] [autoindex:error] [pid 10043] [client 70.88.120.107:56997] AH01276: Cannot serve directory /home/jail/Videos/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.h$ |
The strange part is I created a index.html file that simply says "It Works!" in the /home/jail directory and I am able to successfully see that file using a web browser. But I am unable to navigate into any sub-directories. I am however able to access a file if I know the whole path though.
For example:
I can access /home/jail/index.html by vising media.****.net
I cannot access /home/jail/Videos/Personal/ by changing the address in the address bar.
I can access /home/jail/Videos/Personal/Movie.mp4 if I manually type the entire file path in the address bar.
This to me says that mod_dir is unable to index the folder contents (probably because of the permissions). I do not want to create index.html files in each sub-directory containing the contents of the directory. Anyone have another solution?
Thanks
Jake |
|
Back to top |
|
darkapec
Joined: 12 Nov 2014 Posts: 2 Location: Michigan
|
Posted: Wed 12 Nov '14 22:29 Post subject: SOLVED |
|
|
easy fix, I had to add
Code: | <Directory "/home/jail">
Options Indexes
</Directory> |
to the config file.
Credit goes to Lars Noodén at ubuntuforums. |
|
Back to top |
|
|
|
|
|
|