Blog du metabaron

Aller au contenu | Aller au menu | Aller à la recherche

Bienvenue sur mon blog!

mercredi, novembre 25 2009

New version of Mozilla Weave server: 1.0

Recently, Mozilla foundation released a new version of Mozilla Weave server (version 1.0). You can download the latest version on this website and read the ...documentation... on the dedicated wiki.

I have to say that, using the full version, I spent almost 3 days on trying to update my previous installation and have something I can use.

So I decided, again, to share with you my configuration files so that people can install their personal weave server.

Virtualhost configuration file:

<VirtualHost *>
	ServerAdmin webmaster@metabaron.net

	Alias /1.0 /var/www/mozilla/server/sync/1.0/index.php
	Alias /user/1 /var/www/mozilla/server/user/1/index.php
        Alias /misc/1/captcha_html /var/www/mozilla/server/misc/1/captcha.php
	
	ServerName mozilla.metabaron.net
	DocumentRoot /var/www/mozilla/server/

	<Directory /var/www/mozilla/server/>
	Options Indexes FollowSymLinks
	AllowOverride none
        Order allow,deny
        Allow from all
	</Directory>

	ErrorLog /var/log/apache2/mozilla.metabaron.net-error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog /var/log/apache2/mozilla.metabaron.net-access.log combined
	ServerSignature On
</VirtualHost>

weave_user_constants.php file: Change

if (!defined('WEAVE_REGISTER_STORAGE_LOCATION')) { define('WEAVE_REGISTER_STORAGE_LOCATION', 'null'); }

to

if (!defined('WEAVE_REGISTER_STORAGE_LOCATION')) { define('WEAVE_REGISTER_STORAGE_LOCATION', 'XXX.metabaron.net'); }

Important: If you are using, as I'm using, a HTTP server and not a HTTPS, find all references to https and change them for http If you don't want to use Captcha when registering a new user, change

if (!defined('WEAVE_REGISTER_USE_CAPTCHA')) { define('WEAVE_REGISTER_USE_CAPTCHA', 0); }

to

if (!defined('WEAVE_REGISTER_USE_CAPTCHA')) { define('WEAVE_REGISTER_USE_CAPTCHA', 1); }

Of course, you'll have to change the databases tables for the new one (read the wiki documentation).

If you already have a user, you'll only have to select Start over from the preferences and point to your custom server, your user will be recreated on the weave server and your data uploaded on the new weave installation.

I hope this will help some of you.

samedi, septembre 5 2009

Weave server 0.5 and weave client 0.6

Recently, I upgraded my weave client to version 0.6.
Weave is a client/serveur solution allowing you to save and synchronize all your firefox data to a server (more information about the client here and about the server here). You can use Mozilla servers (look here) or your own if you want to handle data locally.

That's the solution I choose: set up my own weave server

Setting up things was a real pain in the ass so I decided to share with you my configuration files:

<VirtualHost *>
        ServerAdmin webmaster@XXXX.net

        Alias /0.3/user /var/www/XXXX/server/index.php
        Alias /weave/admin /var/www/XXXX/server/admin.php
        Alias /0.5 /var/www/XXXX/server/0.5/index.php
        Alias /user/1 /var/www/XXXX/server/user/1/index.php
        Alias /misc/1/captcha_html /var/www/XXXX/server/misc/1/captcha.php

        ServerName XXXX.YYYYY.net
        DocumentRoot /var/www/XXXX/server/

        <Directory /var/www/XXXX/server/>
        Options Indexes FollowSymLinks
        AllowOverride none
        Order allow,deny
        Allow from all
        AuthName "Weave Storage"
        AuthType Basic
        AuthUserFile /var/www/XXXX/users_pass
        require valid-user
        </Directory>

        ErrorLog /var/log/apache2/XXXX.YYYY.net-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/XXXX.YYYY.net-access.log combined
        ServerSignature On
</VirtualHost>

Download the latest version of Mozilla weave server. and install it (mine is stored at /var/www/XXXX/server)
Follow the instructions here and after here.

Something important is written in the documentation:

  • Edit user/1/weave_user_constants.php and find line
if (!defined('WEAVE_REGISTER_STORAGE_LOCATION')) { define('WEAVE_REGISTER_STORAGE_LOCATION', null); }

Change "null" to your domain name such as "'XXXX.YYYY.net'" if you have only one server location

  • If your server is HTTP based and not HTTPS based, don't forget to change all URL reference from https to http.


Hope this will help all of you.

mercredi, juillet 22 2009

Empecher les bots de s'inscrire sur votre Wordpress Mu

Recemment, j'ai du faire joujou avec Wordpress Mu. Cette version de Wordpress vous permet, avec une unique installation, de pouvoir heberger plusieurs blogs.
Etant actuellement entrain de me former sur Perl, j'ai ecris un script qui copie l'internaute et qui permet la creation automatique d'un blog (en se connectant a la page wp-signup.php). Le probleme qui decoule de l'utilisation de cette page wp-signup.php (alors accessible a tous les internautes) et que, rapidement, vous vous retrouvez avec des spammers creant des blogs a la volee.
J'ai donc cherche sur Internet une facon de _bloquer l'acces a cette page pour toute machine ne faisant pas parti de mon domaine sans succes__!

Je partage avec vous ma methode:
Editez le fichier contenant votre VirtualHost ///

  1. Page we want to block access to
       <Files "wp-signup.php">
  1. Deny to all
               order deny,allow
               deny from all
  1. Allow from the server hosting Apache
               allow from 127.0.0.1
  1. Allow all servers from my domain name
               allow from .metabaron.net
  1. Allow IP address 192.168.0.254 (my ISP router)
               allow from 192.168.0.254
       </Files>

///
Ca devrait faire l'affaire (en tout cas ca le fait pour moi).

vendredi, juin 26 2009

Awstat et les sous-domaines

Ce qu'il y a de bien sur Awstats, c'est qu'il gere parfaitement le fait que vous ayez plusieurs sous-domaines, pour peux que vous ayez configure Apache pour stocker les logs dans des fichiers differents selon le sous-domaine. Par contre, il n'est pas si facile que cela d'afficher le sous-domaine qui vous interesse dans Awstats sans changer l'url d'appel au script CGI et encore moins de n'afficher qu'un simple resume de base.

Et bien, AwstatsTotal va vous y aider. Il permet d'afficher le minimum vital des statistiques d'Awstats et d'acceder aux statistiques de tous vos sous-domaines par un simple clique de souris.

Si vous rencontrez le message suivant en installant AwstatsTotal:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
Fatal error: Unknown: Failed opening required '/var/www/apache2-default/awstatstotals.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

Faite un petit chmod qui resoudra votre probleme:

chmod 755 awstats*

Installer Awstat sous Debian

Apparememnt, l'installation d'Awstat sous Debian est quelque chose qui interesse beaucoup les gens car c'est l'une des expressions de recherche qui vous font arriver ici donc, voici a nouveau cette article qui etait sur mon ancien blog:

Pour installer Awstats sous Debian, la premiere chose a faire est de se connecter en tant qu'administrateur

# su

Ensuite, il faut installer le package Awstats:

# apt-get install awstats

Maintenant, avec la derniere version de Debian, vous devriez avoir Apache 2 d'installe et non Apache (ce qui est mon cas). Il va donc falloir modifier le fichier de configuration d'Awstats et en profiter pour personnaliser quelques variables:

# vi /etc/awstats/awstats.conf
LogFile="/var/log/apache/access.log" devient LogFile="/var/log/apache2/access.log"
SiteDomain="" devient SiteDomain="blog.metabaron.net" (adpatez a votre site)

Renommez le fichier awstats.conf en awstats.blog.metabaron.net.conf (adaptez a votre site) et lancer la generation des fichiers de statistiques pour le script awstats:

# /usr/lib/cgi-bin/awstats.pl -config=blog.metabaron.net -update

Et on fait le lien qui va bien, dans le fichier de configuration d'Apache, afin de pouvoir afficher les icones:

alias /awstats-icon /usr/share/awstats/icon/

Maintenant que tout tourne, il reste a modifier le script charge de mettre a jour toutes les statistiques Awstats (pratique lorsque vous disposez de beaucoup de sous-domaines) et de le mettre en cron:

# cp /usr/share/doc/awstats/examples/awstats_updateall.pl /usr/sbin/
# vi /usr/sbin/awstats_updateall.pl
 Faire pointer $Awstats vers le bon repertoire
Ajouter /usr/sbin/awstats_updateall.pl a votre cron

Voila, c'est tout.