Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Tuesday, January 19, 2016

mod_jk apache 2.4 smartos zone

If, compiling mod_jk, you get

/usr/bin/bash: ../build/libtool: No such file or directory

Then

cd native/
./configure --with-apxs=/opt/local/bin/apxs
mkdir build
cp libtool build/
make
cp ./apache-2.0/mod_jk.so /opt/local/lib/httpd/

Thursday, March 12, 2015

Autenticazione Apache con la carta sanitaria Regione Toscana

E' stata una tribolazione: andare a tentoni richiede del tempo.

Utilizzare questo script https://gist.github.com/3v1n0/e371f58162795e0635f2 che fa quanto scritto nei commenti:
Get Italian government Certification Authority certificates from used by
by various National Service SmartCards (Carta Nazionale dei Servizi- CNS) 

mkdir /var/tmp/certs
./parse-gov-certs.py --output-folder /var/tmp/certs

Qui ci saranno vari certificati di Certification Authority di vari enti italiani usati per firmare i certificati di varie smart card, fra cui quelli utili al nostro scopo.

cd /var/tmp/certs
cat Regione_Toscana_-_CA_Cittadini_Servizi_di_Certificazione_* >> /etc/pki/tls/certs/ca-CNS-bundle.crt

In Apache, aprire il file ssl.conf (per esempio) e nel virtualhost opportuno mettere:

<VirtualHost _default_:443>
...

SSLCACertificateFile /etc/pki/tls/certs/ca-CNS-bundle.crt
...

</VirtualHost>

Non sono riuscito a far funzionare la direttiva SSLCACertificatePath, ovvero indicare una directory dove mettere i certificati scaricati con lo script Python.

E per richiedere la verifica del certificato del client (quindi il browser chiede il PIN della carta e passa il cerificato al server), mettere sempre all'interno della definizione del virtual host, o in qualche direttiva Location o Directory:

SSLVerifyClient require
SSLOptions +ExportCertData +StdEnvVars
SSLVerifyDepth 4


Questa è certamente una configurazione di base.
Il client viene autorizzato semplicemente se il certificato che presenta è stato firmato da una di queste CA. 
E' possibile autorizzare le carte in base a specifici attributi definiti con le direttive SSLRequire, e probabilmente configurare una CRL (Certificate Revocation List).

Monday, October 14, 2013

Install Baikal server on a SmartOS zone

Baïkal is a Lightweight CalDAV+CardDAV server. The home page is http://baikal-server.com/

Baïkal needs some PHP modules. I use Apache as web server.

pkgin in apache-2.4.6 ap24-php53-5.3.27
pkgin in php53-pdo-5.3.27
pkgin in php53-xmlrpc-5.3.27
pkgin in php53-pdo_sqlite-5.3.27 php53-pdo_mysql-5.3.27
pkgin in php53-dom-5.3.27

Now you must configure php.ini, adding the modules.


vi /opt/local/etc/php.ini

extension=xmlrpc.so
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so
extension=mbstring.so
extension=dom.so


The rest is pretty simple, following the install guide.

Friday, January 4, 2013

Centos Apache and Directory index forbidden

Today I struggled a little bit to make directory index module working.
I'm on Centos.

Installed apache (httpd) rpm.
No changes to configuration. Nothing.

I have created a conf file /etc/httpd/conf.d/my.conf

Alias /images "/var/www/images"

<Directory "/var/www/images">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


I have created the /var/www/images directory.
In this directory I don't want to put any html page. I want to use the Apache autoindex module to serve a list of files contained in this directory.

WTF autoindex not working...

And in the logs /var/log/httpd/error_log you can read

[Thu Jan 03 03:44:05 2013] [error] [client 192.168.56.1] Directory index forbidden by Options directive: /var/www/images/


The problem was that in /etc/httpd/conf.d/welcome.conf there was

Options -Indexes

So:
- you can delete such file
- you can change in +Indexes