This commit is contained in:
Keanu Taufan 2024-10-03 19:42:59 +07:00
parent e19ff98548
commit f0e9a7ef87
No known key found for this signature in database
GPG Key ID: 1952D665A3A51BE0
2 changed files with 27 additions and 1 deletions

26
BrokoliWebServer/18.sh Normal file
View 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

View File

@ -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