Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st March 2010, 13:57
Steveorevo Steveorevo is offline
Member
 
Join Date: Feb 2010
Posts: 33
Thanks: 6
Thanked 6 Times in 5 Posts
Default Fix WebDAV with PHP (files execute instead of GET)

There is bug that I've come across when running ISPConfig 2.2.35 where getting PHP files via WebDAV pulls down the executed script vs. the actual PHP content.

To fix this problem you'll want to add directives via ISPConfig's Apache Directives (Optional) setting. I add the following that prevents PHP scripts from executing when downloading via WebDAV

# Fix for PHP WebDAV
<IfModule mod_dav.c>
<Location /webdav>
php_value engine off
</Location>
</IfModule>

WebDAV is an excellent alternative to FTP because it can be secure (with optional SSL), HTTP(S) is optimized on most routers and networks, and its fast as hell. Its also supported on various OS's natively from OS X to Windows, and in 'professional' web IDEs like Dreamweaver (for designers) and phpED (for developers). With this fix I can develop faster using Dw and www.themedreamer.com developing WordPress themes.
Reply With Quote
The Following 2 Users Say Thank You to Steveorevo For This Useful Post:
falko (2nd March 2010), till (3rd March 2010)
Sponsored Links
  #2  
Old 26th October 2010, 12:19
Steveorevo Steveorevo is offline
Member
 
Join Date: Feb 2010
Posts: 33
Thanks: 6
Thanked 6 Times in 5 Posts
Default Additional fix for WordPress

Hey Guys, I just wanted to followup as I've been having new problems crop up with WordPress. Alot of clients use WebDAV and WordPress with its 'Permalinks' feature. It does this by using .htaccess rules. I noticed that cPanel clients don't have a problem but ISPConfig does.

Apparently cPanel creates a whole new sub-domain for webdav services webdav.yoursite.com (not a fan) with <Directory> directives of "AllowOverride None" to prevent even reading .htaccess.

In ISPConfig this won't work, as adding <directory> directives would then break WordPress's permalinks, and the <Location> directives parse after reading .htaccess (again, which is how WordPress does permalinks).

I found that to eliminate this problem, just add the line "Rewrite engine off" to the fix I had above. This will allow popular WordPress users with permalinks + WebDAV to work seamlessly. Sure beats having to login into WordPress's control panel, and then toggle permalinks on/off everytime one needs to upload a new file.

So the new fix would look like this:

# Fix for PHP WebDAV
<IfModule mod_dav.c>
<Location /webdav>
php_value engine off
Rewrite engine off
</Location>


Regards,
Steve

Last edited by Steveorevo; 26th October 2010 at 12:25.
Reply With Quote
The Following User Says Thank You to Steveorevo For This Useful Post:
falko (27th October 2010)
  #3  
Old 26th August 2011, 09:56
Steveorevo Steveorevo is offline
Member
 
Join Date: Feb 2010
Posts: 33
Thanks: 6
Thanked 6 Times in 5 Posts
 
Default

Nothing needs to be removed, rather, you should add the code above to the ISPConfig 2's "Apache Directives (Optional):" textbox on a site's definition.

WebDAV is fast, but note that it does have different file permissions then FTP. Uploading a file via WebDAV may prevent that file from executing with read/write proper privileges (i.e. having wordpress install plugins, etc.). A faster alternative to FTP and WebDAV is to use SSH as file system. If you are on a mac, using MacFUSE is ideal.
Reply With Quote
Reply

Bookmarks

Tags
download, execute, php, run, webdav

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
Cannot add Mailboxes after PHP-Update hfr Installation/Configuration 5 7th November 2009 20:09
PHP code for PHPMyAdmin is not parsed parkerj Installation/Configuration 3 26th May 2009 13:40
ISPConfig virtual web pages not working mike_phi Installation/Configuration 8 7th May 2008 16:51
Power failiure Wwamphyri General 6 24th February 2007 21:21


All times are GMT +2. The time now is 16:58.


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