Porównaj commity

...

2 Commity

Autor SHA1 Wiadomość Data
Rui Carmo 88f98afb63
Merge pull request #289 from mariusa/master
add centos using simplified nginx setup
2023-03-24 08:20:29 +00:00
Marius df54d24287 rename Ubuntu 22.04
add centos
2023-03-23 14:56:57 +02:00
4 zmienionych plików z 65 dodań i 34 usunięć

Wyświetl plik

@ -0,0 +1,61 @@
# Installation on CentOS 9
> This is a standalone, distribution-specific version of `INSTALL.md`. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)
## Dependencies
Before installing `piku`, you need to install the following packages:
```bash
dnf in -y ansible nginx nodejs npm postgresql postgresql-server python3 uwsgi
```
## Set up the `piku` user
```bash
export PAAS_USERNAME=piku
adduser --groups nginx $PAAS_USERNAME
# copy & setup piku.py
sudo su - $PAAS_USERNAME -c "wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup"
```
## Set up SSH access
See INSTALL.md
## uWSGI Configuration
[FYI The uWSGI Emperor – multi-app deployment](https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html)
```bash
sudo ln -s /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi.d/piku.ini
sudo systemctl restart uwsgi
```
## `nginx` Configuration
[FYI Setting up and configuring NGINX](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/deploying_web_servers_and_reverse_proxies/setting-up-and-configuring-nginx_deploying-web-servers-and-reverse-proxies)
```bash
echo "include /home/$PAAS_USERNAME/.piku/nginx/*.conf;" > /usr/share/nginx/modules/piku.conf
sudo systemctl restart nginx
```
## Set up systemd.path to reload nginx upon config changes
```bash
# Set up systemd.path to reload nginx upon config changes
sudo su -
git clone https://github.com/piku/piku.git # need a copy of some files
cp -v piku/piku-nginx.{path,service} /etc/systemd/system/
systemctl enable piku-nginx.{path,service}
systemctl start piku-nginx.path
# Check the status of piku-nginx.service
systemctl status piku-nginx.path # should return `active: active (waiting)`
```
## Notes
[uwsgi]: https://github.com/unbit/uwsgi

Wyświetl plik

@ -24,7 +24,7 @@ See INSTALL.md
## uWSGI Configuration
[uWSGI][uwsgi] in Bionic requires very little configuration, since it is already properly packaged. All you need to do is place a link to the `piku` configuration file in `/etc/uwsgi/apps-enabled`:
[uWSGI][uwsgi] requires very little configuration, since it is already properly packaged. All you need to do is place a link to the `piku` configuration file in `/etc/uwsgi/apps-enabled`:
```bash
sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini

Wyświetl plik

@ -17,43 +17,14 @@ sudo apt-get install -y build-essential certbot git \
uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python3 \
uwsgi-plugin-python3 uwsgi-plugin-tornado-python3
```
## Setting up the `piku` user
`piku` requires a separate user account to run. To create a new user with the right group membership (we're using the built-in `www-data` group because it's generally thought of as a less-privileged group), enter the following commands:
## Set up the `piku` user, Set up SSH access
```bash
# pick a username
export PAAS_USERNAME=piku
# create it
sudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data $PAAS_USERNAME
```
This user _is not supposed to login to your system_. Instead, you'll interact with `piku` via SSH, and set things up by using `su`:
```bash
# copy your public key to /tmp (I'm assuming it's the first entry in authorized_keys)
head -1 ~/.ssh/authorized_keys > /tmp/pubkey
# install piku and have it set up SSH keys and default files
sudo su - $PAAS_USERNAME -c "wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup && python3 ~/piku.py setup:ssh /tmp/pubkey"
rm /tmp/pubkey
```
The `setup` output should be something like this:
```
Creating '/home/piku/.piku/apps'.
Creating '/home/piku/.piku/repos'.
Creating '/home/piku/.piku/envs'.
Creating '/home/piku/.piku/uwsgi'.
Creating '/home/piku/.piku/uwsgi-available'.
Creating '/home/piku/.piku/uwsgi-enabled'.
Creating '/home/piku/.piku/logs'.
Setting '/home/piku/piku.py' as executable.
```
See INSTALL.md
## uWSGI Configuration
[uWSGI][uwsgi] in Jammy requires very little configuration, since it is already properly packaged. All you need to do is place a link to the `piku` configuration file in `/etc/uwsgi/apps-enabled`:
[uWSGI][uwsgi] requires very little configuration, since it is already properly packaged. All you need to do is place a link to the `piku` configuration file in `/etc/uwsgi/apps-enabled`:
```bash
sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini

Wyświetl plik

@ -23,7 +23,6 @@ export PAAS_USERNAME=piku
sudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data $PAAS_USERNAME
# copy & setup piku.py
sudo su - $PAAS_USERNAME -c "wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup"
rm /tmp/pubkey
```
The `setup` output should be something like this: