Installation d'OCS Inventory
En préparation, installer les paquets make et build-essential. Il est nécessaire d'installer 2 paquets, disponibles dans les dépôts.
# aptitude install ocsinventory-reports ocsinventory-server
Après cette installation, un conflit se fait avec un paquet d'Apache. Il suffit de relancer l'installation de ocsinventory-reports.
Sécurisation
On créer un certifcat auto-signé. Pour cela, suivez la procédure ci-dessous:
Création des Vhosts
On créer 2 fichiers: default et default-ssl
Voici le contenu de default. Il permet la redirection de HTTP à HTTPS
<VirtualHost *:80>
ServerName ocs.fr.auf
DocumentRoot /usr/share/ocsinventory-reports
Redirect / https://ocs.fr.auf
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /usr/share/ocsinventory-reports/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>Voici le contenu de default-ssl. Cela permet la sécurisation de la connexion.
<VirtualHost 10.72.1.26:443>
ServerName ocs.fr.auf
DocumentRoot /usr/share/ocsinventory-reports/
SSLEngine On
SSLCertificateFile /etc/ssl/ocs.crt
SSLCertificateKeyFile /etc/ssl/ocs.key
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /usr/share/ocsinventory-reports/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>