轻量级的开源微博程序Pleroma的搭建记录

By admin at 2019-08-31 14:26 • 79次点击
admin

相对于其它开源的微博程序,Pleroma的特点是:高性能/内存使用率低,低配置的机器即可运行,

下面是折腾记录的详细过程,参考了荒岛的文章,但是还是有些细节没有详说,这里记录一下。

系统搭建为Debian 10 ,纯净的系统

apt -y install build-essential git nginx certbot python-certbot-nginx 
apt -y install postgresql postgresql-contrib elixir erlang-inets erlang-dev erlang-tools 
apt -y install erlang-parsetools erlang-eldap erlang-ssh erlang-xmerl

命令最好一条条复制,否则回导致某个软件没有安装而报错。。。

添加以过运行权限的账号,即不允许登录系统的账号

useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma

mkdir -p /opt/pleroma
chown -R pleroma:pleroma /opt/pleroma
sudo -u pleroma git clone -b master https://git.pleroma.social/pleroma/pleroma /opt/pleroma
cd /opt/pleroma
sudo -u pleroma mix deps.get
sudo -u pleroma mix pleroma.instance gen

更改为自己的域名和邮箱

What domain will your instance use? (e.g pleroma.soykaf.com) []  pleroma.koko.cat
What is the name of your instance? (e.g. Pleroma/Soykaf) []  Pleroma/imlala     
What is your admin email address? []  [email protected]
What email address do you want to use for sending email notifications? [[email protected]]  
Do you want search engines to index your site? (y/n) [y] 

一下信息默认即可

Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n) [n]   
What is the hostname of your database? [localhost]  
What is the name of your database? [pleroma]  
What is the user used to connect to your database? [pleroma]  
What is the password used to connect to your database? [autogenerated]  
Would you like to use RUM indices? [n]  
What port will the app listen to (leave it if you are using the default setup with nginx)? [4000]  
What ip will the app listen to (leave it if you are using the default setup with nginx)? [127.0.0.1]  
What directory should media uploads go in (when using the local uploader)? [uploads]  
What directory should custom public files be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)? [instance/static/]
mv config/generated_config.exs  config/prod.secret.exs
sudo -u postgres psql -f config/setup_db.psql
sudo -u pleroma MIX_ENV=prod mix ecto.migrate
cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
systemctl start pleroma.service
systemctl enable pleroma.service
vi /etc/nginx/conf.d/yourname.conf
server {
    listen       80;
    server_name  yourname;
    client_max_body_size 10M;

    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:4000;
    }
}

签发HTTPs 证书

certbot --nginx --agree-tos --no-eff-email

管理员账户创建,注意一定要进入到Pleroma的根目录下执行

sudo -u pleroma MIX_ENV=prod mix pleroma.user new username [email protected] --admin

现在打开你的网站应该可以看到安装成功了

下面是注意事项

useradd: command not found的解决方法

利用su -,非su进入root,然后再敲useradd即可

mix command not found 的解放方法

没有安装elixir erlang的相关系统环境,执行上面的命令重装一次即可。。。。

参考官网

https://elixir-lang.org

荒岛的原文参考

https://lala.im/6254.html 1

Pleroma官网和文档

https://git.pleroma.social/pleroma/pleroma 1

量级, 程序, pleroma, 开源, 微博


目前尚无回复
登录 后发表评论