1- # Introduction
1+ # LinuxFr.org installation
2+
3+ ## Introduction
24
35This document will give you steps to install LinuxFr.org website on your
4- Debian Stretch development machine.
6+ Debian Trixie (stable) development machine.
57
68Note that all commands which require root access are prefixed by ` sudo ` .
79
8- # Install Debian packages
10+ ## Install Debian packages
911
10- Packages to install from main Stretch source:
12+ Packages to install from main Debian source:
1113
12- ```
13- ~ $ sudo apt install mysql-server mysql-client libmysql++-dev git \
14- build-essential openssl libreadline-dev curl libcurl4-openssl-dev zlib1g \
15- zlib1g-dev libssl-dev libxml2-dev libxslt-dev autoconf libgmp-dev libyaml-dev \
16- ncurses-dev bison automake libtool imagemagick libc6-dev hunspell \
17- hunspell-fr-comprehensive redis-server ruby ruby-dev ruby-rack
14+ ``` sh
15+ ~ $ sudo apt install default-mysql-server default-libmysqlclient-dev \
16+ libmysql++-dev git build-essential openssl libreadline-dev curl \
17+ libcurl4-openssl-dev zlib1g zlib1g-dev libssl-dev libxml2-dev libxslt-dev \
18+ autoconf libgmp-dev libyaml-dev ncurses-dev bison automake libtool \
19+ imagemagick libc6-dev hunspell hunspell-fr-comprehensive redis-server \
20+ ruby ruby-dev
1821```
1922
2023Note:
21- * you can use libcurl4-gnutls-dev instead of libcurl4-openssl-dev.
22- * the ` mysql ` packages will install MariaDB on Debian Stretch
2324
24- # Get LinuxFr.org code and external resources
25+ - you can use libcurl4-gnutls-dev instead of libcurl4-openssl-dev.
26+ - the ` default-mysql-server ` package will install MariaDB on Debian
27+
28+ ## Get LinuxFr.org code and external resources
2529
2630Use git to get LinuxFr.org sources:
2731
28- ```
32+ ``` sh
2933~ $ git clone git://github.com/linuxfrorg/linuxfr.org.git
3034```
3135
3236To be able to reach ruby external resources, you need the ` bundler ` packager.
33- The minimal required version is written at the end of the ` Gemfile.lock ` file.
34- Actually, Debian has the ` 1.13.6 ` version and the lock file requires already
35- the ` 1.16.4 ` version.
36-
37- So we first install the ` bundler ` packager directly from ` rubygems.org ` :
38-
39- ```
40- ~ $ gem install --user-install bundler
41- ```
42-
43- Don't forget to update your PATH environment according to the warning message
44- shown during installation.
37+ It is now installed by default with Ruby.
4538
4639Now, we can reach external Ruby resources:
4740
48- ```
41+ ``` sh
4942~ $ cd linuxfr.org
5043~ /linuxfr.org $ bundle config set path ' vendor/bundle'
5144~ /linuxfr.org $ bundle install
@@ -61,11 +54,11 @@ the collaborative `redaction` space to work asynchronously.
6154
6255To install it, the simplest is to run ` gem install --user-install board-linuxfr `
6356
64- # Configure LinuxFr.org
57+ ## Configure LinuxFr.org
6558
6659To configure LinuxFr.org, you need to copy both sample configuration files:
6760
68- ```
61+ ``` sh
6962~ /linuxfr.org $ cp config/database.yml{.sample,}
7063~ /linuxfr.org $ cp config/secrets.yml{.sample,}
7164```
@@ -80,17 +73,17 @@ In this document we'll assume you took the default values for database names:
8073Note that, on production, you'll need to customize secrets inside
8174the ` secrets.yml ` file.
8275
83- # Configure SQL data base
76+ ## Configure SQL data base
8477
8578Prepare time zones information inside the ` mysql ` database:
8679
87- ```
80+ ``` sh
8881~ $ mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql mysql
8982```
9083
9184Create LinuxFr.org databases and MySQL users:
9285
93- ```
86+ ``` sql
9487~/ linuxfr .org $ sudo mysql
9588> CREATE DATABASE linuxfr_rails CHARACTER SET utf8mb4;
9689> CREATE USER linuxfr_rails IDENTIFIED BY ' linuxfr_rails password' ;
@@ -106,15 +99,15 @@ Create LinuxFr.org databases and MySQL users:
10699Now every thing is ready and we can ask ` rails ` to setup our databases with
107100every structures needed:
108101
109- ```
102+ ``` sh
110103~ /linuxfr.org $ bin/rails db:setup
111104```
112105
113- # Run LinuxFr.org
106+ ## Run LinuxFr.org
114107
115108Now, you can run LinuxFr.org server with:
116109
117- ```
110+ ``` sh
118111~ /linuxfr.org $ bin/rails server
119112```
120113
@@ -123,23 +116,23 @@ virtual machine using the `http://localhost:3000` URL.
123116
124117Additionally, you run the boards within another terminal:
125118
126- ```
119+ ``` sh
127120~ /linuxfr.org $ board-linuxfr -s -a localhost -p 9000
128121```
129122
130- # Configure redirection
123+ ## Configure redirection
131124
132125This extra step isn't really needed to be able to use LinuxFr.org.
133126
134127In the ` config/environments/development.rb ` file, there are these variables:
135128
1361291 . ` MY_DOMAIN ` and ` IMG_DOMAIN ` which define the domain name for the LinuxFr
137- service and the image caching service.
138- By default both domain names are ` dlfp.lo ` .
130+ service and the image caching service.
131+ By default both domain names are ` dlfp.lo ` .
139132
1401332 . ` MY_PUBLIC_URL ` and ` IMG_PUBLIC_PORT ` which define the public HTTP port for
141- both services.
142- By default both ports are ` 80 ` .
134+ both services.
135+ By default both ports are ` 80 ` .
143136
144137These two set of variables are used to build the public url of the two
145138services. By default both public urls are ` http://dlfp.lo ` .
@@ -150,13 +143,13 @@ install a website locally using this domain name.
150143
151144Set the domain ` dlfp.lo ` to target ` localhost ` :
152145
153- ```
146+ ``` sh
154147~ $ sudo bash -c ' echo "127.0.0.1 dlfp.lo" >> /etc/hosts'
155148```
156149
157150For Nginx, create a new server configuration with content like:
158151
159- ```
152+ ``` nginx
160153server {
161154 server_name dlfp.lo;
162155 access_log /var/log/nginx/dlfp.access.log;
@@ -169,7 +162,7 @@ server {
169162
170163 # Avatars files uploaded on linuxfr server are stored in partitions
171164 # with folder name containing 3 digits
172- location ~ ^/avatars/\d\d\d/ {
165+ location ~ ^/avatars/\d\d\d/ {
173166 root /home/linuxfr/linuxfr.org/uploads;
174167 }
175168
@@ -203,14 +196,14 @@ server {
203196
204197and restart the web server:
205198
206- ```
199+ ``` sh
207200~ $ sudo systemctl restart nginx
208201```
209202
210203Now, on the virtual machine, you can access LinuxFr.org with the
211204` http://dlfp.lo ` URL.
212205
213- # Create administrator
206+ ## Create administrator
214207
215208To create new users, you can use directly the website.
216209
@@ -219,7 +212,7 @@ in the database.
219212
220213For example, to set as admin the user with login ` admin_login ` :
221214
222- ```
215+ ``` sql
223216$ sudo mysql linuxfr_rails
224217> update accounts set role = ' admin' where login = ' admin_login' ;
225218```
0 commit comments