410 likes | 648 Views
Comanche A GUI management tool for Apache http://www.comanche.org. Daniel L ó pez Ridruejo daniel@covalent.net. Talk Overview. Part I What is Comanche, features overview, demo, architecture, future development Part II XML and Comanche How to add support for Apache modules
E N D
ComancheA GUI management tool for Apachehttp://www.comanche.org Daniel López Ridruejo daniel@covalent.net
Talk Overview Part I • What is Comanche, features overview, demo, architecture, future development Part II • XML and Comanche • How to add support for Apache modules • How to add support for other programs
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
Introduction • Configuration Manager for Apache • GUI for managing Apache • Common framework for developing other configuration programs
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
Motivation • Current GUIs shortcomings • Make it easy for users • Make it easy for developers
Motivation: Users • Guide the user • Hide complexity for newbies • Full access for power users
Motivation: Developers • Modular, extensible design • Make it easy to contribute • Simple API • Simple tasks via XML • Complex tasks via XML + a little bit of coding • “One afternoon” learning curve
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
Open-source Multi-platform Modular Extensible Easy to set up Non-intrusive Multiple language support Context-sensitive help Convenient Features
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
Architecture Namespace Plug-in User interface Plug-in
Architecture Abstract: • Configuration Information (httpd.conf, smb.conf) • Information presentation (User Interface)
Architecture • XML for user interface • XML for configuration format description • Multiple front-ends • Distributed and multiple language support
Part I: Comanche Overview • Introduction • Motivation • Features • Demo • Architecture • The future
The future • Covalent support • Distributed architecture (XML-RPC, CORBA). Hidden from developer • Write plugins in Perl, Java, etc • HTML interface • Apache directly configured via XML
The future: getting involved • Translations • Add support for Apache modules • Write new plug-ins: ftp server, user management, qmail… • Submit bug reports • Buy some beers to the author :)
Talk Overview Part II • XML and Comanche • How to add support for Apache modules • How to add support for other programs
XML and Comanche • XML basics • XML for configuration • XML for User Interface
XML Basics • eXtensible Markup Language. • Standard way of defining, storing and exchanging structured data. • Tag based and similar to HTML
XML and Comanche • XML basics • XML for configuration • XML for User Interface
XML for configuration • Translate multiple formats XML • Configuration directives syntax changes from release to release • User Interface needs to know information about the parameters of a particular directive
XML configuration language • Schema language • Combine basic blocks to define complex directives Number Choice Alternate Boolean Structure String List
XML configuration language <list name="userNames" label="Names of users"> <syntax> <string name="user" label="Name of the user" > <default>nobody</default> </string> </syntax> <default> <item>dani</item> </default> </list>
XML and Comanche • XML basics • XML for configuration • XML for User Interface
XML User interface • Programmatic User Interface generation • Multiple front-ends • No coding required • Isolate configuration tasks from presentation
XML User Interface <list name="userNames" label="Names of users"> <syntax> <string name="user" label="Name of the user" > <default>nobody</default> </string> </syntax> <default> <item>dani</item> </default> </list>
Talk Overview Part II • XML and Comanche • How to add support for Apache modules • How to add support for other programs
Support for Apache modules • Describe directives • Property pages • Module description
Mod_cgi: Directives <string name="scriptLog" label="apache1.3_cgi_scriptLog" classes="file"> <default></default> </string> <number name="scriptLogLength" label="apache1.3_cgi_scriptLogLength"> <default>10385760</default> </number> <number name="scriptLogBuffer" label="apache1.3_cgi_scriptLogBuffer"> <default>1024</default> </number>
Mod_cgi: Property pages <propertyPage label="apache1.3_cgi_cgi" icon="smallWheel" name="cgi" align="vertical"> <directiveInclude name="scriptLog"/> <directiveInclude name="scriptLogLength"/> <directiveInclude name="scriptLogBuffer"/> </propertyPage>
Mod_cgi: Module description <apacheModuleDescription name="cgi" directivesXMLDefinition="directives.xml" propertyPagesXMLDefinition="propertyPages.xml" description="This modules provides for execution of CGIs." icon="smallWheel"> <nodesInterested> <node type="mainserver"> <propertyPage name="cgi" /> </node> </nodesInterested> </apacheModuleDescription>
Talk Overview Part II • XML and Comanche • How to add support for Apache modules • How to add support for other programs
Support for other programs • Design property pages • Add nodes to the namespace • Answer property pages requests • Receive property pages results
Example: DNS configuration • /etc/resolv.conf • Nameservers • Domain search order
Design property pages <propertyPage name="nameserversPP" icon="network" align="vertical"> <list name="domainList" label="resolv_domain_order"> <syntax> <string name="domain“ label="resolv_domain_suffix" /> </syntax> </list> <list name="dnsList" label="resolv_dns_order"> <syntax> <string name="dns" label="resolv_dns_suffix" /> </syntax> </list> </propertyPage>
Add node ::plugInUtils::addNode $this $namespace $parentNode \ -classes {nameservers leaf} \ -openIcon network \ -closedIcon network \ -label [mesg::get \ resolv_nameservers_settings]
Answer property page body nameserversPlugIn::_inquiryForPropertyPages { node } { fillPropertyPages return $nameserversXuiPP }
Process prop. pages result body nameserversPlugIn::_receivedPropertyPages { node xuiPropertyPages } { set pp [$xuiPropertyPages getComponentByName nameserversPP] saveNameServerSettings $pp }