4 # ./createBlog.sh type owner baseurl
5 # type = user | connected | group-member | group-admin
6 # * user: this is a blog for a user
7 # * connected: this is a blog for a group, all connected users can post
8 # * group-member: this is a blog for a group, all the members of the group can post
9 # * group-admin: this is a blog for a group, only group admins can post
10 # owner = name of the owner
11 # * user blog: forlife of the owner of the blog
12 # * group blog: 'diminutif' of the group (from X.net database)
13 # url = full url of the blog (e.g http://group.blog-x.org/).
15 # WARNING: The script generates a .htaccess. The rewrite base might be edited to match
16 # the installation. Default value is based on a blog-farm of the form
17 # http://$owner.base.url/
19 # Once the blog has been installed and the .htaccess set-up, you can go on the administration
20 # page of the blog at baseurl/admin/
22 # Their, go to the section 'Widget' and add (by drag-n-drop) the widgets 'Auth X.org' and 'Copyright'.
23 # (should be set up by default in near future).
29 rootpath
=/home
/web
/blogs
32 serviceurl
="http://blog.polytechnique.org/xorgservice/createBlog"
39 ( wget
"$serviceurl?owner=$owner&type=$type&url=$3" -O
- 2> /dev
/null |
grep 'blog created' ) || die
"Blog creation failed"
41 ( cd $rootpath && mkdir
$owner ) || die
"Can't create the repository for the blog"
44 for i
in admin db inc index.php locales plugins themes
; do
45 ln -s
$rootpath/$templatepath/$i || die
"Can't add path to $i"
47 mkdir
-p
"$rootpath/$templatepath/public/$owner"
48 chgrp
-R
"$apache_group" "$rootpath/$templatepath/public/$owner"
49 chmod g
+wr
"$rootpath/$templatepath/public/$owner"
50 ln -s
$rootpath/$templatepath/public
/$owner public
55 RewriteCond %{REQUEST_FILENAME} !-f
56 RewriteCond %{REQUEST_FILENAME} !-d
57 RewriteRule (.*) index.php/\$1
58 RewriteRule ^index.php\$ index.php/
59 SetEnv DC_BLOG_ID $owner