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 17th August 2012, 14:58
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
Post Getting ajaxplorer to work with multiserver ISPC (no real integration)

I tried (and managed) to get ajaxplorer working with a multiserver setup of ISPConfig 3.
It is not fully integrated but uses the remoting api to get the right server for a ftp user.

This does only work with latest svn version of ISPConfig as I added a small function to the remoting.

Step 1:
Install Ajaxplorer as usual
Be sure you have configured everything you want with the admin user before you proceed. Admin login is currently no longer working after completing the following steps, so you have to revert them temporarily if you need to login as admin again.

Step 2:
Create a remote user in ispconfig. This user needs the "Server functions" and "FTP-User functions" rights, nothing else.

Step 3:
Change the conf/bootstrap_plugins.php section
PHP Code:
        "AUTH_DRIVER" => array(
                
"NAME"          => "ftp",
                
"OPTIONS"       => array(
                        
"LOGIN_REDIRECT"                => false,
                        
"REPOSITORY_ID"             => "ispc_ftp",
                        
"ADMIN_USER"                => "admin",
                        
"FTP_LOGIN_SCREEN"      => false,
                        
"AUTOCREATE_AJXPUSER"   => true,
                        
"TRANSMIT_CLEAR_PASS"   => true,
                )
        ), 
Step 4:
Add this as the first(!) repository in conf/bootstrap_repositories.php
PHP Code:
$REPOSITORIES["ispc_ftp"] = array(
        
"DISPLAY"       => "Web FTP",
        
"DRIVER"        => "ftp",
        
"DRIVER_OPTIONS"=> array(
            
"FTP_HOST"       => "localhost",
            
"FTP_PORT"      => "21",
            
"FTP_SECURE"   => false,
            
"DEFAULT_RIGHTS"    => "rw",
            
"USE_SESSION_CREDENTIALS"   => true,
            
"FIX_PERMISSIONS" => "detect_remote_user_id",
            
"TMP_UPLOAD" => "/tmp"
        
)
); 
Do not change the FTP_HOST, it is determined automatically later.
You can change the DISPLAY setting if you like.
If you want SSL connections to the ftp server you can set FTP_SECURE to true.

I deleted all other repositories from the file, except ajaxp_shared and ajxp_conf.


Step 5:
in file plugins/auth.ftp/class.ftpAuthDriver.php add a new method to the class:
PHP Code:

class ftpAuthDriver extends AbstractAuthDriver {
    
// stripped content

function get_ispc_host($username) {
       
// connect to ispc via remoting and read ftp user
       
$server '';             
       
$login 'YOURREMOTEUSER';
       
$pass 'YOURREMOTEPASS';
       
       
$soap_uri 'http://your.server.com:8080/remote/';
       
$soap_location $soap_uri 'index.php';

       
$client = new SoapClient(null, array('location' => $soap_location'uri'      => $soap_uri));
       try {
           if(
$session_id $client->login($login,$pass)) {
               
$check $client->sites_ftp_user_server_get($session_id$username);
               if(
$check) {
                   
$server = isset($check['ip_address']) ? $check['ip_address'] : $check['hostname'];
               }

               
$client->logout($session_id);
          }
      } catch (
SoapFault $e) {
      }

      return (
$server != '' $server 'localhost');
}

// stripped content

Step 6:
Search for function checkPassword($login, $pass, $seed)
In this function add after
PHP Code:
               $repoId $this->options["REPOSITORY_ID"]; 
this
PHP Code:
                $repository ConfService::getRepositoryById($repoId);
                
$_SESSION['ISPC_HOST'] = $this->get_ispc_host($login);
                
$repository->addOption('FTP_HOST'$_SESSION['ISPC_HOST']); 
Step 7:
In file plugins/access.ftp/class.ftpAccessDriver.php search for function initRepository() - should be around line 55.
add after
PHP Code:
                $this->urlBase $wrapperData["protocol"]."://".$this->repository->getId(); 
this
PHP Code:
                if(isset($_SESSION['ISPC_HOST'])) {
                        
$this->repository->addOption('FTP_HOST'$_SESSION['ISPC_HOST']);
                        
ConfService::tmpReplaceRepository($this->repository);
                } 
and around line 221 replace
PHP Code:
return is_writable($path); 
with
PHP Code:
return true
This leads to ajaxexplorer showing the raw ftp errors like "ftp_fput() permission denied" instead of "Cannot write file ... " but makes it working at least as ajaxplorer compares the file's owner uid with the login name. This differs due to virtual users in ispconfig pureftp.


This should be everything that is needed.

What is done:
On login (checkPassword method) a function is called that calls the ISPConfig remoting api and gets some server infos for the given ftp user.
It then returns the server-ip (or hostname) and overwrites the Ajaxplorer repository config temporarily.

No warranty for this howto, as always Use at your own risk.
__________________
Marius Cramer

pixcept KG

Last edited by Croydon; 18th August 2012 at 10:22.
Reply With Quote
The Following 3 Users Say Thank You to Croydon For This Useful Post:
cfoe (17th August 2012), falko (18th August 2012), till (17th August 2012)
Sponsored Links
  #2  
Old 17th August 2012, 16:20
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
Default

There is a "dirty" quick fix if you need to login as admin later on.

Step 1:
Login to ISPConfig as admin and goto System -> Interface -> Main config

Step 2:
Remove the [CLIENTNAME] from the ftp user prefix field and save it.

Step 3:
Create a new ftp user named "admin" at any website.

Step 4:
Wait for the ftp user to be created and then reinsert the [CLIENTNAME] to the field at step 2 and save it.

Step 5:
Login with the new "admin" ftp user to ajaxplorer.
__________________
Marius Cramer

pixcept KG
Reply With Quote
  #3  
Old 24th October 2013, 18:47
ferra ferra is offline
Junior Member
 
Join Date: Mar 2010
Posts: 17
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hi Croudon, I'm trying to follow your howto, using ISPConfig 3.0.5.3 and pydio-5.0.4.
Pydio is installed and running. I cannot find the file conf/bootstrap_plugins.php,
just a symbolic link to /etc/pydio/bootstrap_plugins.php, but there is no bootstrap_plugins.php.

Any help?

Thanks
Reply With Quote
  #4  
Old 25th October 2013, 09:27
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 927
Thanks: 16
Thanked 261 Times in 208 Posts
 
Default

Sorry, I don't hink I can help there. The howto was for Ajaxplorer 4, I did not get V5 running, either.
__________________
Marius Cramer

pixcept KG
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
Net2ftp integration. vsevolod Tips/Tricks/Mods 38 18th October 2013 12:34
Cron issue in Debian 6 Nolan Installation/Configuration 6 18th April 2011 16:36
Multiserver install: what did I do wrong and how is it supposed to work? Rowdy Installation/Configuration 11 12th May 2010 09:43
ISPc with frontal and specialized work for PC servers DreamK Tips/Tricks/Mods 1 8th February 2010 10:33
Upgraded and all webs work but dont show in ISPC grandpagenocide General 3 10th April 2008 14:18


All times are GMT +2. The time now is 13:51.


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