ed4d [Solved] Map /home/userdir into apache-jail - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old May 1st, 2012, 13:55
bsus bsus is offline
Member
 
Join Date: Feb 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
Default Map /home/userdir into apache-jail

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

Last edited by DutchDaemon; May 1st, 2012 at 18:04.
Reply With Quote
  #2  
Old May 1st, 2012, 14:00
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

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.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old May 1st, 2012, 15:54
bsus bsus is offline
Member
 
Join Date: Feb 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
Default

I am failing with configuring Apache:

httpd.conf:
Code:
<Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files" />
    AllowOverride None
    Order allow,deny 
</Directory>
Code:
# /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.

Last edited by DutchDaemon; May 1st, 2012 at 18:04.
Reply With Quote
  #4  
Old May 1st, 2012, 16:09
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

Quote:
Originally Posted by bsus View Post
Code:
<Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files" />
Remove that last slash.

Code:
<Directory "/usr/local/www/apache22/data/owncloud/data/bodo/files">
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #5  
Old May 1st, 2012, 16:28
bsus bsus is offline
Member
 
Join Date: Feb 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
Default

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?

Last edited by DutchDaemon; May 1st, 2012 at 18:05.
Reply With Quote
  #6  
Old May 1st, 2012, 16:31
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,725
Thanks: 47
Thanked 2,023 Times in 1,862 Posts
Default

I'd add some authentication to it.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #7  
Old May 1st, 2012, 18:04
bsus bsus is offline
Member
 
Join Date: Feb 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi,

Had to change "AllowOverride All" so that the .htaccess gets used.

Thank you for the support
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] apache, ftp, jails, and home dirs nORKy Web & Network Services 6 May 22nd, 2011 11:04
Multiple Apache / Tomcat Instances each in its own Jail cmon Web & Network Services 4 May 4th, 2010 18:01
[Solved] Apache + Jail + 2 public IP = little problem grrr Web & Network Services 8 December 26th, 2009 20:26
home server jail SuperMiguel General 22 June 19th, 2009 00:32
apache UserDir hirohitosan Web & Network Services 13 January 1st, 2009 02:52


All times are GMT +1. The time now is 23:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0