Write Freely Tutorial
# Write Freely
## How to Build a Website
Please exercise care when using this tutorial. I use it and it works perfectly. The theme is “painkiller.” Write.as themes
Write Freely
```
useradd -r -m -d /srv/writefreely -s /bin/bash writefreely
usermod -a -G www-data writefreely
su - writefreely
```
Download From GIT
```
wget https://github.com/writefreely/writefreely/releases/download/v0.15.0/writefreely_0.15.0_linux_amd64.tar.gz
tar xvzf writefreely_0.15.0_linux_amd64.tar.gz
mv writefreely dominio.com
```
**EXIT**
Install Maria DB
```
apt install mariadb-server
mysql -u root -p
CREATE DATABASE writefreely;
GRANT ALL PRIVILEGES ON writefreely.* TO 'username'@'localhost' IDENTIFIED BY 'yoursimplepass';
```
**EXIT**
Generate config
```
su - writefreely
cd dominio.com
./writefreely --config
```
**************************************************
In the generated file, we will modify the following data:
username = you
password = simple for now
database = writefreely
site_name = My Wondrous Blog
site_description = Description of blog
host = https://domain.com
default_visibility = public
Once the file is modified we save it (control + X, Y, ENTER) and we give it to itself). Then we type the following codes to generate the encryption key and the administrator user.
```
./writefreely db init
./writefreely keys generate
./writefreely --create-admin usname:simple password
```
We will create the service in Systemd and add its content from the root user (you have to exit the writefreely user, if you don't know it's just writing- exit):
```
nano /etc/systemd/system/writefreely.service
```
******************************************************
[Unit]
Description=WriteFreely Instance
After=syslog.target network.target mysql.service
[Service]
Type=simple
StandardOutput=syslog
StandardError=syslog
User=writefreely
Group=www-data
WorkingDirectory=/srv/writefreely/domain.com
ExecStart=/srv/writefreely/domain.com/writefreely
Restart=always
[Install]
WantedBy=multi-user.target
*****************************************************
(If you want your blog to be a single user instance replace multi above with - single-user.target.)
After this we save the file (control + X, and give it to itself) and continue:
```
systemctl daemon-reload
systemctl start writefreely
systemctl enable writefreely
```
Now we will start a very important part, configure the Nginx:
```
apt install nginx certbot python3-certbot-nginx
nano /etc/nginx/sites-available/writefreely.conf
```
With the last code we have created a file where we will write the following, remembering to change domain.com for your domain:
************************************************************
server {
listen 80;
listen [::]:80;
server_name example.com;
gzip on;
gzip_types
application/javascript
application/x-javascript
application/json
application/rss+xml
application/xml
image/svg+xml
image/x-icon
application/vnd.ms-fontobject
application/font-sfnt
text/css
text/plain;
gzip_min_length 256;
gzip_comp_level 5;
gzip_http_version 1.1;
gzip_vary on;
location ~ ^/.well-known/(webfinger|nodeinfo|host-meta) {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
}
location ~ ^/(css|img|js|fonts)/ {
root /srv/writefreely/domain.com/static;
# Optionally cache these files in the browser:
# expires 12M;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
}
}
************************************************************
We save the file and enable it:
```
cd /etc/nginx/sites-enabled/
ln -s ../sites-available/writefreely.conf
nginx -t
systemctl reload nginx
```
And to finish, we go with the certbot:
```
apt install -y certbot python3-certbot-nginx
certbot
```
Certbot asks three questions. Answer Y, N, 1
=======================================================
**_That's it!_**
Enter your domain URL into your favorite browser, go to your new website, enter your simple credentials (if you took my advice here), change to complex password (alpha-numeric and symbols @#$% etc.) and just flat go for it! Learning takes time and markdown is required to emphasize and italicize etc. You're smart and you are going to think it's a breeze.
Views: 52