How to get ssl file names in config.lib.php

Discussion in 'Developers' Forum' started by JGZimmerle, Jun 12, 2007.

  1. JGZimmerle

    JGZimmerle ISPConfig Developer ISPConfig Developer

    Hi!

    I am trying to get ISPConfig to add SSL information to the vsftpd config files, to automatically get FTPS enabled with the web's SSL certificates, if both SSL and FTP are enabled. I have everything working except for one little thing:

    Can anyone tell me how I can get the filenames of the SSL certificate and key files at line 1992 of ispconfig/scripts/lib/config.lib.php (ISPConfig 2.2.13)?

    I have tried
    Code:
    $crt_file = $document_root ."/ssl/". $hostname .".". $domainname .".crt";
    and
    Code:
    $crt_file = $document_root ."/ssl/". $web["web_host"] .".". $web["web_domain"] .".crt";
    but apparently $hostname, $domainname, $web["web_host"] and $web["web_domain"] are not defined here.

    TIA
     
  2. falko

    falko Super Moderator ISPConfig Developer

    $web["web_host"] and $web["web_domain"] should work...
     
  3. JGZimmerle

    JGZimmerle ISPConfig Developer ISPConfig Developer

    You are right, I don't know why they didn't before, but now they work. :)

    I'll put a post with the mod on the mods board.

    Edit: I have just found out why it did not work before: When anonymous FTP is not enabled for a web, $web["web_host"] and $web["web_domain"] are not defined. Maybe the problem is at line 1909?
     
    Last edited: Jun 13, 2007
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, the $web variable is only filled for anonftp hosts. You can get the hostname and domain of the first website of this IP with the command:

    Code:
    $rec = $mod->db->queryOneRecord("SELECT * FROM isp_nodes,isp_isp_web WHERE isp_isp_web.server_id = '$server_id' AND isp_nodes.doc_id = isp_isp_web.doc_id AND isp_nodes.doctype_id = '".$this->web_doctype_id."' AND isp_nodes.status = '1' AND isp_isp_web.web_ip = '".$ip["server_ip"]."'");
     
  5. JGZimmerle

    JGZimmerle ISPConfig Developer ISPConfig Developer

    This is not what I need, though. I need the hostname and domain of this IP, wich has SSL enabled. I got it working, though.
     

Share This Page