Phpsysinfo

De SME Server Wiki
Révision de 14 novembre 2006 à 00:34 par WikiSysop (discussion | contributions) (Dans une ibay)

Phpsysinfo installation

Dans une ibay

Ce tutorial est tiré de Swerts-Knudsen => [1] et fait pour sme 7 contrairement au tutorial de Knudsen qui lui est fait pour sme 6.


1- Créer une nouvelle ibay que vous nommerez à votre convenance via server-manager. Nous prenons pour exemple phpsysinfo.


2- Téléchargez la dernière version de phpsysinfo à cette adresse: [2] et déplacez l'archive dans l'ibay que vous venez de créer. La dernière version en date est la 2.5.2-rc3

-- Placez vous dans le dossier html de votre nouvelle ibay et téléchargez y phpsysinfo:

[root@waccabac ~]# cd /home/e-smith/files/ibays/phpsysinfo/html             

=>> On se place dans le dossier html de la nouvelle ibays.

[root@waccabac html]# wget http://belnet.dl.sourceforge.net/sourceforge/phpsysinfo/phpsysinfo-2.5.2-rc3.tar.gz

=>> On télécharge phpsysinfo dans l'ibay.

[root@waccabac html]# tar -zxvf phpsysinfo-2.5.2-rc3.tar.gz
[root@waccabac html]# cd phpsysinfo
[root@waccabac html]# mv * ../
[root@waccabac html]# cd ..
[root@waccabac html]# mv config.php.new config.php
[root@waccabac html]# rm index.html

=>> on décompresse l'archive.

Un nouveau dossier vient d'être créer, il se nomme: phpsysinfo


3- On va permettre au script PHP d'accéder aux dossier necessaires en lui donnant les droits.

[root@waccabac html]# /sbin/e-smith/db accounts setprop phpsysinfo PHPBaseDir /home/e-smith/files/ibays/phpsysinfo/:/proc:/bin:/usr/bin/who:/etc/e-smith-release
[root@waccabac html]# /sbin/e-smith/signal-event ibay-modify phpsysinfo


Et voilà le tour est joué ! Il vous suffit maintenant de vous rendre sur l'adresse de votre site: http://votresite.com/phpsysinfo/index.php

Voici un exemple en ayant redirigé une adresse dessus: [3] http://www.phpsysinfo.waccabac.ath.cx/phpsysinfo/index.php

Merci à JP_PIALASSE pour la modification du code.

Dans un dossier

Voici comment installer phpsysinfo dans un dossier sur l'ibay Primary par exemple.

1- Placez vous dans le dossier html de votre nouvelle ibay et téléchargez y phpsysinfo:

# cd /home/e-smith/files/ibays/Primary/html/stats             

=>> On se place dans le dossier html de l'ibays Primary, dossier stats.

2- Téléchargez la dernière version de phpsysinfo à cette adresse: [4] et déplacez l'archive dans l'ibay que vous venez de créer. La dernière version en date est la 2.5.2-rc3

# wget http://belnet.dl.sourceforge.net/sourceforge/phpsysinfo/phpsysinfo-2.5.2-rc3.tar.gz

=>> On télécharge phpsysinfo dans l'ibay.

# tar -zxvf phpsysinfo-2.5.2-rc3.tar.gz
# cd phpsysinfo
# mv config.php.new config.php

=>> on décompresse l'archive.

Un nouveau dossier vient d'être créer, il se nomme: phpsysinfo

3- On va permettre au script PHP d'accéder aux dossier necessaires en lui donnant les droits. Là il s'agit d'utiliser un template

#mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
#vi /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98phpsysinfo

Maintenant recopiez ceci dans le fichier (inserez avec :i)

<Directory /home/e-smith/files/ibays/Primary/html/stats/phpsysinfo>
   Options None
   Options +Indexes
   Options +Includes
   AllowOverride None
   order deny,allow
   deny from all
   allow from all
   AddType application/x-httpd-php .php .php3 .phtml
   AddType application/x-httpd-php-source .phps
   php_admin_value open_basedir /home/e-smith/files/ibays/Primary/:/proc:/bin:/usr/bin/who:/etc/e-smith-release
</Directory>

sauvegardez ("esc" puis :wq )

Mettre à jour le template

#expand-template /etc/httpd/conf/httpd.conf
#service httpd-e-smith restart


4- Modifiez le fichier distros.ini pour ajouter SME :)

#vi /home/e-smith/files/ibays/Primary/html/stats/phpsysinfo/distros.ini

[SME]
Image   = "Redhat.png"
Files   = "/etc/e-smith-release;/etc/redhat-release"

(vous pouvez modifier l'image à vos souhaits)