Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
content:apache_phpfpm [2020/09/26 11:07] – [Filling Content to your Server] Danielcontent:apache_phpfpm [2021/06/24 11:35] – [Howto setup a LAMP-Server in 2018-2020] Daniel
Zeile 1: Zeile 1:
-====== Kleiner Serverguide ======+====== Small Apache PHP- FPM- Serverguide ====== 
  
 ===== Howto setup a LAMP-Server in 2018-2020 ===== ===== Howto setup a LAMP-Server in 2018-2020 =====
  
 This documentation is about how to set up a LAMP- Server (Linux, Apache, MySql, PhP) in the current, most stable way. The Reason for me writing this is, that default Installations of common Distruibutions are often based on an old way in Server- Configuration, which is not the way it could be done today, leading to instability and complex configuration. This documentation is about how to set up a LAMP- Server (Linux, Apache, MySql, PhP) in the current, most stable way. The Reason for me writing this is, that default Installations of common Distruibutions are often based on an old way in Server- Configuration, which is not the way it could be done today, leading to instability and complex configuration.
 +
 +To get the Differences, this is how my Distro (OpenSuSE) delivers the Packages by default and which disadvanteages it has:
 +
 +  * Apache-Prefork. That way, Apache is one Application with many threads - which is slower, consumes more memory and doesn't scale good
 +  * PHP-Module integrated in the Apche- Server which is not released as stable and may crash the whole Apache- Server on Errors
 +      * Using Network Connection to connect to
 +  * MariaDB
 +
 +And here is what this guide will set up:
 +
 +  * Apache- Event. That way, Apache is one small Apache- Manager- Application which will spawn as many Apache- Servers as needed to handle the incoming connections dynamically. This is stable, as one Error may only crash the one Instance, which will be respawned by the Apache- Manager dynamically
 +      * Connection to php is done by Proxy- Handling in Apache
 +  * PHP-FPM will also Spawn PHP-Instances dynamically for each script beeing run
 +      * Using Socket Connections to connect to
 +  * MariaDB
 +
  
 ==== Choosing Installation-Media & Install Basic System ==== ==== Choosing Installation-Media & Install Basic System ====
  
-First, starting from Windows, you should make shure to have enough harddisk- space free. Then get installation-medium of the Linux your choice. I will stick to OpenSuSE as to get from [[https://software.opensuse.org/distributions|OpenSuSE]] (use Leap 15.currently as stable Distro. Tumbleweed may be instable). Follow the instructions to+First, starting from Windows, you should make sure to have enough harddisk- space free (i recommend at least 60 GB). Then get the installation-medium of the Linux your choice. I will stick to OpenSuSE as to get from [[https://software.opensuse.org/distributions|OpenSuSE]] (use Leap 15.currently as stable Distro. Tumbleweed may be instable). Follow the instructions to
  
-  - Download the DVD-Image+  - Download the DVD-Image from the Webpage as described there
   - Make the Installation- Media   - Make the Installation- Media
   - Install the System with standard Desktop- Packages (KDE)   - Install the System with standard Desktop- Packages (KDE)
   - Boot into new Linux and Set Up Desktop as you like   - Boot into new Linux and Set Up Desktop as you like
 +
  
 ==== Basic System- Scaling thoughts ==== ==== Basic System- Scaling thoughts ====
Zeile 40: Zeile 58:
 Use "systemctl vm.swappiness = 0" and set it in /etc/sysctl.conf by adding line "vm.swappiness=0". Use "systemctl vm.swappiness = 0" and set it in /etc/sysctl.conf by adding line "vm.swappiness=0".
  
-==== Install MySql ====+==== Install MAriaDB (MySql====
  
 In OpenSuSE MariaDB is available and working out of the Box (maybe change the Admin- Password at first Start). MySQL is tuneable in /etc/my.cnf: In OpenSuSE MariaDB is available and working out of the Box (maybe change the Admin- Password at first Start). MySQL is tuneable in /etc/my.cnf:
Zeile 56: Zeile 74:
 Memory-Usage will be: innodb_buffer_pool_size + ( join_buffer_size + sort_buffer_size + readn_rnd_buffer_size ) * max_connections. If your System has more memory, use some tuning script (like MySQLTuner-perl) to see what makes most sense to put the memory to. Memory-Usage will be: innodb_buffer_pool_size + ( join_buffer_size + sort_buffer_size + readn_rnd_buffer_size ) * max_connections. If your System has more memory, use some tuning script (like MySQLTuner-perl) to see what makes most sense to put the memory to.
  
-For a local setup, you should use Sockets and disable networking. To do this, set <font inherit/monospace;;inherit;;#000000background-color:#ffffff;>"socket = /run/mysql/mysql.sock"</font\\+For a local setup, you should use Sockets and disable networking. To do this, set 
 + 
 +<code> 
 +socket = /run/mysql/mysql.sock 
 + 
 +</code> 
 You should than deactivate TCP/IP with "skip-networking" and comment out the bind-address. You should than deactivate TCP/IP with "skip-networking" and comment out the bind-address.
  
Zeile 62: Zeile 86:
  
 After that had worked you should secure your Database by giving a password as it was explained by the step above when starting it. If not shure just run "<font inherit/monospace;;inherit;;#000000background-color:#ffffff;>/usr/bin/mysql_secure_installation</font>". After that had worked you should secure your Database by giving a password as it was explained by the step above when starting it. If not shure just run "<font inherit/monospace;;inherit;;#000000background-color:#ffffff;>/usr/bin/mysql_secure_installation</font>".
 +
  
 ==== Install Apache ==== ==== Install Apache ====
Zeile 150: Zeile 175:
  
 <code> <code>
-listen = /var/run/php-fpm.sock+listen = /run/php-fpm/php-fpm.sock
 listen.owner = wwwrun listen.owner = wwwrun
 listen.group = www listen.group = www
Zeile 163: Zeile 188:
  
 </code> </code>
 +
  
 ==== PHP Configuration ==== ==== PHP Configuration ====
  • content/apache_phpfpm.txt
  • Zuletzt geändert: 2023/10/01 10:24
  • von Daniel