1 .. -*- coding: utf-8 -*- |
|
2 |
|
3 =============================== |
|
4 Creation of your first instance |
|
5 =============================== |
|
6 |
|
7 What is an instance? |
|
8 -------------------- |
|
9 |
|
10 A *CubicWeb* instance is a container that |
|
11 refers to cubes and configuration parameters for your web instance. |
|
12 Each instance is stored as a directory in ``~/etc/cubicweb.d`` which enables |
|
13 us to run your instance. |
|
14 |
|
15 What is a cube? |
|
16 --------------- |
|
17 |
|
18 Cubes represent data and basic building bricks of your web instances : |
|
19 blogs, person, date, addressbook and a lot more. |
|
20 |
|
21 .. XXX They related to each other by a 'Schema' which is also the PostGres representation. |
|
22 |
|
23 Each cube defines entities, their views, their schemas and workflows |
|
24 in an independant directory located in ``/path/to/forest/cubicweb/cubes/`` |
|
25 for a Mercurial installation or in ``/usr/share/cubicweb/cubes`` for |
|
26 a debian package installation. For example, the 'blog' cube defines the entities |
|
27 blogs and blogentries. |
|
28 |
|
29 When an *CubicWeb* instance is created, you list the cubes that you want to use. |
|
30 Using a cube means having the entities defined in your cube's schema |
|
31 available in your instance as well as their views and workflows. |
|
32 |
|
33 |
|
34 Creating a basic *CubicWeb* Instance |
|
35 ------------------------------------ |
|
36 |
|
37 We can create an instance to view our |
|
38 instance in a web browser. :: |
|
39 |
|
40 cubicweb-ctl create blog myblog |
|
41 |
|
42 .. XXX or :: |
|
43 |
|
44 .. XXX cubicweb-ctl create forge myforge |
|
45 |
|
46 |
|
47 .. note:: |
|
48 The commands used below are more detailled in the section dedicated to |
|
49 :ref:`cubicweb-ctl`. |
|
50 |
|
51 A series of questions will be prompted to you, the default answer is usually |
|
52 sufficient. You can allways modify the parameters later by editing |
|
53 configuration files. When a user/psswd is requested to access the database |
|
54 please use the login you create at the time you configured the database |
|
55 (:ref:`ConfigurationPostgresql`). |
|
56 |
|
57 It is important to distinguish here the user used to access the database and |
|
58 the user used to login to the cubicweb instance. When a *CubicWeb* instance |
|
59 starts, it uses the login/psswd for the database to get the schema and handle |
|
60 low level transaction. But, when ``cubicweb-ctl create`` asks for |
|
61 a manager login/psswd of *CubicWeb*, it refers to an instance user |
|
62 to administrate your web instance. |
|
63 The configuration files are stored in *~/etc/cubicweb.d/myblog/*. |
|
64 |
|
65 To launch the web instance, you just type :: |
|
66 |
|
67 cubicweb-ctl start myblog |
|
68 |
|
69 You can see how it looks by |
|
70 visiting the URL `http://localhost:8080`. |
|
71 To login, please use the cubicweb administrator login/psswd you |
|
72 defined when you created the instance. |
|
73 |
|
74 To shutdown the instance :: |
|
75 |
|
76 cubicweb-ctl stop myinstance |
|
77 |
|
78 .. XXX something like `cubicweb-ctl live-server intra` would be nice |
|
79 |
|
80 |
|