LAMP Stack for PI: Difference between revisions
Jump to navigation
Jump to search
(→Remote) |
|||
Line 56: | Line 56: | ||
==References== | ==References== | ||
* [[Apache/Proxy]] | |||
* [[Apache/AutoIndex]] | * [[Apache/AutoIndex]] | ||
* [[Apache/Multilang Errordoc]] | * [[Apache/Multilang Errordoc]] |
Revision as of 02:28, 31 August 2019
A LAMP stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.
Install
Apache
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
MySQL
apt install mariadb-server-10.3/stable
apt install phpmyadmin/stable
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
systemctl restart apache2
CREATE SCHEMA IF NOT EXISTS chorke_boot_dev;
CREATE USER 'chorke_boot_dev'@'%' IDENTIFIED BY 'chorke_boot_dev';
GRANT ALL PRIVILEGES ON chorke_boot_dev.* TO 'chorke_boot_dev'@'%';
DROP USER 'chorke_boot_dev'@'%'
Remote
nano /etc/mysql/mariadb.conf.d/50-server.cnf
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
systemctl restart mysql
update-rc.d mysql disable