12 Commits
Author SHA1 Message Date
bachir ce76a4c5ae genpasswd 2019-04-18 23:33:32 +02:00
bachir faa699748c add alpine wiki link to readme 2019-04-18 23:17:04 +02:00
bachir f29afb4b38 fixed mariadb bug 2019-04-18 23:16:33 +02:00
bachir 8eba82aa45 git config --global core.safecrlf false 2019-04-18 22:46:31 +02:00
bachir 1ff1992bb3 activated cron 2019-04-18 22:37:01 +02:00
bachir 3fdfecc59e fix redis install 2019-04-18 21:20:46 +02:00
bachir 99dd0b309c fix git clone command in readme 2019-04-18 21:13:17 +02:00
bachir 1376de6848 fix install.sh first read 2019-04-18 21:12:37 +02:00
bachir 8fd7b3baf9 3.8 readme 2019-04-18 20:51:43 +02:00
bachir 775036ca59 3.8 readme 2019-04-18 20:51:03 +02:00
bachir 2ce8042de7 3.8 readme 2019-04-18 20:39:22 +02:00
bachir e40394b444 3.8 readme 2019-04-18 20:36:19 +02:00
5 changed files with 48 additions and 16 deletions
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
_pass="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c16)"
echo "$_pass"
+20 -8
View File
@@ -34,20 +34,32 @@ echo -e '
'
echo -e "installing Mysql"
sleep 3
apk add mariadb mariadb-client
# https://bugs.alpinelinux.org/issues/9046
echo -n "are Maridb databases strored in a zfs file system? [y|n] "
read yn
if [ "$yn" = "Y" ] || [ "$yn" = "y" ]; then
echo -e "Stick with mariadb 10.1.x due to incompatibility of newer version with zfs"
echo -e "Please see this bug https://bugs.alpinelinux.org/issues/9046"
echo "http://dl-5.alpinelinux.org/alpine/v3.7/main" >> /etc/apk/repositories
echo -e "mariadb<10.1.99\nmariadb-client<10.1.99\nmariadb-common<10.1.99" >> /etc/apk/world
apk update
fi
DB_DATA_PATH="/var/lib/mysql"
DB_ROOT_PASS="mariadb_root_password"
DB_USER="mariadb_user"
DB_PASS="mariadb_user_password"
MAX_ALLOWED_PACKET="200M"
apk add mariadb mariadb-client
mysql_install_db --user=mysql --datadir=${DB_DATA_PATH}
mysql_install_db --user=mysql --datadir=/var/lib/mysql
rc-update add mariadb
service mariadb start
mysql_secure_installation
sed -i "s|max_allowed_packet\s*=\s*1M|max_allowed_packet = 200M|g" /etc/mysql/my.cnf
sed -i "s|max_allowed_packet\s*=\s*16M|max_allowed_packet = 200M|g" /etc/mysql/my.cnf
service mariadb restart
echo -e "mysql installed"
echo -e '
@@ -130,7 +142,7 @@ echo -e '
'
echo -e "Installing Redis"
sleep 3
apk add redis php7-pecl-redis
apk add redis php7-pecl-redis@edgecommunity
# TODO set maxmemory=2gb
# TODO set maxmemory-policy=volatile-lru
+4
View File
@@ -27,4 +27,8 @@ TIMEZONE="Europe/Paris"
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
echo "${TIMEZONE}" > /etc/timezone
rc-service crond start && rc-update add crond
git config --global core.safecrlf false
echo -e "Misc done"
+2 -2
View File
@@ -11,10 +11,10 @@ echo -e "\033[35;1mThis script has been tested only on Alpine Linux \033[0m"
. bin/checkroot.sh
echo -n "Should we start? [Y|n] "
echo -n "Should we start? [y|n] "
read yn
yn=${yn:-y}
if [ "$yn" != "y" ]; then
if [ "$yn" != "y" ] && [ "$yn" != "Y" ]; then
echo -e "aborting script!"
exit
fi
+18 -6
View File
@@ -1,6 +1,11 @@
# Install web server and secure it on alpine linux
# Install web server and secure it on alpine linux 3.8
## 3.9 branch for alpine linux 3.9
## Branches
each alpine linux stable release has it's branch (master is a clone of the last one)
- [3.8](https://figureslibres.io/gogs/bachir/alpine-web-werver/src/3.8)
- [3.9](https://figureslibres.io/gogs/bachir/alpine-web-werver/src/3.9) ([master](https://figureslibres.io/gogs/bachir/alpine-web-werver))
## Features
- [x] upgrade
- [x] bash
@@ -11,18 +16,21 @@
- [x] Ufw (may be eventualy replaced by awall ?)
- [x] Fail2ban
- [x] Knockd
- [ ] Mariadb (bug https://bugs.alpinelinux.org/issues/9046)
- [x] php7-fpm
- [x] Mariadb (bug https://bugs.alpinelinux.org/issues/9046)
- [ ] mysql backups
- [x] php7-fpm (7.1)
- [x] Nginx
- [x] drush
- [x] composer
- [ ] letsencrypt
- [ ] vhosts
- [x] redis
- [x] zabbix-agent
- [x] zabbix-agent (3.4)
- [x] urbackup-client
- [ ] solr
- [ ] git barre repos
- [ ] Proftpd
- [x] passwd generator
## how to use it
on a fresh install
@@ -35,7 +43,8 @@ apk add git
2 clone the repo
```
git clone https://figureslibres.io/gogs/bachir/alpine-web-werver.git
git clone -b 3.8 --single-branch https://figureslibres.io/gogs/bachir/al
pine-web-werver.git
```
3 you have to be root
@@ -58,3 +67,6 @@ all script in bin/ can be ran seperatly, but from the repos source exclusively
```
. bin/misc.sh
```
## ref
[Alpine Linux wiki](https://wiki.alpinelinux.org)