Plume-org / docs

The documentation for Plume

Home Page:https://docs.joinplu.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install Plume on Ubuntu 18 a complete guide

iamdoubz opened this issue Β· comments

Install Plume on Ubuntu 18.04

A meditative guide

This was 8 hours of solid work in order to get every single detailed hashed out for installing from source on Ubuntu 18. I hope this helps somebody.

What this guide will cover

  1. Must have a server setup already with apache2 as your web server
  2. Will be using PostgreSQL as your database

Givens

  1. apachectl -V "Apache2" needs to be version 2.4.17 or higher
  2. A working knowledge of bash, command line typing, and lack of fat fingers :D
  3. You are using systemd to start and stop all of your services
  4. 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

  1. Install default dependencies: sudo apt install gettext git curl gcc make openssl libssl-dev pkg-config
  2. 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 su - postgres psql
    ii. List databases (from psql window): \l
    iii. Quit/Exit: \q
  3. 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 ~
  4. 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 like stable installed - rustc 1.37.0 (eae3437df 2019-08-13) and Rust is installed now. Great!
  5. 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 ~
  6. 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)
  7. 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

  1. Install Plume and CLI tools (~36 minutes to build and compile)
    a. cargo clean && cargo build --features postgres && cargo install --debug --force --features postgres
  2. Build plm and CLI helper (~12 minutes to build and compile)
    a. cargo install --no-default-features --debug --force --features postgres --path plume-cli
  3. To start PostgreSQL, and create a user and database, you will need to use a root account
  4. Ensure the PostgreSQL service is running, use b to start it if not
    a. sudo service postgresql status
    b. sudo service postgresql start
  5. 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
  6. Now you can go back to your plume user account and be in the Plume directory
    a. cd ~/Plume
  7. 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
    
  8. Populate the database
    a. diesel migration run
  9. Setup your instance
    a. plm instance new
    b. plm users new --admin
  10. Create search index
    a. plm search init
  11. 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
    
  12. If you have gotten this far, congrats! Plume is ready to go!
  13. 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
    
  14. Enable the service with sudo systemctl enable plume
  15. Start the service with sudo service plume start
  16. Reverse Proxy for Apache2
    a. Please use this config

Hello! This seems very helpful, but I'm afraid Github issues are not the best place for a guide like that (it will probably get lost with time, and issues are more like our "to-do list", so a guide is a bit out of scope).

Maybe there are things that were not clear in the docs and that could be improved, if you had to spend 8 hours to install Plume? Parts of this guide could probably be added to the docs directly I think (otherwise, publishing it on your own blog/website would probably help to keep it visible with time).

Agreed. But, just in case anyone searches here how to install, they may find it.

I'm moving this issue to the docs repo, to remind me to check what is different between your guide and the official docs, and to eventually update our docs.