task 18
This commit is contained in:
parent
e19ff98548
commit
f0e9a7ef87
26
BrokoliWebServer/18.sh
Normal file
26
BrokoliWebServer/18.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
a2enmod auth_basic
|
||||||
|
htpasswd -bc /etc/apache2/.htpasswd Seblak sehatf01
|
||||||
|
|
||||||
|
cat > /etc/apache2/sites-available/k1.conf <<EOL
|
||||||
|
<VirtualHost *:9696 *:8888>
|
||||||
|
ServerName k1.vitamin.brokoli.f01.com
|
||||||
|
ServerAlias www.k1.vitamin.brokoli.f01.com
|
||||||
|
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot /var/www/k1.vitamin.brokoli.f01
|
||||||
|
|
||||||
|
<Directory /var/www/k1.vitamin.brokoli.f01>
|
||||||
|
AuthType Basic
|
||||||
|
AuthName "Restricted Content"
|
||||||
|
AuthUserFile /etc/apache2/.htpasswd
|
||||||
|
Require valid-user
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||||
|
</VirtualHost>
|
||||||
|
EOL
|
||||||
|
|
||||||
|
service apache2 restart
|
||||||
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
echo "nameserver 192.168.122.1" > /etc/resolv.conf
|
echo "nameserver 192.168.122.1" > /etc/resolv.conf
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install unzip php7.2 php7.2-fpm apache2 nginx -y
|
apt-get install unzip php7.2 php7.2-fpm apache2 apache2-utils nginx -y
|
||||||
Loading…
Reference in New Issue
Block a user