 |
Chapitre 1.
Preparing the host |
|
Setting up your box
Before installing daCode itself, we'll prepare a
pleasant place just for him, and we will check if
everything is OK. Here we speak Unix, you've been warned!
You may create a specific user, 'dacode' if you want to
really separate it from the rest of your box. But a
personnal login is OK too.
# adduser dacode
# su - dacode
$ passwd
|
You will use this login whenever you need to work on
daCode, be it upgrades, developement or reconfiguration.
Config
checks
Now we will check if your configuration is correct.
At home, I do it this way:
$ mysql -V
mysql Ver 9.38 Distrib 3.22.32, for pc-linux-gnu (i686)
$ cvs -v
Concurrent Versions System (CVS) 1.10.8 (client/server)
$ mkdir public_html
$ echo "<? phpinfo(); ?>" > public_html/test.php3
or
$ psql -V
psql (PostgreSQL) 7.2.1
contains support for: readline, history, multibyte
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996, Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.
$ mozilla http://localhost/~dacode/test.php3
|
If Mozilla doesn't display anything, first suspect a
problem with the file permissions. Correct it with `chmod
o+rx'. Apache needs to read your files and access your
directories. You should have something like this:
$ ls -l ~dacode | grep public_html ### it's OK
drwxr-xr-x 2 dacode dacode 4096 jan 3 22:50 public_html/
$ ls -l ~dacode/.. | grep dacode ### it isn't OK
drwx------ 8 dacode dacode 4096 jan 3 22:52 dacode/
$ chmod o+rx ~dacode
$ ls -l ~dacode/.. | grep dacode ### here it's better
drwx---r-x 8 dacode dacode 4096 jan 3 22:52 dacode/
|
If Mozilla doesn't find anything better to display, you
may have a problem with PHP. Go hunt for coffee and
cigarettes, and forget about sleeping for some time. If
it works, first thank your computer for saving your
lungs, and then take note of the PHP version and the
presence of the MySQL and Apache extentions of PHP (the
MySQL extension may be replaced by the PostgreSQL
extension). We may need it later if something goes wrong.
Setting
up the database
We decided to publish on the web, so we'll need some
help from root. Prepare it now, and don't call him BOFH
for some time. Then pay him a Guiness, and ask him, very
politely a database to store your infos.
For PostgreSQL, the Administrator'll use
`createuser' and `createdb' commands.
[operator]$ createuser --no-createdb --no-adduser --pwprompt daiouser
Enter password for user "daiouser":
Enter it again:
CREATE USER
[operator]$ createdb --encoding=LATIN1 dabase
|
Root has to give you the name of the database, the
username for this database and the password for it.