LAMP Stack for PI: Difference between revisions
Jump to navigation
Jump to search
Line 53: | Line 53: | ||
systemctl restart mysql | systemctl restart mysql | ||
update-rc.d mysql disable | update-rc.d mysql disable | ||
</source> | |||
==Knowledge== | |||
<source lang="sql"> | |||
SELECT user, plugin, host FROM mysql.user WHERE user = 'root'; | |||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'p@$$w0rd'; | |||
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root'; | |||
</source> | </source> | ||
Revision as of 07:27, 9 January 2021
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
Knowledge
SELECT user, plugin, host FROM mysql.user WHERE user = 'root';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'p@$$w0rd';
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root';