Welcome! 登入 註冊
美寶首頁 美寶百科 美寶論壇 美寶落格 美寶地圖

Advanced

Install a LAPP Stack (Apache 2.4/PHP 7/PostgreSQL 10/MariaDB 10) on openSUSE Tumbleweed

Posted by HP 
Assume the Tumbleweed linux is ready.

I. Database
Install the database first (PostgreSQL 10):

1. Install database
zypper install postgresql10 postgresql10-contrib postgresql10-server

2. Enable auto-start on boot
chkconfig -a postgresql

3. Start PostgreSQL
systemctl start postgresql.service

4. Set password for postgres
Switch user to postgres:
su postgres
psql
In the psql console, set the password:
\password postgres

5. Fine-tune performance
(1) Edit postgresql.conf
vi /var/lib/pgsql/data/postgresql.conf
(2) Set parameters
shared_buffers = 4GB
work_mem = 32MB
effective_cache_size = 8GB

shared_buffers: 1/4 of total memory is a reasonable starting value
effective_cache_size: 1/2 of total memory would be a normal setting


II. Web Server
1. Install apache2
zypper install apache2 apache2-mod_evasive

2. Add commonly-used modules
Add modules:
a2enmod php7
a2enmod rewrite
a2enmod headers
List apache loaded modules:
apachectl -M

3. Enable auto-start on boot
chkconfig -a apache2

4. Edit default-server.conf (/etc/apache2)
(1) Edit DocumentRoot to your own default websidte directory (e.g. DocumentRoot "/home/yoursite").
(2) Edit the <Directory> right below DocumentRoot.
(3) Add/Append the following directives:
ServerName website.com
ExtendedStatus On
TraceEnable Off
AddType image/x-icon .ico

5. Modify server-tuning.conf (/etc/apache2)
(1) Raise StartServers if necessary
(2) Raise MaxSpareServers if necessary
(3) Raise ServerLimit if necessary
(4) Raise MaxClients if necessary

III. Hypertext Preprocessor
1. Install php7
zypper install php7 php7-pgsql

2. Install commonly-used modules
zypper install php7-curl php7-fileinfo php7-gd php7-mbstring php7-openssl php7-zip php7-zlib


MariaDB
1. Install mariadb
zypper install mariadb mariadb-tools

2. Security setting
mysql_secure_installation
(all "yes" is preferred)

3. Enable auto-start on boot
chkconfig -a mysql

References:
Install a LAPP server: openSUSE 42 / Apahce 2.4/PostgreSQL 9.4/ PHP 5.6
How to Install PostgreSQL and phpPgAdmin on OpenSUSE Leap 42.1
Apache MPM prefork
Apache MPM Common Directives



Edited 17 time(s). Last edit at 03/24/2019 07:41PM by HP.
(編輯記錄)