LAPP Stack for PI: Difference between revisions
Jump to navigation
Jump to search
(→Remote) |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
===Apache=== | ===Apache=== | ||
<source lang="bash"> | <source lang="bash"> | ||
sudo su | |||
apt install apache2/stable | apt install apache2/stable | ||
CKI_A2_SERVER_NAME_FIND='#ServerName www.example.com';\ | |||
CKI_A2_SERVER_NAME_FILL='ServerName web.bgd.chorke.org';\ | |||
CKI_A2_SERVER_ADMN_FIND='ServerAdmin webmaster@localhost';\ | |||
CKI_A2_SERVER_ADMN_FILL='ServerAdmin [email protected]';\ | |||
systemctl reload apache2 | CKI_A2_DFAULT_SITE_CONF='/etc/apache2/sites-enabled/000-default.conf';\ | ||
sed -i "s|$CKI_A2_SERVER_NAME_FIND|$CKI_A2_SERVER_NAME_FILL|" "$CKI_A2_DFAULT_SITE_CONF";\ | |||
sed -i "s|$CKI_A2_SERVER_ADMN_FIND|$CKI_A2_SERVER_ADMN_FILL|" "$CKI_A2_DFAULT_SITE_CONF";\ | |||
systemctl reload apache2;\ | |||
apachectl -t | apachectl -t | ||
</source> | </source> | ||
Line 51: | Line 55: | ||
# comma-separated list of addresses; | # comma-separated list of addresses; | ||
# defaults to 'localhost'; use '*' for all | # defaults to 'localhost'; use '*' for all | ||
# 'localhost,10.19.83.10' | |||
# (change requires restart) | # (change requires restart) | ||
</source> | </source> | ||
Line 58: | Line 63: | ||
# IPv4 local connections: | # IPv4 local connections: | ||
host all all 127.0.0.1/32 md5 | host all all 127.0.0.1/32 md5 | ||
host all all 172.20.0.1/16 md5 | |||
host all all 10.19.83.1/24 md5 | host all all 10.19.83.1/24 md5 | ||
</source> | </source> | ||
<source lang="bash"> | |||
systemctl restart postgresql | |||
update-rc.d postgresql disable | |||
</source> | |||
<source lang="bash"> | |||
apt install nmap/stable | |||
nmap -p 5432 localhost | |||
nmap -p 5432 10.19.83.5 | |||
</source> | |||
==References== | |||
* [[Install pgAdmin 4 in Server Mode]] | |||
* [[Apache/Multilang Errordoc]] | |||
* [[Apache/AutoIndex]] | |||
* [[Apache/Proxy]] |
Latest revision as of 22:58, 9 August 2023
The LAPP stack is an open source web platform that can be used to run dynamic web sites and servers. It is considered by many to be a powerful alternative to the more popular LAMP stack and includes Linux, Apache, PostgreSQL (instead of MySQL) and PHP, Python or Perl.
Install
Apache
sudo su
apt install apache2/stable
CKI_A2_SERVER_NAME_FIND='#ServerName www.example.com';\
CKI_A2_SERVER_NAME_FILL='ServerName web.bgd.chorke.org';\
CKI_A2_SERVER_ADMN_FIND='ServerAdmin webmaster@localhost';\
CKI_A2_SERVER_ADMN_FILL='ServerAdmin [email protected]';\
CKI_A2_DFAULT_SITE_CONF='/etc/apache2/sites-enabled/000-default.conf';\
sed -i "s|$CKI_A2_SERVER_NAME_FIND|$CKI_A2_SERVER_NAME_FILL|" "$CKI_A2_DFAULT_SITE_CONF";\
sed -i "s|$CKI_A2_SERVER_ADMN_FIND|$CKI_A2_SERVER_ADMN_FILL|" "$CKI_A2_DFAULT_SITE_CONF";\
systemctl reload apache2;\
apachectl -t
PHP
apt install php7.3-fpm/stable libapache2-mod-php7.3/stable
a2enmod proxy_fcgi setenvif
a2enconf php7.3-fpm
a2enmod php7.3
systemctl restart apache2
Postgres
apt install postgresql-11/stable
apt install phppgadmin/stable
sed -i "s/NOT pp.proisagg/pp.prokind='f'/g" /usr/share/phppgadmin/classes/database/Postgres.php
sed -i "s/NOT p.proisagg/p.prokind='f'/g" /usr/share/phppgadmin/classes/database/Postgres.php
systemctl restart apache2
CREATE DATABASE chorke_boot_dev;
CREATE USER chorke_boot_dev WITH ENCRYPTED PASSWORD 'chorke_boot_dev';
GRANT ALL PRIVILEGES ON DATABASE chorke_boot_dev TO chorke_boot_dev;
Remote
nano /etc/apache2/conf-enabled/phppgadmin.conf
AllowOverride All
Require all granted
#Require local
nano /etc/postgresql/11/main/postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# 'localhost,10.19.83.10'
# (change requires restart)
nano /etc/postgresql/11/main/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 172.20.0.1/16 md5
host all all 10.19.83.1/24 md5
systemctl restart postgresql
update-rc.d postgresql disable
apt install nmap/stable
nmap -p 5432 localhost
nmap -p 5432 10.19.83.5