[fr] Pour installer plus de trente weblogs WordPress sur mon serveur, il serait utile d'avoir un script d'installation en PHP. Quelqu'un a offert d'en écrire un pour moi. Ce billet récapitule ce que devrait faire un tel script, de mon point de vue (installation et configuration de WordPress en fonction d'un nom d'utilisateur).
As you may know, I’m shortly going to install 30+ WordPress blogs on my server. Noderat on #wordpress kindly offered to have a go at writing a PHP script to automate WP installs. I sent him this list of what the ideal script should be able to do for me, but on second thoughts, I’m posting it here so that everybody may see it. Of course, if you know of an existing script which already does this, let me know!
- take $username + $password as input
- install wordpress in a subdir named “$username”, using table prefix “$username_” and with an extra user (on top of admin) named “$username” (password=”$password”), user level 3
- mysql user should be “$username” too (password “$password” also), with grants only on the tables belonging to this weblog
- set permalink scheme to
/archives/%year%/%monthnum%/%day%/%postname%/ for monthlies and /categories for categories - generate .htaccess in directory, based on this template, with “blog” replaced by “$username” everywhere
- in wp-config: define (‘WPLANG’, ‘fr’) and edit appropriate lines
- wp-includes/languages and wp-content/plugins should be symlinked to directories I can specify in the script
- blog admin password should be reset to something I can specify in the script
I should be able to edit the script config file to provide mysql root user + pass, wordpress database name.
It would also be interesting if the script was built in such a way that it could be further modified/developed to allow installation of blogs on separate subdomains rather than subfolders. From the point of view of the filesystem the blogs live in, this wouldn’t change much — but some extra WordPress options would need editing (e.g. blog address), as well as the Apache and Bind config files necessary to set up the subdomain. This is not mandatory, but could be useful at some point (if we’re thinking in the line of WordPress-farming).