# lxc-clone -o xenial_lxc -n webdav
# lxc-start -n webdav -d
# lxc-ls -f
$ sudo -i
# dpkg-reconfigure tzdata
# apt update
# apt upgrade
# apt install mc wget nano
# apt-get install apache2
# wget 127.0.0.1
должен быть доступен http://192.168.0.204/
-----------------------------------------------------------------------------------
SSL-сертификаты. Что это такое ? зачем это нужно?
Create SSL Certificates
# cd /etc/ssl/private
# openssl genrsa -aes256 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
Enter pass phrase for server.key: passphrase
Verifying - Enter pass phrase for server.key: passphrase
# openssl req -new -days 3650 -key server.key -out server.csr
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
# chmod 400 server.*
Убрать pass phrase из файла
# cd /etc/ssl/private
# mv server.key old-server.key
# openssl rsa -in old-server.key -out server.key
# chmod 400 server.*
!!!# reboot
Use WebDAV
# mkdir /home/webdav# chown ubuntu:www-data /home/webdav
# chmod 770 /home/webdav
SSL Settings
# nano /etc/apache2/sites-available/default-ssl.conf
Заменить содержимое:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/private/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
Alias /webdav /home/webdav
<Location /webdav>
DAV On
SSLrequireSSL
Options None
AuthType Basic
AuthName WebDAV
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Сохранить.
# a2enmod dav*
Considering dependency dav for dav_fs:
Enabling module dav.
Enabling module dav_fs.
# a2ensite default-ssl
# a2enmod ssl
# service apache2 reload
!!!# systemctl restart apache2# htpasswd -c /etc/apache2/.htpasswd ubuntu
Загрузить CarotDAV
Загрузить directnet-drive
https://192.168.0.204/webdav/
# lxc-start -n webdav -d
# lxc-ls -f
$ sudo -i
# dpkg-reconfigure tzdata
# apt update
# apt upgrade
# apt install mc wget nano
# apt-get install apache2
# wget 127.0.0.1
должен быть доступен http://192.168.0.204/
-----------------------------------------------------------------------------------
SSL-сертификаты. Что это такое ? зачем это нужно?
Create SSL Certificates
# cd /etc/ssl/private
# openssl genrsa -aes256 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
Enter pass phrase for server.key: passphrase
Verifying - Enter pass phrase for server.key: passphrase
# openssl req -new -days 3650 -key server.key -out server.csr
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650
# chmod 400 server.*
Убрать pass phrase из файла
# cd /etc/ssl/private
# mv server.key old-server.key
# openssl rsa -in old-server.key -out server.key
# chmod 400 server.*
!!!# reboot
Use WebDAV
# mkdir /home/webdav# chown ubuntu:www-data /home/webdav
# chmod 770 /home/webdav
SSL Settings
# nano /etc/apache2/sites-available/default-ssl.conf
Заменить содержимое:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/private/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
Alias /webdav /home/webdav
<Location /webdav>
DAV On
SSLrequireSSL
Options None
AuthType Basic
AuthName WebDAV
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Сохранить.
# a2enmod dav*
Considering dependency dav for dav_fs:
Enabling module dav.
Enabling module dav_fs.
# a2ensite default-ssl
# a2enmod ssl
# service apache2 reload
!!!# systemctl restart apache2# htpasswd -c /etc/apache2/.htpasswd ubuntu
Загрузить CarotDAV
Загрузить directnet-drive
https://192.168.0.204/webdav/
.
Комментариев нет:
Отправить комментарий