Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th January 2010, 16:33
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
Default Newb: Is this WebDav setup going to work?

Hi,

I have an ISPc3 setup working well and I'm petrified of breaking anything so just wanted someone to sanity-check the following... I really have no idea what I'm doing.

I notice there is a lot of interest in webdav as related to ISP3 so perhaps this can become a howto in the end...

I'm assuming the following:

I'm running ISP3 on Ubuntu 8.04 LTS server.
My site is called 'www.mysite.com'. It's already created using ISPc3.
I want to create a dav folder for the client 'Mike' within my website.

Does the following make sense...?

Become root:
Code:
sudo su
Enable the WebDav modules:
Code:
a2enmod
dav (enter)
a2enmod
dav_fs (enter)
Reload apache
Code:
/etc/init.d/apache2 force-reload
Create a dav folder for 'Mike': (The exact location may be different for you)
Code:
mkdir /var/www/clients/client4/www.mysite.com/web/clients/dav/mike
Only allow root and www-data group members to access. Then set permissions:
Code:
chgrp root:www-data /var/www/clients/client4/www.mysite.com/web/clients/dav/mike
chmod 640 /var/www/clients/client4/www.mysite.com/web/clients/dav/mike

Create the htpasswd file and add the user 'mike'. The -c flag creates the file if it doesn't already exist. *Only* use it the first time. You will be asked for the password you wish 'mike' to use.
Code:
htpasswd -c /var/www/clients/client4/www.mysite.com/web/clients/dav/mike/.DAVlogin mike
I then go to my ISPc3 control panel and log in.
I go to the 'Sites' tab
Click on 'www.mysite.com'
Go to 'Options'

In the 'Apache Directives' field I paste in:
Code:
DAVLockDB /tmp/DAVLock
#DAVMinTimeout 600

<Location /clients/client4/www.mysite.com/web/clients/dav/mike/>
        Dav On

        AuthType Basic
        AuthName mike
        AuthUserFile /var/www/clients/client4/www.mysite.com/web/clients/dav/mike/.DAVlogin

        <LimitExcept OPTIONS>
                Require user mike
        </LimitExcept>
</Location>
Save and log out of ISPc3

Restart apache
Code:
/etc/init.d/apache2 restart
I more or less have to repeat this whole thing for each WebDav user I want to create.

Is this going to work?

Is there a more elegant way, especially given that I will need to create further password protected Dav folders for other users?

Thanks guys! :-)

S

Last edited by smartin; 12th January 2010 at 17:06.
Reply With Quote
Sponsored Links
  #2  
Old 14th January 2010, 13:53
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi,

Sadly have to report that this *will not* work...

Things that are tripping me up:

I thought the command to add a directory to several groups (root and www.data in this case) was
Code:
chgrp root:www.data directoryname
But I get:
chgrp: invalid group: `root:www-data'

I have given the dav folder permissions of 640 775 and 777 but nothing works.

When I try to access the folder through a browser I get 'Access forbidden'

My log is saying:
[Thu Jan 14 12:43:42 2010] [error] [client 192.168.0.6] Directory index forbidden by Options directive: /var/www/www.mytestsite.co.uk/web/davtest/

Does anyone have any ideas to get me past this?

I'd really appreciate it :-)

S
Reply With Quote
  #3  
Old 15th January 2010, 13:23
falko falko is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
chgrp root:www.data directoryname
The correct group name is www-data, not www.data.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #4  
Old 15th January 2010, 15:17
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
The correct group name is www-data, not www.data.
Falko,

I was hoping you'd show up... ;-)

That must be a typo in my post here. Sorry. The error message from Terminal had it correct as www-data not www.data so I must have got it right in my command originally.

Any other ideas as to why things aren't working?

The message from my error log makes me think the issue is in the code I pasted into the options field in ISPc3...? I just don't know enough to spot the issue.

Code:
DAVLockDB /tmp/DAVLock
#DAVMinTimeout 600

<Location /clients/client4/www.mysite.com/web/clients/dav/mike/>
        Dav On

        AuthType Basic
        AuthName mike
        AuthUserFile /var/www/clients/client4/www.mysite.com/web/clients/dav/mike/.DAVlogin

        <LimitExcept OPTIONS>
                Require user mike
        </LimitExcept>
</Location>
What are your thoughts?

S
Reply With Quote
  #5  
Old 16th January 2010, 15:23
falko falko is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Are you sure that the path in <Location /clients/client4/www.mysite.com/web/clients/dav/mike/>
is correct?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 19th January 2010, 10:33
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
Are you sure that the path in <Location /clients/client4/www.mysite.com/web/clients/dav/mike/>
is correct?
Falko,

It seems the path wasn't correct (thanks :-) but I *still* can't get things right...

This is what I just did...

Code:
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# locate davtest
/var/www/clients/client1/web1/web/davtest
/var/www/clients/client1/web1/web/davtest.DAVlogin
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# htpasswd -c /var/www/clients/client1/web1/web/davtest/.Davlogin davtest
New password: 
Re-type new password: 
Adding password for user davtest
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# /etc/init.d/apache2 restart
 * Restarting web server apache2
   ...done.
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# chgrp root:www-data /var/www/clients/client1/web1/web/davtest
chgrp: invalid group: `root:www-data'
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# chmod 640 /var/www/clients/client1/web1/web/davtest
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# /etc/init.d/apache2 restart
 * Restarting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
   ...fail!
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# /etc/init.d/apache2 restart
 * Restarting web server apache2
httpd (no pid file) not running
   ...done.
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# /etc/init.d/apache2 restart
 * Restarting web server apache2
   ...done.
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log#
I created the directory 'davtest' using my ftp client first, then searched for it... I still get the error:

Code:
ERROR 403 - Forbidden!
The following error occurred:

You are not permitted to access the requested URL.

Please contact the webmaster with any queries.
My error log says:
Code:
[Tue Jan 19 09:14:34 2010] [crit] [client 192.168.0.6] (13)Permission denied: /var/www/www.myothersite.co.uk/web/davtest/.htaccess pcfg_openfile: unable to check htaccess$
These are the permissions:
Code:
root@mybox:/var/www/clients/client1/web1/web# ls -a -l
total 36
drwxr-xr-x 5 web1     client1 4096 2010-01-14 13:50 .
drwxr-xr-x 6 root     root    4096 2009-06-09 11:38 ..
drw-r----- 2 www-data client1 4096 2010-01-19 09:06 davtest
-rw-r--r-- 1 root     root      22 2010-01-14 14:08 davtest.DAVlogin
drwxr-xr-x 2 web1     client1 4096 2009-06-09 10:48 error
-rwxr-xr-- 1 web1     client1 1406 2009-06-09 10:48 favicon.ico
-rwxr-xr-- 1 web1     client1    0 2009-06-09 10:48 .htaccess
-rwxr-xr-- 1 web1     client1 1861 2009-06-09 10:48 index.html
-rwxr-xr-- 1 web1     client1   34 2009-06-09 10:48 robots.txt
drwxr-xr-x 2 web1     client1 4096 2010-01-15 00:30 stats
lrwxrwxrwx 1 root     root      16 2009-06-09 12:12 webmail -> /var/www/webmail
Make any sense?

Thanks for your help as always...

(Why do I get those apache errors on restart btw...? They go away on the third attempt...)

S
Reply With Quote
  #7  
Old 20th January 2010, 13:32
falko falko is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Directories must always be executable, so oyu should try a
Code:
chmod 751 davtest
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 20th January 2010, 14:41
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko View Post
Directories must always be executable, so oyu should try a
Code:
chmod 751 davtest
Falko,

Really sorry but after
Code:
root@mybox:/var/www/clients/client1/web1/web# ls -a -l
total 36
drwxr-xr-x 5 web1     client1 4096 2010-01-14 13:50 .
drwxr-xr-x 6 root     root    4096 2009-06-09 11:38 ..
drw-r----- 2 www-data client1 4096 2010-01-19 09:06 davtest
-rw-r--r-- 1 root     root      22 2010-01-14 14:08 davtest.DAVlogin
drwxr-xr-x 2 web1     client1 4096 2009-06-09 10:48 error
-rwxr-xr-- 1 web1     client1 1406 2009-06-09 10:48 favicon.ico
-rwxr-xr-- 1 web1     client1    0 2009-06-09 10:48 .htaccess
-rwxr-xr-- 1 web1     client1 1861 2009-06-09 10:48 index.html
-rwxr-xr-- 1 web1     client1   34 2009-06-09 10:48 robots.txt
drwxr-xr-x 2 web1     client1 4096 2010-01-15 00:30 stats
lrwxrwxrwx 1 root     root      16 2009-06-09 12:12 webmail -> /var/www/webmail
root@mybox:/var/www/clients/client1/web1/web# chmod 751 davtest
root@mybox:/var/www/clients/client1/web1/web# /etc/init.d/apache2 restart
 * Restarting web server apache2
   ...done.
root@mybox:/var/www/clients/client1/web1/web#
I still get the 403 error above.

Log:
Code:
[Wed Jan 20 13:26:19 2010] [error] [client 192.168.0.6] Directory index forbidden by Options directive: /var/www/www.myothersite.co.uk/web/davtest/
I notice above that the directory davtest is in the group www-data and the davtest.DAVlogin file is in the group root.

I'm guessing this is significant (?) but I get the error here:
Code:
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# chgrp root:www-data /var/www/clients/client1/web1/web/davtest
chgrp: invalid group: `root:www-data'
This is what's in the 'Options' field in the relevant site in ISPc3:
Code:
DAVLockDB /var/lock/apache2/DAVLock
#DAVMinTimeout 600

<Location /var/www/clients/client1/web1/web/davtest>
        Dav On

        AuthType Basic
        AuthName davtest
        AuthUserFile /var/www/clients/client1/web1/web/davtest/.DAVlogin

        <LimitExcept OPTIONS>
                Require user davtest
        </LimitExcept>
</Location>
Should the web address be in there somewhere?

Thanks for your time with this! I'm sure it's a newb mistake I'm making but I have done this many times on a non-ISPc3 server so it's something specific to this server...

S

Last edited by smartin; 20th January 2010 at 14:46.
Reply With Quote
  #9  
Old 21st January 2010, 15:29
falko falko is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Quote:
Originally Posted by smartin View Post
I'm guessing this is significant (?) but I get the error here:
Code:
root@mybox:/var/www/clients/client1/www.myothersite.co.uk/log# chgrp root:www-data /var/www/clients/client1/web1/web/davtest
chgrp: invalid group: `root:www-data'
The chgrp command jujst takes the group name as argument, not a user and a group. What you want is chown instead:

Code:
chown root:www-data /var/www/clients/client1/web1/web/davtest
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #10  
Old 21st January 2010, 15:40
smartin smartin is offline
Member
 
Join Date: Dec 2007
Posts: 82
Thanks: 3
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by falko View Post
The chgrp command jujst takes the group name as argument, not a user and a group. What you want is chown instead:

Code:
chown root:www-data /var/www/clients/client1/web1/web/davtest
Falko,

I'm so sorry but I get the same error as before.

I did restart apache with "/etc/init.d/apache2 restart". Do I need another command?

The log says:
Code:
[Thu Jan 21 14:36:58 2010] [error] [client 192.168.0.6] Directory index forbidden by Options directive: /var/www/www.myothersite.co.uk/web/davtest/
Any other thoughts? This ought to be possible to do? Yes?

S
Reply With Quote
Reply

Bookmarks

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
Trouble with Postfix setup not working wmkconn Server Operation 13 9th April 2008 21:45
setup mail on dynamic IP. kameleon25 Installation/Configuration 2 24th January 2008 13:22
The Perfect Setup - SuSE 10.1 (32-bit) - Qouta Issues ? ezfilez HOWTO-Related Questions 3 26th September 2006 18:09
How setup Tomcat JSP on FC5 QuikeMore Suggest HOWTO 1 9th September 2006 14:45
Xen 3.0 Setup For Debian newb problem-No network connectivity on first dom0 boot BCNW HOWTO-Related Questions 4 22nd August 2006 14:24


All times are GMT +2. The time now is 22:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.