Difference between revisions of "King0770-Notes-Enable-webui-for-cbpolicyd-Unsupported"

(Section III - Requirements)
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=King Notes Enable-webui-for-cbpolicyd-Unsupported=
 
=King Notes Enable-webui-for-cbpolicyd-Unsupported=
 
+
<br>
 +
<strong>Purpose of this article: Provide an easier method making changes to the cbpolicyd service.</strong>
 +
<br>
 
'''Summary of steps'''
 
'''Summary of steps'''
 
* Edit /opt/zimbra/conf/httpd.conf
 
* Edit /opt/zimbra/conf/httpd.conf
* /opt/zimbra/cbpolicyd/share/webui/includes/config.php  
+
* Edit /opt/zimbra/cbpolicyd/share/webui/includes/config.php<br>
 +
<strong>NOTE: In ZCS8.7.x, the config.php is located in /opt/zimbra/common/share/webui/includes. </strong>
 
<br>
 
<br>
Purpose: Provide an easier method making changes to the cbpolicyd service.
 
 
<br>
 
<br>
 
'''When will there be support for the cbpolicyd service in the Admin Console?'''
 
'''When will there be support for the cbpolicyd service in the Admin Console?'''
Line 56: Line 58:
 
<code><pre>
 
<code><pre>
 
cd /opt/zimbra/cbpolicyd/share/webui/
 
cd /opt/zimbra/cbpolicyd/share/webui/
/opt/zimbra/httpd/bin/htpasswd -cb .htpasswd zimbra zimbra
+
/opt/zimbra/httpd/bin/htpasswd -cb .htpasswd zimbra myPassword
 
</pre></code>
 
</pre></code>
 +
 +
<strong>NOTE: If you are running ZCS version 8.7.x, replace /opt/zimbra/cbpolicyd/share/webui/ path with /opt/zimbra/common/share/webui/  in the /opt/zimbra/conf/httpd.conf file</strong>
  
 
==Section II - Edit the /opt/zimbra/cbpolicyd/share/webui/includes/config.php file ==
 
==Section II - Edit the /opt/zimbra/cbpolicyd/share/webui/includes/config.php file ==
Line 69: Line 73:
 
<code><pre>
 
<code><pre>
 
$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";
 
$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";
</pre></code>
+
</pre></code><br>
 +
 
 +
<strong>NOTE: In ZCS8.7.x, the config.php is located in /opt/zimbra/common/share/webui/includes. </strong>
  
 
==Section III - Requirements==
 
==Section III - Requirements==
Line 78: Line 84:
 
</pre></code>
 
</pre></code>
  
==Section IV - cbpolicyd URL== <br>
+
==Section IV - cbpolicyd URL==  
 
 
 
Once the changes are made, the URL should be available.  <strong> http://mta.domain.com:7780/webui/ </strong>    OR    <strong> http://mta.domain.com:7780/webui/index.php/ </strong>
 
Once the changes are made, the URL should be available.  <strong> http://mta.domain.com:7780/webui/ </strong>    OR    <strong> http://mta.domain.com:7780/webui/index.php/ </strong>
  
 
==Section V - FAQ==
 
==Section V - FAQ==
 
Question: Is this supported by Zimbra Support Team? <br>
 
Question: Is this supported by Zimbra Support Team? <br>
Answer:<strong>No</strong>
+
Answer:<strong> No, but you are free to make any changes as you see fit</strong>
 +
<br>
 +
Question: Does cbpolicyd need to be running in order to access cbpolicyd's webui?<br>
 +
Answer:<strong>  No</strong>
 +
<br>
 +
Question: I messed up the cbpolicyd database. Is there a way to start over from scratch?<br>
 +
Answer:<strong>  Yes, run this command as the zimbra user:  </strong>
 +
<code><pre>
 +
/opt/zimbra/libexec/zmcbpolicydinit -force
 +
</pre></code>
 +
<br>
 +
Question:  Is it possible to export my cbpolicyd config?<br>
 +
Answer:<strong> Yes, run this command as the zimbra user: </strong>
 +
<code><pre>
 +
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb .dump >> /tmp/test.sql
 +
</pre></code>
 +
<br>
 +
Question:  Help! My /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb DB is gone! But I do have my exported cbpolicyd config, is there a way to import it?<br>
 +
Answer: <strong>  Yes. Run the following as the zimbra user to create the DB:</strong> 
 +
<code><pre>
 +
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb .databases
 +
</pre></code>
 +
<strong> Then run the following to import it:</strong>
 +
<code><pre>
 +
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < /tmp/test.sql
 +
</pre></code>
 +
<br>
 +
 
 +
 
 +
More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes
 +
 
 +
[[Category:Administration]]
 +
[[Category:Command Line Interface]]
 +
[[Category:MTA]]
 +
[[Category:King0770-Notes]]

Latest revision as of 15:36, 28 April 2020

King Notes Enable-webui-for-cbpolicyd-Unsupported


Purpose of this article: Provide an easier method making changes to the cbpolicyd service.
Summary of steps

  • Edit /opt/zimbra/conf/httpd.conf
  • Edit /opt/zimbra/cbpolicyd/share/webui/includes/config.php

NOTE: In ZCS8.7.x, the config.php is located in /opt/zimbra/common/share/webui/includes.

When will there be support for the cbpolicyd service in the Admin Console? See, https://bugzilla.zimbra.com/show_bug.cgi?id=70376

Section I - Edit /opt/zimbra/conf/httpd.conf

Edit /opt/zimbra/conf/httpd.conf and add index.php to the DirectoryIndex line.
FROM

<IfModule dir_module>
    DirectoryIndex index.html index.html.var 
</IfModule>

TO

<IfModule dir_module>
    DirectoryIndex index.html index.html.var index.php
</IfModule>

Add the following at the bottom of the /opt/zimbra/conf/httpd.conf file

Alias /webui /opt/zimbra/cbpolicyd/share/webui/
<Directory "/opt/zimbra/cbpolicyd/share/webui/">
    AllowOverride AuthConfig
    Order Deny,Allow
    Allow from all
</Directory>

Save your changes, and restart zimbra's apache service.

zmapachectl restart

You may elect to choose a more secure directive for apache, for example.

Alias /webui /opt/zimbra/cbpolicyd/share/webui/
<Directory "/opt/zimbra/cbpolicyd/share/webui/">
   Order Deny,Allow
   Deny from all
   Allow from 127.0.0.1
</Directory>

You can also implement simple authentication for the webui directory.

cd /opt/zimbra/cbpolicyd/share/webui/
/opt/zimbra/httpd/bin/htpasswd -cb .htpasswd zimbra myPassword

NOTE: If you are running ZCS version 8.7.x, replace /opt/zimbra/cbpolicyd/share/webui/ path with /opt/zimbra/common/share/webui/ in the /opt/zimbra/conf/httpd.conf file

Section II - Edit the /opt/zimbra/cbpolicyd/share/webui/includes/config.php file

Edit the /opt/zimbra/cbpolicyd/share/webui/includes/config.php file, and change the $DB_DSN line.
FROM

$DB_DSN="mysql:host=localhost;dbname=cluebringer";

TO

$DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb";

NOTE: In ZCS8.7.x, the config.php is located in /opt/zimbra/common/share/webui/includes.

Section III - Requirements

You will need Zimbra's apache and spell packages installed. If the zimbra node running cbpolicyd service does not have apache or spell packages installed, you can manually install apache and spell.

rpm -ivh zimbra-apache-8.6.0_GA_1153.RHEL6_64-20141215151258.x86_64.rpm
rpm -ivh zimbra-spell-8.6.0_GA_1153.RHEL6_64-20141215151258.x86_64.rpm

Section IV - cbpolicyd URL

Once the changes are made, the URL should be available. http://mta.domain.com:7780/webui/ OR http://mta.domain.com:7780/webui/index.php/

Section V - FAQ

Question: Is this supported by Zimbra Support Team?
Answer: No, but you are free to make any changes as you see fit
Question: Does cbpolicyd need to be running in order to access cbpolicyd's webui?
Answer: No
Question: I messed up the cbpolicyd database. Is there a way to start over from scratch?
Answer: Yes, run this command as the zimbra user:

 
/opt/zimbra/libexec/zmcbpolicydinit -force


Question: Is it possible to export my cbpolicyd config?
Answer: Yes, run this command as the zimbra user:

 
sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb .dump >> /tmp/test.sql


Question: Help! My /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb DB is gone! But I do have my exported cbpolicyd config, is there a way to import it?
Answer: Yes. Run the following as the zimbra user to create the DB:

sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb .databases

Then run the following to import it:

sqlite3 /opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb < /tmp/test.sql



More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes

Jump to: navigation, search