<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Baldlizard</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Baldlizard"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Baldlizard"/>
	<updated>2026-05-06T09:14:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18664</id>
		<title>Alpine production deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18664"/>
		<updated>2021-02-16T12:12:39Z</updated>

		<summary type="html">&lt;p&gt;Baldlizard: I think the &amp;quot;not&amp;quot; was missing because if not it would go against what the article is about. changed sentence for better readability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The production environment is the final destination of all development results. Almost always when someone does some kind of development, no matter how small it is (for example a simple script), the development environment is not the only place or system where it will be exclusively used (for example the script could be used on other computers in the network).&lt;br /&gt;
&lt;br /&gt;
The development environment is never the same as the production environment, commonly, production environment only has necessary software to run the installed and deployment products. In professional linux are no graphical toos and everything is minimalist.. just like Alpine linux.&lt;br /&gt;
&lt;br /&gt;
= Servers and Dockers =&lt;br /&gt;
&lt;br /&gt;
The most famous cases in old days was use a Centos environment, but over time, linux became more heavy and more slow. That changes with Alpine and Dockers, if you think Redhat and Centos are the best here an article that describes in short the real life of those systems: https://venenux.github.io/venenux/others-infodocs-details-centos-vs-fedora-en.html , Both projects are Red Hat related, one are ahead of and the other behind of, main difference from others distributions it’s their lack of packages and setups, due the shared market focused target of both.. obviously due the RedHAt relationship.&lt;br /&gt;
&lt;br /&gt;
But today all of this changed, now there&#039;s Docker: a helpful tool for packaging, shipping, and running applications within &amp;quot;containers&amp;quot; (like virtual machines) that remove the need for physical hardware, allowing for more efficient use of computing resources, in terms of energy consumption and cost effectiveness. Today even the big dogs like Google, VMware and Amazon are building services to support it.&lt;br /&gt;
&lt;br /&gt;
The server are mostly a very powerful machine in production environments, but think about it! a 500GB disk to only run a DNS for a local network? that&#039;s the reason of the Dockers and their relationship with the servers. &lt;br /&gt;
&lt;br /&gt;
The one big difference between containers and a Server is that containers *share* the host server system’s kernel and server resources with other containers in a isolated environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Server focused documents ==&lt;br /&gt;
&lt;br /&gt;
TODO: webpack, npm (advanced.. cos is includen below in lamp), bigdata, Dockers focused well made tutorial&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LAMP ===&lt;br /&gt;
&lt;br /&gt;
In production web, LAMP means &#039;&#039;&#039;L&#039;&#039;&#039;inux + &#039;&#039;&#039;A&#039;&#039;&#039;pache + &#039;&#039;&#039;M&#039;&#039;&#039;ysql + &#039;&#039;&#039;P&#039;&#039;&#039;hp installed and integrated, but today the &amp;quot;A&amp;quot; of apache is more used as Nginx or Lighttpd, and the &amp;quot;M&amp;quot; of MySQL is more used as Mariadb. The LAMP focused documents are:&lt;br /&gt;
&lt;br /&gt;
* LAMP deploy of the Web Server: [[Production Web server: Lighttpd]]&lt;br /&gt;
* LAMP deploy of the Web Server with PHP, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP + MySQL]]&lt;br /&gt;
* LAMP special cases for PHP5 only softwares, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP5 + MySQL]]&lt;br /&gt;
* Deploy usage of Lets Encrypt without chain-tools – just add water: [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LUA ===&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
== DataBases ==&lt;br /&gt;
&lt;br /&gt;
* SQlite, most easy to use database system without engine: [[Debelovers : sqlite]]&lt;br /&gt;
* UnixODBC, how to connect with multiple databases: [[Production DataBases : unixodbc]]&lt;br /&gt;
* MySQL/MariaDB deployment: [[Production DataBases : mysql]]&lt;br /&gt;
&lt;br /&gt;
== Networking ==&lt;br /&gt;
&lt;br /&gt;
* Dual stack (ipv4 to ipv6) DNS with chain slave, just only for brave linux sysadmin: : [[Production DNS: dual stack Bind server]]&lt;br /&gt;
* [[Cacti: traffic analysis and monitoring network]]&lt;br /&gt;
&lt;br /&gt;
== Docker focused documents ==&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie]]&lt;br /&gt;
* [[Alpine newbie install manual]]&lt;br /&gt;
* [[Alpine newbie desktops]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:PHP]]&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Production]]&lt;/div&gt;</summary>
		<author><name>Baldlizard</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18663</id>
		<title>Alpine production deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18663"/>
		<updated>2021-02-16T12:06:52Z</updated>

		<summary type="html">&lt;p&gt;Baldlizard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The production environment is the final destination of all development results. Almost always when someone does some kind of development, no matter how small it is (for example a simple script), the development environment is the place or final system where it will always be used (for example the script will be used on other computers in the family, but it was made on one personal computer).&lt;br /&gt;
&lt;br /&gt;
The development environment is never the same as the production environment, commonly, production environment only has necessary software to run the installed and deployment products. In professional linux are no graphical toos and everything is minimalist.. just like Alpine linux.&lt;br /&gt;
&lt;br /&gt;
= Servers and Dockers =&lt;br /&gt;
&lt;br /&gt;
The most famous cases in old days was use a Centos environment, but over time, linux became more heavy and more slow. That changes with Alpine and Dockers, if you think Redhat and Centos are the best here an article that describes in short the real life of those systems: https://venenux.github.io/venenux/others-infodocs-details-centos-vs-fedora-en.html , Both projects are Red Hat related, one are ahead of and the other behind of, main difference from others distributions it’s their lack of packages and setups, due the shared market focused target of both.. obviously due the RedHAt relationship.&lt;br /&gt;
&lt;br /&gt;
But today all of this changed, now there&#039;s Docker: a helpful tool for packaging, shipping, and running applications within &amp;quot;containers&amp;quot; (like virtual machines) that remove the need for physical hardware, allowing for more efficient use of computing resources, in terms of energy consumption and cost effectiveness. Today even the big dogs like Google, VMware and Amazon are building services to support it.&lt;br /&gt;
&lt;br /&gt;
The server are mostly a very powerful machine in production environments, but think about it! a 500GB disk to only run a DNS for a local network? that&#039;s the reason of the Dockers and their relationship with the servers. &lt;br /&gt;
&lt;br /&gt;
The one big difference between containers and a Server is that containers *share* the host server system’s kernel and server resources with other containers in a isolated environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Server focused documents ==&lt;br /&gt;
&lt;br /&gt;
TODO: webpack, npm (advanced.. cos is includen below in lamp), bigdata, Dockers focused well made tutorial&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LAMP ===&lt;br /&gt;
&lt;br /&gt;
In production web, LAMP means &#039;&#039;&#039;L&#039;&#039;&#039;inux + &#039;&#039;&#039;A&#039;&#039;&#039;pache + &#039;&#039;&#039;M&#039;&#039;&#039;ysql + &#039;&#039;&#039;P&#039;&#039;&#039;hp installed and integrated, but today the &amp;quot;A&amp;quot; of apache is more used as Nginx or Lighttpd, and the &amp;quot;M&amp;quot; of MySQL is more used as Mariadb. The LAMP focused documents are:&lt;br /&gt;
&lt;br /&gt;
* LAMP deploy of the Web Server: [[Production Web server: Lighttpd]]&lt;br /&gt;
* LAMP deploy of the Web Server with PHP, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP + MySQL]]&lt;br /&gt;
* LAMP special cases for PHP5 only softwares, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP5 + MySQL]]&lt;br /&gt;
* Deploy usage of Lets Encrypt without chain-tools – just add water: [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LUA ===&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
== DataBases ==&lt;br /&gt;
&lt;br /&gt;
* SQlite, most easy to use database system without engine: [[Debelovers : sqlite]]&lt;br /&gt;
* UnixODBC, how to connect with multiple databases: [[Production DataBases : unixodbc]]&lt;br /&gt;
* MySQL/MariaDB deployment: [[Production DataBases : mysql]]&lt;br /&gt;
&lt;br /&gt;
== Networking ==&lt;br /&gt;
&lt;br /&gt;
* Dual stack (ipv4 to ipv6) DNS with chain slave, just only for brave linux sysadmin: : [[Production DNS: dual stack Bind server]]&lt;br /&gt;
* [[Cacti: traffic analysis and monitoring network]]&lt;br /&gt;
&lt;br /&gt;
== Docker focused documents ==&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie]]&lt;br /&gt;
* [[Alpine newbie install manual]]&lt;br /&gt;
* [[Alpine newbie desktops]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:PHP]]&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Production]]&lt;/div&gt;</summary>
		<author><name>Baldlizard</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18662</id>
		<title>Alpine production deployment</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_production_deployment&amp;diff=18662"/>
		<updated>2021-02-16T11:29:04Z</updated>

		<summary type="html">&lt;p&gt;Baldlizard: /* Servers and Dockers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The production environment is the final destination of all development results, almost always when someone does some kind of development no matter how small it is (for example a simple script) the development environment is the place or final system where it will always be used (for example the script will be used in the other computers of the family, but it was made in the personal computer).&lt;br /&gt;
&lt;br /&gt;
The development environment is never the same as the production environment, commonly, production environment only has just necesary software to run the installed and deployment products. In professional linux, there&#039;s no graphical toos and everything are made minimalist.. just like Alpine linux does all.&lt;br /&gt;
&lt;br /&gt;
= Servers and Dockers =&lt;br /&gt;
&lt;br /&gt;
The most famous cases in old days was use a Centos environment, but with time, linux becomes more heavy and more slowly, that changes with Alpine and Dockers, if you think Redhat and Centos are the best here an article that describes in short the real life of those systems: https://venenux.github.io/venenux/others-infodocs-details-centos-vs-fedora-en.html , Both projects are Red Hat related, one are ahead of and the other behind of, main difference from others distributions it’s their lack of packages and setups, due the shared market focused target of both.. obviously due the RedHAt relationship.&lt;br /&gt;
&lt;br /&gt;
But today all of this are changed, now there&#039;s Docker: a helpful tool for packing, shipping, and running applications within &amp;quot;containers&amp;quot; (like virtual machines) that remove the need for physical hardware, allowing for more efficient use of computing resources, in terms of energy consumption and cost effectiveness. Today even the big dogs like Google, VMware and Amazon are building services to support it.&lt;br /&gt;
&lt;br /&gt;
The server are mostly a very powerful machine in production environments, but think about it! a 500GB disk to only run a DNS for a local network? that&#039;s the reason of the Dockers and their relationship with the servers. &lt;br /&gt;
&lt;br /&gt;
The one big difference between containers and a hole Server is that containers *share* the host server system’s kernel with other containers, and of course same server resources in a isolated environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Server focused documents ==&lt;br /&gt;
&lt;br /&gt;
TODO: webpack, npm (advanced.. cos is includen below in lamp), bigdata, Dockers focused well made tutorial&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LAMP ===&lt;br /&gt;
&lt;br /&gt;
In production web, LAMP means &#039;&#039;&#039;L&#039;&#039;&#039;inux + &#039;&#039;&#039;A&#039;&#039;&#039;pache + &#039;&#039;&#039;M&#039;&#039;&#039;ysql + &#039;&#039;&#039;P&#039;&#039;&#039;hp installed and integrated, but today the &amp;quot;A&amp;quot; of apache are more used as Nginx or Lighttpd, and the &amp;quot;M&amp;quot; of MySQL are more used as Mariadb, the LAMP focused documents are:&lt;br /&gt;
&lt;br /&gt;
* LAMP deploy of the Web Server: [[Production Web server: Lighttpd]]&lt;br /&gt;
* LAMP deploy of the Web Server with PHP, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP + MySQL]]&lt;br /&gt;
* LAMP special cases for PHP5 only softwares, user html_dir and MariaDB: [[Production LAMP system: Lighttpd + PHP5 + MySQL]]&lt;br /&gt;
* Deploy usage of Lets Encrypt without chain-tools – just add water: [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
&lt;br /&gt;
=== Web deploy: LUA ===&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
== DataBases ==&lt;br /&gt;
&lt;br /&gt;
* SQlite, most easy to use database system without engine: [[Debelovers : sqlite]]&lt;br /&gt;
* UnixODBC, how to connect with multiple databases: [[Production DataBases : unixodbc]]&lt;br /&gt;
* MySQL/MariaDB deployment: [[Production DataBases : mysql]]&lt;br /&gt;
&lt;br /&gt;
== Networking ==&lt;br /&gt;
&lt;br /&gt;
* Dual stack (ipv4 to ipv6) DNS with chain slave, just only for brave linux sysadmin: : [[Production DNS: dual stack Bind server]]&lt;br /&gt;
* [[Cacti: traffic analysis and monitoring network]]&lt;br /&gt;
&lt;br /&gt;
== Docker focused documents ==&lt;br /&gt;
&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie]]&lt;br /&gt;
* [[Alpine newbie install manual]]&lt;br /&gt;
* [[Alpine newbie desktops]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:PHP]]&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Production]]&lt;/div&gt;</summary>
		<author><name>Baldlizard</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Production_LAMP_system:_Lighttpd_%2B_PHP_%2B_MySQL&amp;diff=18661</id>
		<title>Production LAMP system: Lighttpd + PHP + MySQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Production_LAMP_system:_Lighttpd_%2B_PHP_%2B_MySQL&amp;diff=18661"/>
		<updated>2021-02-16T11:26:19Z</updated>

		<summary type="html">&lt;p&gt;Baldlizard: /* 1. The web server part: Lighttpd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In production web, &#039;&#039;&#039;LAMP&#039;&#039;&#039; means &#039;&#039;&#039;L&#039;&#039;&#039;inux + &#039;&#039;&#039;A&#039;&#039;&#039;pache + &#039;&#039;&#039;M&#039;&#039;&#039;ysql + &#039;&#039;&#039;P&#039;&#039;&#039;hp installed and integrated, but today the &amp;quot;A&amp;quot; of &#039;&#039;apache&#039;&#039; are more used as &#039;&#039;Nginx&#039;&#039; or &#039;&#039;Lighttpd&#039;&#039;, and the &amp;quot;M&amp;quot; of &#039;&#039;MySQL&#039;&#039; are more used as &#039;&#039;Mariadb&#039;&#039;, the &#039;&#039;LAMP&#039;&#039; focused documents are:&lt;br /&gt;
&lt;br /&gt;
== 1. The web server part: Lighttpd ==&lt;br /&gt;
&lt;br /&gt;
[http://www.lighttpd.net/ lighttpd] is a simple, standards-compliant, secure, and flexible web server, Nginx is the most used due to beeing manageable by ISP panel&#039;s software, but &#039;&#039;&#039;lighttpd performs always better. Nginx could not process fast-cgi programs&#039;&#039;&#039;. for more complete lighttpd information consult the [[Production Web server: Lighttpd]] wiki page.&lt;br /&gt;
&lt;br /&gt;
=== Lighttpd Installation ===&lt;br /&gt;
&lt;br /&gt;
Production environment only will handle need packages.. so no doc or manages allowed:&lt;br /&gt;
&lt;br /&gt;
# run apk for need packages&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lighttpd gamin&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lighttpd pre php configuration ===&lt;br /&gt;
&lt;br /&gt;
# make the htdos public web root directories &lt;br /&gt;
# change default port to production one, http are used with 80&lt;br /&gt;
# use FAM style (gamin) file alteration monitor, increases performance &#039;&#039;&#039;ONLY ON 3.4 to 3.8 releases!!!&#039;&#039;&#039;&lt;br /&gt;
# use linux event handler, increases performance due Alpine are linux only&lt;br /&gt;
# added the service to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
# started the web server service&lt;br /&gt;
# Enable the mod_status at the config files&lt;br /&gt;
# change path in the config file, we are using security by obfuscation&lt;br /&gt;
# restart the service to see changes at the browser&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir -p /var/www/localhost/htdocs/stats /var/log/lighttpd /var/lib/lighttpd&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*server.port.*=.*#server.port          = 80#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*server.event-handler = &amp;quot;linux-sysepoll&amp;quot;.*#server.event-handler = &amp;quot;linux-sysepoll&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
chown -R lighttpd:lighttpd /var/www/localhost/&lt;br /&gt;
&lt;br /&gt;
chown -R lighttpd:lighttpd /var/lib/lighttpd&lt;br /&gt;
&lt;br /&gt;
chown -R lighttpd:lighttpd /var/log/lighttpd&lt;br /&gt;
&lt;br /&gt;
rc-update add lighttpd default&lt;br /&gt;
&lt;br /&gt;
rc-service lighttpd restart&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;it works&amp;quot; &amp;gt; /var/www/localhost/htdocs/index.html&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*mod_status.*,.*#    &amp;quot;mod_status&amp;quot;,#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*status.status-url.*=.*#status.status-url  = &amp;quot;/stats/server-status&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*status.config-url.*=.*#status.config-url  = &amp;quot;/stats/server-config&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
rc-service lighttpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For testing open a browser and go to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and you will see &amp;quot;it works&amp;quot;&#039;&#039;&#039;. The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There&#039;s a problem in Alpine linux, FAM (gamin) are activated as a lighttpd only service&#039;&#039;&#039;, that&#039;s make sense in dockers but in servers could be a problem if FAM (gamin) are also need for others services at the same time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OPTIONAL:&#039;&#039;&#039; alpine packagers are a mess, removed fam on recents, soolder releases of alpine can use compiled fam packages with &amp;lt;code&amp;gt;sed -i -r &#039;s#.*server.stat-cache-engine.*=.*# server.stat-cache-engine = &amp;quot;fam&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 2. The php scripting part: PHP fpm ==&lt;br /&gt;
&lt;br /&gt;
In Alpine there&#039;s two main language for programming dynamic web pages: PHP and LUA. Alpine are minimalist so not all PHP packages are need in most cases, both repositories must be enabled (main and community), here are explained the most common used in production, for PHP at development please watch the [[Alpine_newbie_developer]] wiki page.&lt;br /&gt;
&lt;br /&gt;
=== PHP Installation ===&lt;br /&gt;
&lt;br /&gt;
Since version v3.5, PHP 7 is available along with PHP 5.6 coexisting together, until version v3.9 where the latter was removed. So for Alpine 3.5+m we will assume PHP7, if you need PHP5.6 still could use it, that wil be cover in the special [[Production LAMP system: Lighttpd + PHP5 + MySQL]] wiki page for older Alpine systems and some specific php softwares.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add php7 php7-bcmath php7-bz2 php7-ctype php7-curl php7-dom php7-enchant php7-exif php7-fpm php7-gd php7-gettext php7-gmp php7-iconv php7-imap php7-intl php7-json php7-mbstring php7-opcache php7-openssl php7-phar php7-posix php7-pspell php7-recode php7-session php7-simplexml php7-sockets php7-sysvmsg php7-sysvsem php7-sysvshm php7-tidy php7-xml php7-xmlreader php7-xmlrpc php7-xmlwriter php7-xsl php7-zip php7-sqlite3&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;The below packages are only for specific situations.. only install when need (specially php-pear one)&#039;&#039;&#039;, by example, &amp;lt;code&amp;gt;cacti&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cacti-php7&amp;lt;/code&amp;gt; are in edge that depends on &amp;lt;code&amp;gt;php7&amp;lt;/code&amp;gt;, but you must only install from edge only the cacti package, all the depends must be previously installed from stable.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add php7-pgsql php7-mysqli php7-mysqlnd php7-snmp php7-soap php7-ldap php7-pcntl php7-pear php7-shmop php7-wddx php7-cgi php7-pdo php7-snmp php7-tokenizer &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;The below packages are only for databases access using php in specific ways.. only install when need (specially php--pdo ones)&#039;&#039;&#039;, by example, &amp;lt;code&amp;gt;cacti&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cacti-php7&amp;lt;/code&amp;gt; are in edge that depends on &amp;lt;code&amp;gt;php7-mysqli&amp;lt;/code&amp;gt;, but you must only install from edge only the cacti package, all the depends like &amp;lt;code&amp;gt;php7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;php7-mysqli&amp;lt;/code&amp;gt; must be previously installed from stable.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add php7-dba php7-sqlite3 php7-mysqli php7-mysqlnd php7-pgsql php7-pdo_dblib php7-pdo_odbc php7-pdo_pgsql php7-pdo_sqlite &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A special case it&#039;s the &amp;lt;code&amp;gt;php7-odbc&amp;lt;/code&amp;gt;, unless the others, that are able php to connect to only specific database, &#039;&#039;&#039;[[Production DataBases : unixodbc|unixodbc]]&#039;&#039;&#039; are a universal way to do so, the most important difference are that by example, &amp;lt;code&amp;gt;php7-mysqli&amp;lt;/code&amp;gt; package has better functions to manage data into the php software usage.&lt;br /&gt;
&lt;br /&gt;
=== PHP Global Configuration ===&lt;br /&gt;
&lt;br /&gt;
# Use fix.pathinfo&lt;br /&gt;
# Set safe mode off&lt;br /&gt;
# Dont expose php code if something fails&lt;br /&gt;
# Set amount of memory limit for execution to 536Mb (most servers are minimal of 1Gb of RAM)&lt;br /&gt;
# So then set upload size to 128Mb as maximun.&lt;br /&gt;
# Set then POST max size to 256Mb based on the upload max size limit.&lt;br /&gt;
# Turn on the url open method&lt;br /&gt;
# Set default charset to UTF-8 more compatible&lt;br /&gt;
# Increase the execution time and the input time for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
sed -i -r &#039;s|.*cgi.fix_pathinfo=.*|cgi.fix_pathinfo=1|g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#.*safe_mode =.*#safe_mode = Off#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#.*expose_php =.*#expose_php = Off#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#memory_limit =.*#memory_limit = 536M#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#upload_max_filesize =.*#upload_max_filesize = 128M#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#post_max_size =.*#post_max_size = 256M#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^file_uploads =.*#file_uploads = On#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^max_file_uploads =.*#max_file_uploads = 12#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^allow_url_fopen = .*#allow_url_fopen = On#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^.default_charset =.*#default_charset = &amp;quot;UTF-8&amp;quot;#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^.max_execution_time =.*#max_execution_time = 150#g&#039; /etc/php*/php.ini&lt;br /&gt;
sed -i -r &#039;s#^max_input_time =.*#max_input_time = 90#g&#039; /etc/php*/php.ini&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP-FPM Configuration ===&lt;br /&gt;
&lt;br /&gt;
# Create directory for php socket and pid files, MUST BE EQUAL to openrc defined!&lt;br /&gt;
# Set into configuration file the socket path, MUST BE EQUAL to openrc defined!&lt;br /&gt;
# Set into configuration file the pid file path, MUST BE EQUAL to openrc defined!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir -p /var/run/php-fpm7/&lt;br /&gt;
&lt;br /&gt;
chown lighttpd:root /var/run/php-fpm7&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen =.*|listen = /run/php-fpm7/php7-fpm.sock|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^pid =.*|pid = /run/php-fpm7/php7-fpm.pid|g&#039; /etc/php*/php-fpm.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.mode =.*|listen.mode = 0640|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
rc-update add php-fpm7 default&lt;br /&gt;
&lt;br /&gt;
service php-fpm7 restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The PHP-FPM defined a master process with some pool of process for each service resuests, by default there&#039;s only one pool of processes, the www pool process.&lt;br /&gt;
&lt;br /&gt;
Default values are good for starting, but later will need tuning, the best it&#039;s static one but need test and set until get right configuration.&lt;br /&gt;
&lt;br /&gt;
=== Lighttpd + PHP-FPM ===&lt;br /&gt;
&lt;br /&gt;
The web server comes to and very unmantained config file so we must handle all the required settings:&lt;br /&gt;
&lt;br /&gt;
# enable the mod_alias at the config file, due need of a specific path for cgi files into security&lt;br /&gt;
# be sure and disable the fastcgi-php module by cgi only&lt;br /&gt;
# and then enable the fastcgi-php-fpm specific module then&lt;br /&gt;
# write a much much better approach of the php handler in the local server using the socket&lt;br /&gt;
# configure the php to use also the socket too for direct connection locally&lt;br /&gt;
# restart the service to see changes at the browser&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir -p /var/www/localhost/cgi-bin&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*mod_alias.*,.*#    &amp;quot;mod_alias&amp;quot;,#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_cgi.conf&amp;quot;.*#   include &amp;quot;mod_cgi.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_fastcgi.conf&amp;quot;.*#\#   include &amp;quot;mod_fastcgi.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;.*#   include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/lighttpd/mod_fastcgi_fpm.conf &amp;lt;&amp;lt; EOF&lt;br /&gt;
server.modules += ( &amp;quot;mod_fastcgi&amp;quot; )&lt;br /&gt;
index-file.names += ( &amp;quot;index.php&amp;quot; )&lt;br /&gt;
fastcgi.server = (&lt;br /&gt;
    &amp;quot;.php&amp;quot; =&amp;gt; (&lt;br /&gt;
      &amp;quot;localhost&amp;quot; =&amp;gt; (&lt;br /&gt;
        &amp;quot;socket&amp;quot;                =&amp;gt; &amp;quot;/var/run/php-fpm7/php7-fpm.sock&amp;quot;,&lt;br /&gt;
        &amp;quot;broken-scriptfilename&amp;quot; =&amp;gt; &amp;quot;enable&amp;quot;&lt;br /&gt;
      ))&lt;br /&gt;
)&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen =.*|listen = /var/run/php-fpm7/php7-fpm.sock|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.owner = .*|listen.owner = lighttpd|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.group = .*|listen.group = lighttpd|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.mode = .*|listen.mode = 0660|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
rc-service php-fpm7 restart&lt;br /&gt;
&lt;br /&gt;
rc-service lighttpd restart&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;&amp;lt;?php echo phpinfo(); ?&amp;gt;&amp;quot; &amp;gt; /var/www/localhost/htdocs/info.php&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For testing open a browser and go to &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://&amp;lt;webserveripaddres&amp;gt;/info.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and you will see only the minimal info due in production there&#039;s no need for too much information to crackers. The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
After that, all the files with php will be proceses faster than used a host based, also under the &amp;lt;code&amp;gt;/var/www/localhost/cgi-bin&amp;lt;/code&amp;gt; directory will be showed as &amp;lt;nowiki&amp;gt;http://localhost/cgi-bin/&amp;lt;/nowiki&amp;gt; path.&lt;br /&gt;
&lt;br /&gt;
=== Multiple PHP-FPM cluster ===&lt;br /&gt;
&lt;br /&gt;
As we said, in FPM it is managed by process pools, but the connection can be over the network or over a direct n socket, the configuration for a powerful server of average requests is with socket and localhost, but for high availability it is required CAT6 wired network connections of 1000Mbps and php-fpm by network connections in roundrobin mode.&lt;br /&gt;
&lt;br /&gt;
For php fpm pool will be on a specific machine and the web server(s) will simply connect to these machines with php to serve the php pages, the result is that we have a cluster of lighttpd web servers against other php-fpm process clusters, the php project can be the same code on all web servers and connected to a single database.&lt;br /&gt;
&lt;br /&gt;
At the Linux console the change are, by example two machines 10.10.1.10 and 10.10.2.10 both have php and lighttpd, so then in each one will setup the php of the other:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir -p /var/www/localhost/cgi-bin&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*mod_alias.*,.*#    &amp;quot;mod_alias&amp;quot;,#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_cgi.conf&amp;quot;.*#   include &amp;quot;mod_cgi.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_fastcgi.conf&amp;quot;.*#\#   include &amp;quot;mod_fastcgi.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;.*#   include &amp;quot;mod_fastcgi_fpm.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/lighttpd/mod_fastcgi_fpm.conf &amp;lt;&amp;lt; EOF&lt;br /&gt;
server.modules += ( &amp;quot;mod_fastcgi&amp;quot; )&lt;br /&gt;
index-file.names += ( &amp;quot;index.php&amp;quot; )&lt;br /&gt;
fastcgi.server = ( &amp;quot;.php&amp;quot; =&amp;gt; &lt;br /&gt;
  (&lt;br /&gt;
    ( &amp;quot;host&amp;quot; =&amp;gt; &amp;quot;10.10.1.10&amp;quot;,&lt;br /&gt;
      &amp;quot;port&amp;quot; =&amp;gt; 9000&lt;br /&gt;
    ),&lt;br /&gt;
    ( &amp;quot;host&amp;quot; =&amp;gt; &amp;quot;10.10.2.10&amp;quot;,&lt;br /&gt;
      &amp;quot;port&amp;quot; =&amp;gt; 9000 )&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen =.*|listen = 9000|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.owner = .*|listen.owner = lighttpd|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.group = .*|listen.group = lighttpd|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s|^.*listen.mode = .*|listen.mode = 0660|g&#039; /etc/php*/php-fpm.d/www.conf&lt;br /&gt;
&lt;br /&gt;
rc-service php-fpm7 restart&lt;br /&gt;
&lt;br /&gt;
rc-service lighttpd restart&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;&amp;lt;?php echo phpinfo(); ?&amp;gt;&amp;quot; &amp;gt; /var/www/localhost/htdocs/info.php&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. The DBMS part: mysql/mariadb ==&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has dummy counterparts packages for those that are not close to that change from &#039;&#039;mysql&#039;&#039; to &#039;&#039;mariadb&#039;&#039; naming packages.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Take in consideration that the user &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt; was created during instalation of packages, in the initialization section two users will be created in database init: &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt;, and in that point only if are in their respective system accounts, will be able to connect to the database service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add mysql mysql-client&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialization ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;datadir&#039;&#039; are located to &amp;lt;code&amp;gt;/var/lib/mysql&amp;lt;/code&amp;gt; must be owned by the mysql user and group. You can modify this behavior but must edit the service file at &amp;lt;code&amp;gt;/etc/init.d&amp;lt;/code&amp;gt; directory. Also, you need to set &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;datadir=&amp;lt;YOUR_DATADIR&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; under section &amp;lt;code&amp;gt;[mysqld]&amp;lt;/code&amp;gt; at the config file.&lt;br /&gt;
&lt;br /&gt;
# Initialize the main mysql database, and the data dir as standardized to &amp;lt;code&amp;gt;/var/lib/mysql&amp;lt;/code&amp;gt; by the rc script&lt;br /&gt;
# Then initialize the service, root account and socket connection are enabled without password at this point&lt;br /&gt;
# Setup the root account by asignes a proper password, this are purely paranoid. due next step already do that!&lt;br /&gt;
# Setup and init the installation by running the &amp;lt;code&amp;gt;mysql_secure_installation&amp;lt;/code&amp;gt;&lt;br /&gt;
# Setup permissions for manage others users and databases&lt;br /&gt;
# Run the &amp;lt;code&amp;gt;mysql_secure_installation&amp;lt;/code&amp;gt; script and answer the questions (see section below)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mysql_install_db --user=mysql --datadir=/var/lib/mysql&lt;br /&gt;
&lt;br /&gt;
rc-service mariadb start&lt;br /&gt;
&lt;br /&gt;
mysqladmin -u root password toor&lt;br /&gt;
&lt;br /&gt;
mysql_secure_installation&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Enter current password for root (enter for none):&#039;&#039;&#039; must be provided due we already set previously. correct respond are &amp;lt;code&amp;gt;OK, successfully used password, moving on...&amp;lt;/code&amp;gt;&lt;br /&gt;
#  &#039;&#039;&#039;Switch to unix_socket authentication [Y/n]&#039;&#039;&#039; this are not the case and must be disabled, &#039;&#039;&#039;so answer NO&#039;&#039;&#039;, and response will be &amp;lt;code&amp;gt;... skipping.&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Change the root password? [Y/n]&#039;&#039;&#039; Just press &amp;quot;n&amp;quot; only if you provided a good password, otherwise just change it!&lt;br /&gt;
# &#039;&#039;&#039;Remove anonymous users? [Y/n]&#039;&#039;&#039; In any case, &#039;&#039;&#039;production system must remove it, so answer Y&#039;&#039;&#039; and proper respond mus be  &amp;lt;code&amp;gt;... Success!&amp;lt;/code&amp;gt;.&lt;br /&gt;
# &#039;&#039;&#039;Disallow root login remotely? [Y/n]&#039;&#039;&#039; For sure answer Y&#039;&#039;&#039; and proper respond mus be  &amp;lt;code&amp;gt;... Success!&amp;lt;/code&amp;gt;.&lt;br /&gt;
# &#039;&#039;&#039;Remove test database and access to it? [Y/n]&#039;&#039;&#039; Should be removed, so answer Y&#039;&#039;&#039; and proper respond mus be  &amp;lt;code&amp;gt;... Success!&amp;lt;/code&amp;gt;.&lt;br /&gt;
# &#039;&#039;&#039;Reload privilege tables now? [Y/n]&#039;&#039;&#039; Aanswer Y&#039;&#039;&#039; and proper respond mus be  &amp;lt;code&amp;gt;... Success!&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After reponse all the questions.. restart the service with &amp;lt;code&amp;gt;rc-service mariadb restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
Newer system Alpine packages can set in independent files in any case those commands always works and where are not apply just will ignore the output, for more info about that watch the [[MariaDB#Configuration_files_and_customization|MariaDB Configuration files]] section of the MariaDB wiki page.&lt;br /&gt;
&lt;br /&gt;
* On older Alpine system must set config files for MAX ALLOWED PACKETS to minimun proper amount:&lt;br /&gt;
* Only allow local connections on cases where there&#039;s only one server or no expected to connect from others:&lt;br /&gt;
* Set default charset to UTF8MB4&lt;br /&gt;
* Added the service to start process but not at boot process due needs networking started.&lt;br /&gt;
* Restart the service to apply changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
sed -i &amp;quot;s|.*max_allowed_packet\s*=.*|max_allowed_packet = 100M|g&amp;quot; /etc/mysql/my.cnf&lt;br /&gt;
sed -i &amp;quot;s|.*max_allowed_packet\s*=.*|max_allowed_packet = 100M|g&amp;quot; /etc/my.cnf.d/mariadb-server.cnf&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s|.*bind-address\s*=.*|bind-address=127.0.0.1|g&amp;quot; /etc/mysql/my.cnf&lt;br /&gt;
sed -i &amp;quot;s|.*bind-address\s*=.*|bind-address=127.0.0.1|g&amp;quot; /etc/my.cnf.d/mariadb-server.cnf&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/my.cnf.d/mariadb-server-default-charset.cnf &amp;lt;&amp;lt; EOF&lt;br /&gt;
[client]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysqld]&lt;br /&gt;
collation_server = utf8mb4_unicode_ci&lt;br /&gt;
character_set_server = utf8mb4&lt;br /&gt;
&lt;br /&gt;
[mysql]&lt;br /&gt;
default-character-set = utf8mb4&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
rc-service mariadb restart&lt;br /&gt;
&lt;br /&gt;
rc-update add mariadb default&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On upgrade cases:&#039;&#039;&#039; If are unable to run any mysql command after an upgrade, it&#039;s because MySQL cannot start try run MySQL in safemode with &amp;lt;code&amp;gt;mysqld_safe --datadir=/var/lib/mysql/&amp;lt;/code&amp;gt; command and then run the &amp;lt;code&amp;gt;mysql_upgrade -u root -p&amp;lt;/code&amp;gt; script. For more information watch the [[MariaDB#Updating_or_comming_from_upgrading|MariaDB upgrading section]] of the MariaDB wiki page.&lt;br /&gt;
&lt;br /&gt;
=== adminer: Web Frontend administration ===&lt;br /&gt;
&lt;br /&gt;
[https://www.adminer.org/ Adminer] are a simple and single tool, tons of times faster thant PhpMysqladmin that are great but have too much security issues and lot of complext settings, we must use a more single and simpel solution easy to manage and upgrade.&lt;br /&gt;
&lt;br /&gt;
Take in consideration that this needs as requisite the previous sections of web server, php scripting and mysql/mariadb engine configured and running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mkdir -p /var/www/webapps/adminer&lt;br /&gt;
&lt;br /&gt;
wget https://github.com/vrana/adminer/releases/download/v4.7.6/adminer-4.7.6.php -O /var/www/webapps/adminer/adminer-4.7.6.php&lt;br /&gt;
&lt;br /&gt;
ln -s adminer-4.7.6.php /var/www/webapps/adminer/index.php&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/lighttpd/mod_adminer.conf &amp;lt;&amp;lt; EOF&lt;br /&gt;
# NOTE: this requires mod_alias&lt;br /&gt;
alias.url += (&lt;br /&gt;
     &amp;quot;/adminer/&amp;quot;	    =&amp;gt;	    &amp;quot;/var/www/webapps/adminer/&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
$HTTP[&amp;quot;url&amp;quot;] =~ &amp;quot;^/adminer/&amp;quot; {&lt;br /&gt;
    # disable directory listings&lt;br /&gt;
    dir-listing.activate = &amp;quot;disable&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#\#.*mod_alias.*,.*#    &amp;quot;mod_alias&amp;quot;,#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
sed -i -r &#039;s#.*include &amp;quot;mod_cgi.conf&amp;quot;.*#   include &amp;quot;mod_cgi.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
checkssl=&amp;quot;&amp;quot;;checkssl=$(grep &#039;include &amp;quot;mod_adminer.conf&#039; /etc/lighttpd/lighttpd.conf);[[ &amp;quot;$checkssl&amp;quot; != &amp;quot;&amp;quot; ]] &amp;amp;&amp;amp; echo listo || sed -i -r &#039;s#.*include &amp;quot;mod_cgi.conf&amp;quot;.*#include &amp;quot;mod_cgi.conf&amp;quot;\ninclude &amp;quot;mod_adminer.conf&amp;quot;#g&#039; /etc/lighttpd/lighttpd.conf&lt;br /&gt;
&lt;br /&gt;
rc-service lighttpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The administrator must visit with exact url &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://&amp;lt;ipaddress&amp;gt;/adminer/index.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; because two main reasons: there&#039;s no directory listing and there&#039;s no direct php index reference in web server, all of this due paranoiac settings.&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Production LAMP system: Lighttpd + PHP5 + MySQL]]&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Monitoring]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Production]]&lt;/div&gt;</summary>
		<author><name>Baldlizard</name></author>
	</entry>
</feed>