<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Autenticazione_in_Apache_via_MYSQL</id>
	<title>Autenticazione in Apache via MYSQL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kb.rvmgroup.it/index.php?action=history&amp;feed=atom&amp;title=Autenticazione_in_Apache_via_MYSQL"/>
	<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Autenticazione_in_Apache_via_MYSQL&amp;action=history"/>
	<updated>2026-05-06T01:02:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://kb.rvmgroup.it/index.php?title=Autenticazione_in_Apache_via_MYSQL&amp;diff=10260&amp;oldid=prev</id>
		<title>Gabriele.vivinetto: Created page with &quot;* Installare la libreria di autenticazione:  apt-get install libaprutil1-dbd-mysql  * Abilitare i moduli necessari, anche la cache di autenticazione, altrimenti fa una queery...&quot;</title>
		<link rel="alternate" type="text/html" href="https://kb.rvmgroup.it/index.php?title=Autenticazione_in_Apache_via_MYSQL&amp;diff=10260&amp;oldid=prev"/>
		<updated>2019-05-24T16:46:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;* Installare la libreria di autenticazione:  apt-get install libaprutil1-dbd-mysql  * Abilitare i moduli necessari, anche la cache di autenticazione, altrimenti fa una queery...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* Installare la libreria di autenticazione:&lt;br /&gt;
 apt-get install libaprutil1-dbd-mysql&lt;br /&gt;
&lt;br /&gt;
* Abilitare i moduli necessari, anche la cache di autenticazione, altrimenti fa una queery sql pe rogni immagine in una pagina:&lt;br /&gt;
 a2enmod dbd&lt;br /&gt;
 a2enmod authn_dbd&lt;br /&gt;
 authn_socache&lt;br /&gt;
&lt;br /&gt;
*Riavviare Apache&lt;br /&gt;
 systemctl restart apache2.service&lt;br /&gt;
&lt;br /&gt;
* Si suppone di usare il DB di Postfixadmin per l&amp;#039;autenticazione, creare uno user apposta in select&lt;br /&gt;
&lt;br /&gt;
* Verificare l&amp;#039;accesso dalla macchina apache verso il DBHost con le credenziali&lt;br /&gt;
&lt;br /&gt;
* Impostare la configurazione a livello di virtualhost:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/apache/sites-enabled/myvurtualhost.cpnf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DBDriver mysql&lt;br /&gt;
DBDParams &amp;quot;host=mydbserver.example.priv dbname=postfixadmin user=postadmremote pass=SecretPass&amp;quot;&lt;br /&gt;
&lt;br /&gt;
DBDMin 4&lt;br /&gt;
DBDKeep 8&lt;br /&gt;
DBDMax 20&lt;br /&gt;
DBDExptime 300&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Impostare la configurazione per la location protetta:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/apache2/conf-enabled/mediawiki.conf&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /mediawiki&amp;gt;&lt;br /&gt;
	AuthType Basic&lt;br /&gt;
	AuthName &amp;quot;Mediawiki Protected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # To cache credentials, put socache ahead of dbd here&lt;br /&gt;
  AuthBasicProvider socache dbd&lt;br /&gt;
&lt;br /&gt;
  # Also required for caching: tell the cache to cache dbd lookups!&lt;br /&gt;
  AuthnCacheProvideFor dbd&lt;br /&gt;
  AuthnCacheContext my-server&lt;br /&gt;
&lt;br /&gt;
  # mod_authz_core configuration&lt;br /&gt;
  Require valid-user&lt;br /&gt;
&lt;br /&gt;
  # mod_authn_dbd SQL query to authenticate a user&lt;br /&gt;
  AuthDBDUserPWQuery &amp;quot;SELECT password FROM mailbox WHERE username = %s&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Riavviare Apache&lt;br /&gt;
  systemctl restart apache2.service&lt;br /&gt;
&lt;br /&gt;
=Riferimenti=&lt;br /&gt;
*[https://www.howtoforge.com/tutorial/password-protect-directories-with-mod_authn_dbd-mysql-on-apache-debian-jessie/ How to Password-Protect Directories with mod_authn_dbd and MySQL on Apache (Debian 8)]&lt;br /&gt;
*[https://httpd.apache.org/docs/2.4/mod/mod_authn_dbd.html mod_authn_dbd - Apache HTTP Server Version 2.4]&lt;br /&gt;
*[https://httpd.apache.org/docs/current/mod/mod_dbd.html mod_dbd - Apache HTTP Server Version 2.4]&lt;/div&gt;</summary>
		<author><name>Gabriele.vivinetto</name></author>
	</entry>
</feed>