Dietpi   Openvpn/WWW

Items that were installed  81,83, 87, 89, 96, 103, 104 thru dietpi

#change apache2 listen port file is: 
#configure port for 8081
nano /etc/apache2/ports.conf

#Samba
nano /etc/samba/smb.conf
[www]
        comment = www
        path = /var/www
        browseable = yes
        create mask = 0775
        directory mask = 0775
        valid users = dietpi
        writeable = yes
max connections = 8

service smbd restart

chmod -R 777 /var/www

chmod -R 555 /var/www

#www.pivpn.io             openvpn client

curl -L https://install.pivpn.io | bash

#use port 11942

pivpn add

cd /home/dietpi/ovpns

python -m SimpleHTTPServer 7000


#Resize Partion dietpi

#check size
df -h

systemctl unmask dietpi-fs_partition_resize.service
systemctl enable dietpi-fs_partition_resize.service
reboot

#lan shutdown and reboot install openssh thru dietpi-software
cd /root
wget http://192.168.3.10/backup/lanscripts.tar.gz
tar -xzvf lanscripts.tar.gz

#SSH Pubic keys

ssh-keygen

ssh-copy-id root@192.168.3.10

#Cert/SSL stuff
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate.crt

mv private.key /etc/ssl/private/
mv certificate.crt /etc/ssl/certs/

nano /etc/apache2/sites-available/000-default.conf

#add

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
        SSLCertificateFile "/etc/ssl/certs/certificate.crt"
        SSLCertificateKeyFile "/etc/ssl/private/private.key"
</VirtualHost>

a2enmod ssl
apache2ctl configtest
systemctl restart apache2.service