-
Notifications
You must be signed in to change notification settings - Fork 94
How to host LibreX
hnhx edited this page Feb 5, 2023
·
9 revisions
These instructions are for Debian GNU/Linux but it should be similar on all GNU/Linux distros and *BSD systems.
Install the packages
sudo apt install php php-fpm php-dom php-curl nginx git
Clone LibreX
git clone https://github.com/hnhx/librex.git
Rename the config and opensearch file
cd librex
mv config.php.example config.php
mv opensearch.xml.example opensearch.xml
Change opensearch.xml to point to your domain
sed -i 's/http:\/\/localhost:80/https:\/\/your.domain/g' opensearch.xml
Example nginx config
server {
listen 80;
server_name your.domain;
root /var/www/html/librex;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
Remove the .php extension (optional)
location / {
try_files $uri $uri/ @extensionless-php;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
Start the php-fpm and the nginx systemd service
sudo systemctl enable --now php-fpm nginx
Now LibreX should be running!