Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st August 2010, 12:01
ahrasis ahrasis is offline
Junior Member
 
Join Date: Aug 2010
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default eXtplorer for ISPconfig 3

Hi,

I am attempting to use eXtplorer for my ISPconfig 3 (Perfect Server Ubuntu 10.04).

Firstly, I am going to download eXtplorer and extract it at /usr/share/filemanager.

Second, I am going to set correct permission so eXtplorer can work in the browser.

Third, I will share it with other user ln -s /usr/share/filemanager/ /var/www/filemanager.

Fourth, I intend to make eXtplorer to use ISPconfig 3 database particularly ftp user(s) table that it created. This is where I am now.

As far as I know, eXtplorer can call or use database when it is installed as a component to Joomla. However, I am not sure how it works.

Anybody here who is willing to help on this? It is nicer to have a file manager for ISPconfig 3 which its every user can share.

Thanks in advance.
Reply With Quote
Sponsored Links
  #2  
Old 21st August 2010, 15:26
ahrasis ahrasis is offline
Junior Member
 
Join Date: Aug 2010
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I guess it is not that easy to make this work.

Anyway, I play around and find out that I need to create a plugin and enable it before every site created under ISPconfig 3 can automatically use /filemanager like they use /phpmyadmin and /webmail.

I am creating one using the available plugins as sample. The problem is, how do I enable it.
Code:
<?php

/*
Copyright (c) 2007 - 2009, Till Brehm, projektfarm Gmbh
All rights reserved.
Modification (c) 2009, Marius Cramer, pixcept KG 

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

class fm_symlink_plugin {
	
	var $plugin_name = 'fm_symlink_plugin';
	var $class_name = 'fm_symlink_plugin';
	
    var $action;
    
	//* This function is called during ispconfig installation to determine
	//  if a symlink shall be created for this plugin.
	function onInstall() {
		global $conf;
		
        return false;
		
	}
	
		
	/*
	 	This function is called when the plugin is loaded
	*/
	
	function onLoad() {
		global $app;
		
		/*
		Register for the events
		*/
		
		$app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert');
		$app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update');
	}
	
	function insert($event_name,$data) {
		global $app, $conf;
		
		$this->action = 'insert';
		// just run the update function
		$this->update($event_name,$data);
	}
	
	function update($event_name,$data) {
		global $app, $conf;
		
		if($this->action != 'insert') $this->action = 'update';
		
		if($data["new"]["type"] != "vhost" && $data["new"]["parent_domain_id"] > 0) {
			
			$old_parent_domain_id = intval($data["old"]["parent_domain_id"]);
			$new_parent_domain_id = intval($data["new"]["parent_domain_id"]);
			
			// If the parent_domain_id has been chenged, we will have to update the old site as well.
			if($this->action == 'update' && $data["new"]["parent_domain_id"] != $data["old"]["parent_domain_id"]) {
				$tmp = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$old_parent_domain_id." AND active = 'y'");
				$data["new"] = $tmp;
				$data["old"] = $tmp;
				$this->action = 'update';
				$this->update($event_name,$data);
			}
			
			// This is not a vhost, so we need to update the parent record instead.
			$tmp = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$new_parent_domain_id." AND active = 'y'");
			$data["new"] = $tmp;
			$data["old"] = $tmp;
			$this->action = 'update';
		}
		
		if($data["new"]["document_root"] == '') {
			$app->log("document_root not set",LOGLEVEL_WARN);
			return 0;
		}
		
        $symlink = true;
        if($data["new"]["php"] == "suphp") $symlink = false;
        elseif($data["new"]["php"] == "cgi" && $data["new"]["suexec"] == "y") $symlink = false;
        elseif($data["new"]["php"] == "fast-cgi" && $data["new"]["suexec"] == "y") $symlink = false;
        
        
        if(!is_dir($data["new"]["document_root"]."/web")) exec("mkdir -p ".$data["new"]["document_root"]."/web");
        if($symlink == false) {
            if(is_link($data["new"]["document_root"]."/web/filemanager")) exec("rm -f ".$data["new"]["document_root"]."/web/filemanager");
        } else {
            if(!is_link($data["new"]["document_root"]."/web/filemanager")) exec("ln -s /var/www/filemanager ".$data["new"]["document_root"]."/web/filemanager");
            else exec("ln -sf /var/www/filemanager ".$data["new"]["document_root"]."/web/filemanager");
        }
	}
	

} // end class

?>

Please do check and help give some directions / ideas / suggestions.



Thanks in advance.
Reply With Quote
  #3  
Old 21st August 2010, 18:32
ahrasis ahrasis is offline
Junior Member
 
Join Date: Aug 2010
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Really I dont know how the code works, because it doesn't. I will have to create for each sites using ln -s /usr/share/filemanager/ /var/www/clientx/webx/web then.

In the mean time, I am trying to see how it basically shares Joomla users and their permissions in order to use ftp login as its login.
Reply With Quote
  #4  
Old 21st August 2010, 18:41
Horfic Horfic is offline
Senior Member
 
Join Date: Mar 2009
Location: Austria
Posts: 322
Thanks: 55
Thanked 89 Times in 54 Posts
Send a message via Skype™ to Horfic
Default

why don't you create the vhost for /filemanager manually for apache?

That is so much easier!
__________________
web wack creations - We create your custom web application
Mailuser interface for ISPConfig 3
Reply With Quote
  #5  
Old 24th August 2010, 20:09
astewart astewart is offline
Member
 
Join Date: Feb 2007
Posts: 95
Thanks: 1
Thanked 7 Times in 7 Posts
Default

Tried that but no luck.
I created the following vhost file in the '/etc/apache2/sites-available' then created a symlink of it in '/etc/apache2/sites-enabled'

It contains the following:
Quote:
Alias /explorer /usr/share/explorer

<Directory /usr/share/explorer>
Options Indexes FollowSymLinks
<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>
<IfModule mod_php5.c>
php_flag register_globals off
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
Restarted Apache but no luck
Reply With Quote
  #6  
Old 25th August 2010, 02:01
ahrasis ahrasis is offline
Junior Member
 
Join Date: Aug 2010
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Horfic View Post
why don't you create the vhost for /filemanager manually for apache?

That is so much easier!
How does it work. Any tutorial?

So far I manage to get eXtplorer to work well on all subdomain via clientdomain/filemanager. I use similar method allow webmail to be open from clientdomain/webmail/ . This is the same as phpmyadmin method but I dont how to automate this like phpmyadmin do.

Btw, I haven't finish learning from Joomla + eXtplorer yet.
Reply With Quote
  #7  
Old 25th August 2010, 07:42
Horfic Horfic is offline
Senior Member
 
Join Date: Mar 2009
Location: Austria
Posts: 322
Thanks: 55
Thanked 89 Times in 54 Posts
Send a message via Skype™ to Horfic
Default

Try this, not tested. (It's just a modified phpmyadmin default vhost)
Code:
# eXtplorer default Apache configuration

Alias /explorer /usr/share/explorer

<Directory /usr/share/explorer>
        Options Indexes FollowSymLinks
        DirectoryIndex index.php

        <IfModule mod_php4.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>
        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>
</Directory>
PS: Don't forget to restart apache, after creating and symlinking the file.
__________________
web wack creations - We create your custom web application
Mailuser interface for ISPConfig 3
Reply With Quote
  #8  
Old 25th August 2010, 11:59
ahrasis ahrasis is offline
Junior Member
 
Join Date: Aug 2010
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Horfic View Post
Try this, not tested. (It's just a modified phpmyadmin default vhost)
Code:
# eXtplorer default Apache configuration

Alias /explorer /usr/share/explorer

<Directory /usr/share/explorer>
        Options Indexes FollowSymLinks
        DirectoryIndex index.php

        <IfModule mod_php4.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>
        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>
</Directory>
PS: Don't forget to restart apache, after creating and symlinking the file.
Thank you very much. I'll be testing it by this weekend. I'll announce the result here thereafter.
Reply With Quote
  #9  
Old 17th October 2010, 16:04
Erih-Gres Erih-Gres is offline
Junior Member
 
Join Date: Oct 2010
Location: Crimea, Sevastopol
Posts: 11
Thanks: 6
Thanked 2 Times in 1 Post
Default

Before start make:

Code:
sudo apt-get install pwgen
pwgen
And select one word. Remember this secret word!
Replace MyPasswd to your secret word.

Create directory for extplorer:

...

Last edited by Erih-Gres; 18th October 2010 at 14:34.
Reply With Quote
  #10  
Old 17th October 2010, 16:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
 
Default

The part that you describe in "reconfigure ispconfig" will make your setup incompatible to updates and is really insecure. The salt in a password should be different for every and not a static word as you open the password database for dictionary attackes.

Instead of modifying ispconfig, you should use a correct routine to create salts in extplorer e.g by using the salt creation routine from ispconfig.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
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


All times are GMT +2. The time now is 11:07.


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