LAMP Stack for PI
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
Auto Index
<IfModule mod_autoindex.c>
# Directives controlling the display of server-generated directory listings.
#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
# Remove/replace the "Charset=UTF-8" if you don't use UTF-8 for your filenames.
IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* DescriptionWidth=* Charset=UTF-8 SuppressDescription SuppressRules FoldersFirst XHTML
IndexStyleSheet /icons/style.css
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip x-bzip2
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image.gif) image/*
AddIconByType (SND,/icons/sound.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIconByType (HTML,/icons/html.gif) text/html
AddIcon /icons/binary.gif .bin .exe .so .dll
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .7z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps .doc .psd .docx
AddIcon /icons/html.gif .html .shtml .htm .css .xml .xhtml .chm
AddIcon /icons/pdf.gif .pdf
AddIcon /icons/log.gif .log
AddIcon /icons/c.gif .c .cpp .c++ .h
AddIcon /icons/pl.gif .pl
AddIcon /icons/py.gif .py .pyc
AddIcon /icons/spy.gif .spy
AddIcon /icons/php.gif .php
AddIcon /icons/cgi.gif .cgi
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl .cmd .bat
AddIcon /icons/jar.gif .jar
AddIcon /icons/pom.gif .pom
AddIcon /icons/md5.gif .md5
AddIcon /icons/sha1.gif .sha1
AddIcon /icons/tex.gif .tex
# It's a suffix rule, so simply matching "core" matches "score" as well !
AddIcon /icons/bomb.gif /core
AddIcon (SND,/icons/sound.gif) .ogg
AddIcon (VID,/icons/movie.gif) .ogm
AddIcon /icons/back.gif ..
AddIcon /icons/hreadme.gif readme README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/folder.open.gif ^^BLANKICON^^
# Default icons for OpenDocument format
AddIcon /icons/odf6odt-20x22.png .odt
AddIcon /icons/odf6ods-20x22.png .ods
AddIcon /icons/odf6odp-20x22.png .odp
AddIcon /icons/odf6odg-20x22.png .odg
AddIcon /icons/odf6odc-20x22.png .odc
AddIcon /icons/odf6odf-20x22.png .odf
AddIcon /icons/odf6odb-20x22.png .odb
AddIcon /icons/odf6odi-20x22.png .odi
AddIcon /icons/odf6odm-20x22.png .odm
AddIcon /icons/odf6ott-20x22.png .ott
AddIcon /icons/odf6ots-20x22.png .ots
AddIcon /icons/odf6otp-20x22.png .otp
AddIcon /icons/odf6otg-20x22.png .otg
AddIcon /icons/odf6otc-20x22.png .otc
AddIcon /icons/odf6otf-20x22.png .otf
AddIcon /icons/odf6oti-20x22.png .oti
AddIcon /icons/odf6oth-20x22.png .oth
#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
DefaultIcon /icons/unknown.gif
#
# AddDescription allows you to place a short description after a file in
# server-generated indexes. These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
AddDescription "Readme File" readme
AddDescription "Core File" core
AddDescription "GZIP compressed document" .gz
AddDescription "GZIP compressed tar archive" .tgz
AddDescription "Tar archive" .tar
AddDescription "Zip Archive" .zip
AddDescription "<a href=\"http://www.apple.com/quicktime/\" title=\"Quicktime\">QuickTime</a> Movie" .mov
AddDescription "<a href=\"http://www.real.com/\" title=\"RealNetworks\">RealNetworks</a> Movie" .ra .ram
AddDescription "Plain-text Document" .txt
AddDescription "Web document" .HTML .xhtml
AddDescription "Compile HTML" .chm .CHM
AddDescription "Document" .ps .ai .eps .pdf .psd .doc .docx
AddDescription "Binary File" .bin .exe .so .dll .pyc .class
AddDescription "Log File" .log
AddDescription "MD5 Digest" .md5 .jar.md5 .pom.md5
AddDescription "SHA1 Digest" .sha1 .jar.sha1 pom.sha1
AddDescription "Java Archive" .jar
AddDescription "Maven pom" .pom
AddDescription "Script" .conf .sh .shar .csh .ksh .tcl .cmd .bat
AddDescription "PHP Script" .php
AddDescription "Perl Script" .pl
AddDescription "Pyhon Script" .py .spy
AddDescription "C Script" .cpp .c++
AddDescription "3D World" .wrl .wrl.gz .vrml .vrm .iv
AddDescription "Icon" .ico
AddDescription "<acronym title=\"Motion Picture Experts Group Audio Layer 3\">MP3</acronym> Audio File" .mp3
AddDescription "<acronym title=\"HyperText Markup Language\">HTML</acronym> Page" .html .htm .shtml
AddDescription "<acronym title=\"Portable Network Graphics\">PNG</acronym> Image" .png
AddDescription "<acronym title=\"Graphics Interchange Format\">GIF</acronym> Image" .gif
AddDescription "<acronym title=\"Joint Photographic Experts Group\">JPEG</acronym> Image" .jpg .jpeg
AddDescription "<acronym title=\"Bitmap\">BMP</acronym> Image" .bmp
AddDescription "<acronym title=\"Extensive Markup Language\">XML</acronym> File" .xml
AddDescription "<acronym title=\"Common Gateway Interface\">CGI</acronym> parsed script" .cgi
AddDescription "<acronym title=\"Cascading Style Sheet\">CSS</acronym> File" .css
#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes
ReadmeName /icons/README.html
HeaderName HEADER.html
#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing. Shell-style wildcarding is permitted.
IndexIgnore .??* *~ *# RCS CVS *,v *,t HEADER.html README.html favicon.ico README cgi-bin
</IfModule>