A meditative guide
What this guide will cover
- Must have a server setup already with apache2 as your web server
- Will be using PostgreSQL as your database
Givens
apachectl -V
“Apache2” needs to be version 2.4.17 or higher- A working knowledge of bash, command line typing, and lack of fat fingers π
- You are using systemd to start and stop all of your services
- My Ubuntu 18.04 server is running in a VM on a Windows 10 Pro laptop… brief specs:
a. i7-4810MQ, 24GB RAM, 1TB SSD Windows OS, 2TB SSD Data drive with VM files on it
b. 4 of 8 threads and 8GB dedicated to VM (runs great!)
Steps
- Install default dependencies:
sudo apt install gettext git curl gcc make openssl libssl-dev pkg-config
- Install PostgreSQL 11
a. Guide I used
b.sudo apt install wget ca-certificates
c.wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
d.sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs` -pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
e.sudo apt update
f.sudo apt install postgresql postgresql-contrib libpq-dev
g. Helpful PostgreSQL tips:
i. Connect to interface (similar to mysql -u root -p):sudo -u postgres psql
ii. List databases (from psql window):\l
iii. Quit/Exit:\q
iv. Export DB:sudo -u postgres pg_dump db > db.sql
- Create a new user for Plume
a.sudo adduser plume
b. Set a password for it that you can remember
c. Log in as plume:su - plume
d. Go to plume’s home directory:cd ~
- Install Rust
a.curl https://sh.rustup.rs -sSf | sh
b. When prompted for Option 1, 2, or 3, press 1 [Proceed with installation (default)], then enter
c. This will take a bit depending on your system network’s connection ~10 minutes
d. At the time of this writing, you should get something likestable installed - rustc 1.37.0 (eae3437df 2019-08-13)
andRust is installed now. Great!
- Tell your system how to use Rust
export PATH="$PATH:/home/plume/.cargo/bin:/home/plume/.local/bin:/usr/local/sbin"
a. You need to put this in you .bashrc file source:
i.nano ~/.bashrc
ii.export PATH="$HOME/.cargo/bin:$PATH"
b. Maybe this too?????:source $HOME/.cargo/env
c. Go ahead and exit (log out of plume)
d. Log back in as plume
e.cd ~
- Check to see if Rust and Cargo are actually installed
a.rustc --version
– Response: rustc 1.37.0 (eae3437df 2019-08-13)
b. cargo --version
– Response: cargo 1.37.0 (9edd08916 2019-08-02)
07. Download Plume and enter the directory
a. git clone https://github.com/Plume-org/Plume.git&&cd Plume
*** Note ***: the next command can and will take a long time
- Install Plume and CLI tools (~36 minutes to build and compile)
a.cargo clean && cargo build --features postgres && cargo install --debug --force --features postgres
- Build plm and CLI helper (~12 minutes to build and compile)
a.cargo install --no-default-features --debug --force --features postgres --path plume-cli
- To start PostgreSQL, and create a user and database, you will need to use a root account
- Ensure the PostgreSQL service is running, use b to start it if not
a.sudo service postgresql status
b.sudo service postgresql start
- Create user and database for Plume to use
a.sudo -u postgres createuser -P plume
i. Make a secure password for your plume PostgreSQL user!
b.sudo -u postgres createdb -O plume plume
- Now you can go back to your plume user account and be in the Plume directory
a. `cd ~/Plume - Create an .env file that the plume server will read
a.nano .env
and populate with this changing the postgres user name, password, database name and ROCKET_SECRET_KEY as needed
# Postgres SQL setup
DATABASE_URL=postgres://plume:password@127.0.0.1:5432/plume
# For PostgreSQL: migrations/postgres
MIGRATION_DIRECTORY=migrations/postgres
# The domain on which your instance will be available
BASE_URL=my.plume.url
# Secret key used for private cookies and CSRF protection `openssl rand -base64 32`
ROCKET_SECRET_KEY=
ROCKET_ADDRESS=127.0.0.1
ROCKET_PORT=7878
# Mail settings
MAIL_SERVER=my.plume.url
MAIL_USER=admin@my.plume.url
MAIL_PASSWORD=emailpassword
MAIL_HELO_NAME=my.plume.url
MAIL_ADDRESS=no-reply@my.plume.url
# Custom icons
#PLUME_LOGO=icons/custom/myicons/plume.png
#PLUME_LOGO_FAVICON=icons/custom/myicons/plume32.png
#PLUME_LOGO_48=icons/custom/myicons/plume48.png
#PLUME_LOGO_72=icons/custom/myicons/plume72.png
#PLUME_LOGO_96=icons/custom/myicons/plume96.png
#PLUME_LOGO_144=icons/custom/myicons/plume144.png
#PLUME_LOGO_160=icons/custom/myicons/plume160.png
#PLUME_LOGO_192=icons/custom/myicons/plume192.png
#PLUME_LOGO_256=icons/custom/myicons/plume256.png
#PLUME_LOGO_512=icons/custom/myicons/plume512.png
- Populate the database
a.diesel migration run
- Setup your instance
a.plm instance new
b.plm users new --admin
- Create search index
a.plm search init
- You should be ready to test everything before you configure systemd using
a.plume
b. If there is anything I forgot, it will tell you here
c. If not, you should get a bunch of text to the extent of
plume@computer:~/Plume$ plume
Configuration read from /home/plume/Plume/.env
π§ Configured for development.
=> address: 127.0.0.1
=> port: 9092
=> log: normal
=> workers: 8
=> secret key: provided
=> limits: forms = 128KiB, json* = 1MiB
=> keep-alive: 5s
=> tls: disabled
π° Mounting /:
...
π Rocket has launched from http://127.0.0.1:7878
- If you have gotten this far, congrats! Plume is ready to go!
- Configure plume to start as a service on boot
a.sudo nano /etc/systemd/system/plume.service
and in that file
[Unit]
Description=plume - federated blogging application
After=network.target postgresql.service
[Service]
Type=simple
User=plume
WorkingDirectory=/home/plume/Plume
ExecStart=/home/plume/.cargo/bin/plume
TimeoutSec=30
SyslogIdentifier=plume
Restart=always
[Install]
WantedBy=multi-user.target
- Enable the service with
sudo systemctl enable plume
- Start the service with
sudo service plume start
- Reverse Proxy for Apache2
a. Please use this config