Instalator Nettemp dla Ubuntu 18.04

Awatar użytkownika
hryst
Betatester
Posty: 760
Rejestracja: wt mar 25, 2014 8:52 am
Kontakt:

Instalator Nettemp dla Ubuntu 18.04

Post autor: hryst » wt lip 31, 2018 2:22 pm

Witam!
Przestawiam prosty skrypt instalacyjny Nettemp wersja https://github.com/mariano78/nettemp
Instalator zrobiony jest pod ubuntu 18.04 oraz PHP 7.1

Kod: Zaznacz cały

#! /bin/bash
# instalator nettepa dla ubuntu 18.04 oraz php 7.1
# przygotowany przez @hryst 

#check other www server
systemctl stop nginx.service
systemctl disable nginx.service
systemctl stop apache2.service
systemctl disable apache2


apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
# wyswietl katalog
pwd
read -rsp $'\e[31m---------- Instalacja lighttpd oraz php 7.1 ---------- \n Press any key or wait 2 sec...\n' -n 1 -t 2;
apt update && apt upgrade -y && apt install lighttpd -y
apt update && apt upgrade -y && apt install php7.1-cgi php7.1-cli php7.1-fpm php7.1-mysql php7.1-sqlite php7.1-curl php7.1-gd php7.1-recode php7.1-tidy php7.1-xmlrpc php7.1-xml php7.1-snmp -y

lighttpd-enable-mod rewrite
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
read -rsp $'\e[31m---------- Aktywowano moduly php ---------- \n Press any key or wait 1 sec...\n' -n 1 -t 1;

# konfig lighttpd
cp  /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.org

# jak rewrite nie dziala to dodac wpis
#        "mod_redirect",
#        "mod_rewrite",

# www dir
sed -i -e 's/server.document-root        = \"\/var\/www\"/server.document-root        = \"\/var\/www\/nettemp\"/g' /etc/lighttpd/lighttpd.conf
sed -i -e 's/server.document-root        = \"\/var\/www\/html"/server.document-root        = \"\/var\/www\/nettemp\"/g' /etc/lighttpd/lighttpd.conf
# didable dir access
sed -i '/url.access-deny/d' /etc/lighttpd/lighttpd.conf
sed -i '$a url.access-deny = ( "~", ".inc", ".dbf", ".db", ".txt", ".rrd" )' /etc/lighttpd/lighttpd.conf
sed -i '$a $HTTP["url"] =~ "^/modules"  { url.access-deny = ("") }' /etc/lighttpd/lighttpd.conf
# set url rewrite
if ! cat /etc/lighttpd/lighttpd.conf |grep -q url.rewrite-once; then
echo "url.rewrite-once = ( \"^/([A-Za-z0-9-_-]+)\$\" => \"/index.php?id=\$1\" )" >> /etc/lighttpd/lighttpd.conf
fi
read -rsp $'\e[31m---------- zmiany w php ---------- \n Press any key or wait 1 sec...\n' -n 1 -t 1;
# htaccess
if ! cat /etc/lighttpd/lighttpd.conf |grep -q Password; then
sed -i '$aauth.debug = 2' /etc/lighttpd/lighttpd.conf
sed -i '$aauth.backend = "plain"' /etc/lighttpd/lighttpd.conf
sed -i '$aauth.backend.plain.userfile = "/etc/lighttpd/.lighttpdpassword"' /etc/lighttpd/lighttpd.conf
sed -i '$aauth.require = ( "/" =>' /etc/lighttpd/lighttpd.conf
sed -i '$a(' /etc/lighttpd/lighttpd.conf
sed -i '$a"method" => "basic",' /etc/lighttpd/lighttpd.conf
sed -i '$a"realm" => "Password protected area",' /etc/lighttpd/lighttpd.conf
sed -i '$a"require" => "user=admin"' /etc/lighttpd/lighttpd.conf
sed -i '$a)' /etc/lighttpd/lighttpd.conf
sed -i '$a)' /etc/lighttpd/lighttpd.conf
sed -i '$a www-data ALL=(ALL) NOPASSWD: /usr/sbin/lighttpd-enable-mod *, /usr/sbin/lighttpd-disable-mod *' /etc/sudoers
touch /etc/lighttpd/.lighttpdpassword
chown www-data:www-data /etc/lighttpd/.lighttpdpassword
echo "admin:admin" > /etc/lighttpd/.lighttpdpassword
fi
# Configure PHP

cp /etc/php/7.1/cli/php.ini /etc/php/7.1/cli/php.ini.org
sed -i "s/memory_limit = 128M/memory_limit = 256M/" /etc/php/7.1/cli/php.ini
sed -i "s/max_execution_time =.*/max_execution_time = 1800/" /etc/php/7.1/cli/php.ini
sed -i "s/max_input_time =.*/max_input_time = 3600/" /etc/php/7.1/cli/php.ini
sed -i "s/post_max_size =.*/post_max_size = 10240M/" /etc/php/7.1/cli/php.ini
sed -i "s/upload_max_filesize =.*/upload_max_filesize = 10240M/" /etc/php/7.1/cli/php.ini
sed -i "s/max_file_uploads =.*/max_file_uploads = 100/" /etc/php/7.1/cli/php.ini
sed -i "s/;date.timezone.*/date.timezone = Europe\/\Warsaw/" /etc/php/7.1/cli/php.ini
sed -i "s/;session.cookie_secure.*/session.cookie_secure = True/" /etc/php/7.1/cli/php.ini
sed -i "s/memory_limit = 128M/memory_limit = 256M/" /etc/php/7.1/fpm/php.ini
sed -i "s/output_buffering =.*/output_buffering = 'Off'/" /etc/php/7.1/fpm/php.ini
sed -i "s/max_execution_time =.*/max_execution_time = 1800/" /etc/php/7.1/fpm/php.ini
sed -i "s/max_input_time =.*/max_input_time = 3600/" /etc/php/7.1/fpm/php.ini
sed -i "s/post_max_size =.*/post_max_size = 10240M/" /etc/php/7.1/fpm/php.ini
sed -i "s/upload_max_filesize =.*/upload_max_filesize = 10240M/" /etc/php/7.1/fpm/php.ini
sed -i "s/max_file_uploads =.*/max_file_uploads = 100/" /etc/php/7.1/fpm/php.ini
sed -i "s/;date.timezone.*/date.timezone = Europe\/\Warsaw/" /etc/php/7.1/fpm/php.ini
sed -i "s/;session.cookie_secure.*/session.cookie_secure = True/" /etc/php/7.1/fpm/php.ini
sed -i 's/;sendmail_path =/sendmail_path = '\''\/usr\/bin\/msmtp -t'\''/g' /etc/php/7.1/fpm/php.ini

cat /etc/php/7.1/cli/php.ini | grep memory_limit
cat /etc/php/7.1/cli/php.ini | grep upload_max_filesize
cat /etc/php/7.1/fpm/php.ini | grep memory_limit
cat /etc/php/7.1/fpm/php.ini | grep upload_max_filesize

read -rsp $'\e[31mInstalacja dodatkow \n Press any key or wait 2 seconds...\n' -n 1 -t 2;
apt install acl sqlite3 msmtp digitemp gammu git-core mc sysstat sharutils bc htop snmp sudo ntp watchdog i2c-tools arp-scan snmpd httping fping make gcc lynx expect socat build-essential python-dev python-smbus python-pymodbus python-pip libjpeg-dev figlet libmodbus5 libmodbus-dev iptables-persistent apcupsd smstools mysql-client lm-sensors mosquitto mosquitto-clients iptables git -y

timedatectl set-timezone Europe/Warsaw
timedatectl set-ntp on

read -rsp $'\e[31m---------- Instalacja NETTEMP ver: mariano78 ---------- \n Press any key or wait 2 seconds...\n' -n 1 -t 2;

mkdir -p /var/www/nettemp && cd /var/www
git clone https://github.com/mariano78/nettemp
cd nettemp && git checkout betamm 
chown -R www-data:www-data /var/www/nettemp
chmod -R 755 /var/www/nettemp

sed -i '\/source install\/apt\/apt.sh/d' /var/www/nettemp/install/run.sh
sed -i '\/source install\/www\/www.sh/d' /var/www/nettemp/install/run.sh
cat /var/www/nettemp/install/run.sh | grep source

systemctl restart php7.1-fpm && systemctl restart lighttpd.service
read -rsp $'\e[31m---------- uruchomienie instalatora NETTEMP ---------- \n nie powinno byc wpisow apt.sh oraz www.sh \n Press any key or wait 2 seconds...\n' -n 1 -t 2;
./install_nettemp
pozdrowka
Załączniki
ubuntu18-php71.zip
instalator NT na ubuntu
(1.96 KiB) Pobrany 6 razy
--- działam na orange pi plus H3 -> Rock64 ---

Awatar użytkownika
pasiekazj
Posty: 713
Rejestracja: pn wrz 28, 2015 10:35 am
Lokalizacja: Częstochowa
Kontakt:

Re: Instalator Nettemp dla Ubuntu 18.04

Post autor: pasiekazj » pt sie 03, 2018 10:02 pm

Good Job. Postaram się uwzględnić.
Rpi 3 + SSD 240 GB + nettemp.
http://mmsite.pl

ODPOWIEDZ