ISPConfig3 plugable mail subsystem (for Google Apps) and nginx as alternative

Discussion in 'Developers' Forum' started by eugenesan, Dec 27, 2008.

  1. eugenesan

    eugenesan New Member

    ISPConfig3 support for external mail (Google Apps) and nginx as alternative webserver

    Hi all,

    Recently I was forced to migrate from dedicated to VPS.

    Maybe I am too optimistic, but after small battle with low resources I've came with 3 decisions:

    1) ISPConfig3 will be the CP (mydns support and single language code were main reasons).

    2) Google Apps will replace mail subsystem (Saves tens of MB and solves spam headache). Therefore whole mail/spam supporting code must be disabled and replaced with simple DNS settings.

    3) Nginx will be used instead of Apache.

    Now, since I am pretty new to ISPConfig and a lot of work expected, it will be really nice to hear your ideas and if I'll have some luck even receive some code drafts from you ;-)

    BTW: If some is interested I've built updated Ubuntu source for MyDNS 1.2.8.15.
     
    Last edited: Jan 30, 2009
  2. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    2) There has no code to be changed. Just installl ispconfig 3 and then go to system > users and uncheck the checkbox for mail for the admin user.

    3) Nginx is not supported, but you can write plugin for it which simply replaces the apache plugin. Just take a look at the apache plugin in /usr/local/ispconfig3/server/plugins-available/ and write a new plugin for nginx.
     
  3. eugenesan

    eugenesan New Member

    Thanks for the tip.

    I am currently trying to understand relation between object/modules.
    Are they all totally independent when items created?

    For ex. when I add add site, does ISPC creates also DNS records for it?

    Is ISPC will be affected by disabling all mail related services? Is it going to restart them at some point ad fail, lets say on DNS changes?
     
  4. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    yes.

    no.

    No. ISPConfig is a multi server control panel, ist is built so that services are independant and dont have to be installed on the same server or be installed at all.
     
  5. eugenesan

    eugenesan New Member

    Thanks for information.
    After install script inspection, I've also noticed same level of modules separation on install stage, very smart!

    Are there any plans for more "user-friendly" modules? Maybe some work already done in this area?

    And are myDNS System->Server Config->Nameservers used as upstream DNS?

    Automated DNS zone, as an option, on site creation would be really nice.
    In addition two NS (ns1,ns2) records by default is good choice also.

    BTW: 3rd version looks very nice and solid, nice work.
     
  6. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    The modules are laready very user friendly. They are separated as this is nescessary and this will not be changed. Otherwise you would not be able to run ispconfig without mail system ;)

    We will add some more wizards later.

    Thats already included. Take a look at the dns wizard.
     
  7. eugenesan

    eugenesan New Member

    Looks like I was playing with too old version (3.0.0.7) :-(.

    Just found latest RC :)
     
  8. eugenesan

    eugenesan New Member

    Hi all,

    After many hours of learning, coding and testing I have nginx plugin for ISPC3.
    Currently it lacks SSL support but I've added protected folders support, hope it can be easily extended for apache plugin.
    I'll post it soon for review.

    Meanwhile I am going to deal with automatic DNS creation.
    Here I need help, what would be most rational way to perform that?
    I was thinking of creating tasks for DNS creation when apropriate option selected on site creation.
    How can I "stream" such an actions to sys_datalog?
     
  9. eugenesan

    eugenesan New Member

    Hi all,

    Here it comes, Nginx support for ISPC.

    Basic support only:
    1) No installation support
    2) No automatic configuration of ISPC web.
    3) No SSL support.
    4) Currently only supports php-fpm as php fastcgi engine.
    5) Tested and built on Debian based system, sorry rpm guys.

    Few notes for maintainers:
    *) I had to dos2unix few files so take it into account when diffing.
    *) I've changed in some places hard coded references to apache by webserver.

    To use:
    *) Install php-fpm and mydns (google or contact me for patches for Debian based distros)
    *) apply patch
    *) install without web
    *) configure ISPC in nginx by adding /etc/nginx/available-sites/ispconfig with next content:
    Code:
    # ISPConfig virtual host
    
    server {
    	listen   8080;
    	server_name  _;
    
    	access_log  /var/log/nginx/ispconfig.access.log;
    
    	location / {
    		root   /usr/local/ispconfig/interface/web/;
    		index  index.php;
    	}
    
    	# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    	#
    	location ~ \.php$ {
    		fastcgi_pass   127.0.0.1:9000;
    		fastcgi_index  index.php;
    		fastcgi_param  SCRIPT_FILENAME  /usr/local/ispconfig/interface/web//$fastcgi_script_name;
    		include /etc/nginx/fastcgi_params;
    	}
    
    	# deny access to .htaccess files, if Apache's document root
    	# concurs with nginx's one
    	#
    	location ~ /\.ht {
    		deny  all;
    	}
    }
    
    make link to /etc/nginx/enabled-sites/ and restart nginx.
    If I didn't forget something, ISPC should be operational.
    *) Now enter ISPC web and go to system->edit server->select server->config. Here modify next:
    Code:
    [web]
    website_path=/var/clients/client[client_id]/web[website_id]
    website_symlinks=/var/www/[website_domain]/:/var/clients/client[client_id]/[website_domain]/
    vhost_conf_dir=/etc/nginx/sites-available
    vhost_conf_enabled_dir=/etc/nginx/sites-enabled
    
    [global]
    webserver=nginx
    
    *) if brave and going to update existing DB perform next changes:

    Code:
    -  `apache_directives` text,
    +  `webserver_directives` text,
    +  `protected_folders` text,
    

    Waiting for feedbacks.
     

    Attached Files:

  10. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    Hi,

    thank you very much for the patch. I'am not able to add it to SVN at the moment as there is a feature freeze until the final version but I will add it as soon as the final gets released.

    One problem that I see with the patch is that you renamed some fields in the database and the logging directory which breaks the compatibility to existing ispconfig installations so that an update will fail when the patch gets applied to svn. We will have to find a workaround for this or rename the fields and folders to its original names.
     
  11. eugenesan

    eugenesan New Member

    Hi,

    I understand the problem. But on other hand calling everything webserver related as "apache" is not good idea :).
    May you can push only changes that are not feature related as tables and folders names? That won't cause any problem now and will solve problems in future. Anyways no body was expecting RC to be 100% compatible to final. right?
     
  12. till

    till Super Moderator Howtoforge Staff HowtoForge Supporter ISPConfig Developer

    With RC1 we had a complete feature freeze, so nothing that is not a bugfix gets into SVN anymore until we release the final version. Especially renaming tables is not possible during feature freeze. To rename the tables we would have to expand the installer first and add conditional code that repairs the installations after the table changes. There are already several thousand installations of ISPConfig 3 out there and I know several which are production systems, so we can not even break the compatibility between RC1 and Final.

    I really like your plugin but it can be integrated first after the final release.
     
  13. eugenesan

    eugenesan New Member

    No problem, I am not on hurry with the patch.
    I was trying to ease the pane of core modification.

    Later, after I'll finish testing and fixing possible nginx runtime problems, I'll work on installation part.

    Currently I've found some DB related issues and reported them in bug tracker, take a look at them please. They can become real pain for un-experienced user.

    Now, I still want to add auto-DNS feature.
    Seems it's not too difficult, but I need your help. I've created some DNS templates for Google Apps, normal templates already exists.
    Currently I wonder how to initiate creation of records based on DNS-template and data provided for site that is going to be created. Missing data may be built using default prefixes as ns1, ns1 and so on.
    What do you think?

    BTW: I found framework used for ISPConfig as very nice :).
     
  14. eugenesan

    eugenesan New Member

    Hi all,

    I've prepared next version of patch.
    Now it supports:
    1) Seamless subdomain (without redirects).
    2) Default config files and read-me inside (requires manual modification)
    3) Optional support for user-friendly folders names. Renaming of sites and users supported. All paths will be updated automatically.
    4) Added default DNS template for GoolgeApps.
    5) Management of php-fpm pools, now PHP environments are separated (suFPM)
    6) Synced with trunk-30/1/2009

    Good luck.
     

    Attached Files:

  15. eugenesan

    eugenesan New Member

    Hi,

    Some bugfixes and new features as webserver directives (regex locations) and php childs control.
    Bug fixes and probably something I've forgot.
     

    Attached Files:

  16. KenMasters

    KenMasters New Member

    Thanks for this! I'm highly interested in this patch, and was wondering if there is a howto you'd recommend for the nginx install. Most of the howtos I'm seeing are using pre-built packages which are out of date or aren't using the far more efficient php-fpm patch for the php install. I hope to test your patch tonight, and will be keeping an eye out for new versions!
     
  17. eugenesan

    eugenesan New Member

    Hi,

    I was planning to prepare some documentation, but not sure when I'll be find time for that :-(

    I am testing updated version of ISPConfig patch and will try to release some additional information regarding building/installing/configuring nginx/php-fpm with ISPConfig, soon.

    At the moment there is very simple readme inside the patch, I've posted earlier.
    I can't post patches here, since forum has 100k limit. I'll check my options and post back.

    Contact me for clarifications.
    Good luck
     
  18. weldpua2008

    weldpua2008 New Member

    Hello
    I'm happy that ISPconfig3 start support for nginx. But...
    I think that nginx(or other like that reverse proxy server: lighttp) can used in 3 ways:

    1. nginx(or other like that) revers proxy all query to apache server for better performance(less memory use than apache process or other).
    2. nginx (or other like that) for revers proxy query to apache server for websites, and one directive for ispconfig3 - only nginx+php-cgi
    3. integrate nginx (or other like that) to ispconfig3, like suphp, php-cgi,modphp that can users chose apache or other server.
     
  19. eugenesan

    eugenesan New Member

    Hi,

    First I want to state that nginx is not less functional then apache in most cases.
    My target was VPS oriented hosting server with control panel.
    My intention was eliminate mail server usage (thanks to gmail) and totally replace apache+libphp with nginx+php-fcgi-fpm and not to add nginx as reverse proxy.

    Currently I am successfully running desired configuration and I am more then happy :)
    Footprint, security and speed are far beyond my expectations.
    I was able to add to ISPConfig, support for nginx, with as much features as majority of websites would require.

    I hope to find some time and cooperation from ISPConfig maintainers, to share my achievements with others, soon.
     
  20. weldpua2008

    weldpua2008 New Member

    I know, but many people's use it's features by default, and they need them.
    Thats why I want implement to ISPconfig feature: chose your http-server. But I think that apache must bind on 127.0.0.1, and gateway to apache must be revers proxy application - for many reasons, but I don't think that I has right's to chose htp-server thats why ISPconfig3 must support nginx in many way's.
    When I can see in svn your changes I can try write some patches.
    My target too.
     

Share This Page