Hosts specific configs

This commit is contained in:
2025-04-24 15:55:10 +02:00
parent 116480f93e
commit 2abf8e30cf
13 changed files with 1903 additions and 0 deletions

108
On host/Joomla.md Normal file
View File

@@ -0,0 +1,108 @@
# Joomla
Apache : patrick:87
```bash
sudo apt install php php-common php-cli php-fpm php-opcache php-gd php-mysql php-curl php-intl php-xsl php-mbstring php-zip php-bcmath php-soap -y
sudo mkdir -p /var/www/joomla && cd /var/www/joomla
```
```bash
wget https://downloads.joomla.org/cms/joomla5/5-1-1/Joomla_5-1-1-Stable-Full_Package.zip?format=zip
unzip ...
```
```bash
mysql -u root -p (transatlantique)
```
```sql
CREATE DATABASE joomladb COLLATE utf8mb4_general_ci;
CREATE USER "joomlauser"@"localhost" IDENTIFIED BY "UQoiQRjB8AjmUv";
GRANT ALL PRIVILEGES ON joomladb.* TO "joomlauser"@"localhost";
FLUSH PRIVILEGES;
EXIT;
```
<table id="bkmrk-database-user-passwo"><tbody><tr><th colspan="1" rowspan="1">database</th><th colspan="1" rowspan="1">user</th><th colspan="1" rowspan="1">password</th><th colspan="1" rowspan="1">host</th><th colspan="1" rowspan="1">prefix</th></tr><tr><td colspan="1" rowspan="1">joomladb</td><td colspan="1" rowspan="1">joomlauser</td><td colspan="1" rowspan="1">UQoiQRjB8AjmUv</td><td colspan="1" rowspan="1">localhost</td><td colspan="1" rowspan="1">pli1n\_</td></tr></tbody></table>
```bash
sudo sed -i "s/;date.timezone.*/date.timezone = Europe/Paris" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 64M/" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/post_max_size = .*/post_max_size = 64M/" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/zlib.output_compression = .*/zlib.output_compression = on/" /etc/php/8.2/fpm/php.ini
sudo sed -i "s/;opcache.save_comments.*/opcache.save_comments = 1/" /etc/php/8.2/fpm/php.ini
```
```bash
sudo systemctl restart apache2.service
```
---
##### <span style="color: rgb(224, 62, 45);">**(!) In order to handle SEO url, include rewrite rules in [delmar.bzh.conf](https://bookstack.delmar.bzh/books/selfhosted/page/lamp "L.A.M.P")**</span>
## VirtualHost
```
.
├── apache
| └── joomla (87)
└── mariadb
```
`/etc/apache2/sites-available/delmar.bzh.conf`
```nginx
<VirtualHost *:87>
ServerName kontadenn.delmar.bzh
ServerAdmin admin@delmar.bzh
DocumentRoot /var/www/kontadenn
<Directory /var/www/kontadenn>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
RewriteEngine on
#Domain: kontadenn.delmar.bzh
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
RewriteRule ^upload/.+$ %{ENV:REWRITEBASE}index.php [QSA,L]
# Images
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$1$3 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$1$4 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$4/$1$5 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$4/$5/$1$6 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])([\d])([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$4/$5/$6/$1$7 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])([\d])([\d])([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$4/$5/$6/$7/$1$8 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^(([\d])([\d])([\d])([\d])([\d])([\d])([\d])(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/$2/$3/$4/$5/$6/$7/$8/$1$9 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^c/([\d]+)(\-[\.*\w-]*)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3 [L]
RewriteCond %{HTTP_HOST} ^shop.delmar.bzh$
RewriteRule ^c/([a-zA-Z_-]+)(-[\d]+)?/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3 [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ %{ENV:REWRITEBASE}js/jquery/plugins/fancybox/images/$1.$2 [L]
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
```