|
|
# Creating database
|
|
|
# Configure Framadate
|
|
|
|
|
|
Framadate's database must be created before it can be populated. We also recommand connecting to your database with a dedicated user to increase security. Therefore you must connect to your MySQL or PostgreSQL server to execute a few commands.
|
|
|
## Form
|
|
|
|
|
|
## MySQL
|
|
|
Browse to `https://mywebsite.tld/framadate`. You should arrive on a screen checking the state of the install that will allow you, if every requirement is met, to proceed to the settings install form.
|
|
|
|
|
|
Connect to the database server
|
|
|
```bash
|
|
|
sudo mysql
|
|
|
```
|
|
|
On the next screen, you need to fill the form with the following fields:
|
|
|
|
|
|
Create the database
|
|
|
```sql
|
|
|
CREATE DATABASE IF NOT EXISTS `framadate` DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
|
|
|
```
|
|
|
- Application name (mandatory): The displayed name of your installation of Framadate
|
|
|
- Administrator mail address (mandatory): The email address of the administrator
|
|
|
- Respond-to mail address (optional): The email specified as recipient when some respond to an email sent by your installation of Framadate
|
|
|
- Default language (mandatory): The language used by default by your installation by Framadate when it can't guess the language of the user
|
|
|
- Clean URL (mandatory): Clean URLs displayed in the browser's address bar. If you enable it, you must setup the htaccess provided (see "Clean URL")
|
|
|
- Connection string (mandatory): The string used to configure the connection to the database. Replace `<HOST>` by the host name of your database server (for instance `localhost`). Replace `<SCHEMA>` with the name of the database you previously created (we used `framadate` in a previous part of the documentation)
|
|
|
- User (mandatory): The database user used by your installation of Framadate for connecting to the database (we also previously used `framadate`)
|
|
|
- Password (optional): The password of the database user
|
|
|
- Prefix (optional): The prefix of the tables in the database. If you are not sure, don't modify this field.
|
|
|
- Migration table (mandatory): The table used for database migrations. If you are not sure, don't modify this field.
|
|
|
|
|
|
Create a dedicated user (replace `useastrongpassword` with a strong password and don't forget to write it down)
|
|
|
```sql
|
|
|
CREATE USER 'framadate'@'localhost' IDENTIFIED BY 'useastrongpassword';
|
|
|
GRANT ALL PRIVILEGES ON `framadate`.* TO 'framadate'@'localhost';
|
|
|
```
|
|
|
*If the database is on a different server than the application, replace `localhost` with correct value.*
|
|
|
Once the form filled and sent, the file `app/inc/config.php` will be generated on your webserver and you will be redirected to the migration page.
|
|
|
|
|
|
## PostgreSQL
|
|
|
The migration page handles:
|
|
|
- Installing the whole database
|
|
|
- Updating the database when the app has new updates
|
|
|
|
|
|
Connect to the database server
|
|
|
```bash
|
|
|
su - postgres
|
|
|
psql
|
|
|
```
|
|
|
> Warning: loading the migration page can take a while because it's applying all required database upgrades !
|
|
|
|
|
|
Create a dedicated user (replace `useastrongpassword` with a strong password and don't forget to write it down)
|
|
|
```sql
|
|
|
CREATE USER 'framadate'@'localhost' WITH PASSWORD 'useastrongpassword';
|
|
|
```
|
|
|
## Advanced settings
|
|
|
|
|
|
*If the database is on a different server than the application, replace `localhost` with correct value.*
|
|
|
Advanced settings, like the SMTP credentials or the default poll duration, must be manually filled inside the file `app/inc/config.php` on the webserver.
|
|
|
|
|
|
Create the database
|
|
|
```sql
|
|
|
CREATE DATABASE framadate;
|
|
|
```
|
|
|
## Clean URL
|
|
|
|
|
|
To have fancy URLs, activate URL rewriting by activating the provided `.htaccess` file, by renaming it from `htaccess.txt` to `.htaccess`:
|
|
|
|
|
|
Grant all rights to the `framadate` user on the `framadate` database.
|
|
|
```sql
|
|
|
GRANT ALL PRIVILEGES ON DATABASE framadate to 'framadate'@'localhost';
|
|
|
```bash
|
|
|
mv htaccess.txt .htaccess
|
|
|
```
|
|
|
|
|
|
You can now quit `psql` and the `postgres` user with double `Ctrl` + `D`.
|
|
|
## Secure admin section
|
|
|
|
|
|
# Getting Framadate
|
|
|
The `/admin` folder shouldn't be open to anyone but the admin of the Framadate instance, you should secure it with `.htaccess` and `.htpasswd` files.
|
|
|
|
|
|
You need to get inside your server's web directory, such as `/var/www/html` on Debian (or Ubuntu).
|
|
|
Create a `.htaccess` file inside `admin/` and put the following content:
|
|
|
|
|
|
```bash
|
|
|
cd /var/www/html
|
|
|
```apache
|
|
|
AuthType Basic
|
|
|
AuthName "Administration"
|
|
|
AuthUserFile "/var/www/framadate/admin/.htpasswd"
|
|
|
Require valid-user
|
|
|
```
|
|
|
|
|
|
Then, download and unzip the latest version of Framadate
|
|
|
Then create the `.htpasswd` file with the following command (you may need to install the package `apache2-utils`) where you change the values for user and password to your convenience:
|
|
|
```bash
|
|
|
sudo -u www-data wget https://framasoft.frama.io/framadate/latest.zip
|
|
|
sudo -u www-data unzip latest.zip
|
|
|
sudo -u www-data htpasswd -bc /var/www/framadate/admin/.htpasswd user password
|
|
|
```
|
|
|
|
|
|
A log file `admin/stdout.log` must be created and be writable by your web server. Something like that should do it:
|
|
|
## Secure htaccess and htpassword
|
|
|
|
|
|
```bash
|
|
|
touch admin/stdout.log
|
|
|
chmod 700 admin/stdout.log
|
|
|
chown www-data admin/stdout.log
|
|
|
In order to disallow read access to the `.htaccess` and `.htpasswd` files, you can add this section to the `.htaccess` file:
|
|
|
```apache
|
|
|
<FilesMatch "^\.ht.*">
|
|
|
deny from all
|
|
|
satisfy all
|
|
|
ErrorDocument 403 "Forbidden"
|
|
|
</FilesMatch>
|
|
|
``` |
|
|
|
|
|
You can now begin to [install Framadate](Install/Install). |
|
|
\ No newline at end of file |