SMF - Just Installed!
/system ntp client set enabled=yes servers=0.ru.pool.ntp.org,1.ru.pool.ntp.org/certificate add name=tmpl-cloud-CA country="RU" state="MO" locality="ODN" organization="Cloud-life" unit="IT" common-name="cloud-CA" key-size=4096 days-valid=3650 key-usage=crl-sign,key-cert-sign/certificate sign tmpl-cloud-CA ca-crl-host=127.0.0.1 name="cloud-CA"/certificate add name=OVPN-SRV country="RU" state="MO" locality="ODN" organization="Cloud-life" unit="IT" common-name="srv-OVPN" key-size=4096 days-valid=1095 key-usage=digital-signature,key-encipherment,tls-server/certificate sign OVPN ca="cloud-CA" name="srv-OVPN"/certificate add name=templ-CL country="RU" state="MO" locality="ODN" organization="Cloud-life" unit="IT" common-name="client-vpn-templ" key-size=4096 days-valid=365 key-usage=tls-client/certificate add name=user1 copy-from="templ-CL" common-name="test-client-ovpn-1"/certificate sign user1 ca="cloud-CA" name="test-client-ovpn-1"certificate issued-revoke %cert-name%/ip pool add name=OVPN_srv_pool ranges=192.168.100.2-192.168.254/ppp profile add name=OVPN_server local-address=192.168.100.1 remote-address=OVPN_srv_pooldns=192.168.100.1 use-ipv6=no/ppp aaa set accounting=yes/ppp secret add name=test-user-1 password=P@ssword1 service=ovpn profile=OVPN_server/ppp secret add name=test-user-2 password=P@ssword2 service=ovpn profile=OVPN_server/interface ovpn-server server set auth=sha1 cipher=blowfish128 default-profile=OVPN_server mode=ip netmask=24 require-client-certificate=yes certificate=srv-OVPN enabled=yes/ip pool add name=OVPN_srv_pool ranges=192.168.100.2-192.168.254/interface bridge add name=OVPN_bridge arp=enabled/ppp profile add name=OVPN_server local-address=192.168.100.1 remote-address=OVPN_srv_pool bridge=OVPN_bridge/ppp aaa set accounting=yes/ppp secret add name=test-user-1 password=P@ssword1 service=ovpn profile=OVPN_server/ppp secret add name=test-user-2 password=P@ssword2 service=ovpn profile=OVPN_server/interface ovpn-server server set auth=sha1 cipher=blowfish128 default-profile=OVPN_server mode=ethernet netmask=24 require-client-certificate=yes certificate=srv-OVPN enabled=yes/certificate export-certificate cloud-CA export-passphrase=""/certificate export-certificate test-client-ovpn-1 export-passphrase=private-key-password1/certificate export-certificate test-client-ovpn-2 export-passphrase=private-key-password2clientdev tundev tapdev-node MyTap
proto tcpremote ovpn.my.domain 1194resolv-retry infinitenobindpersist-key
persist-tun;http-proxy [proxy server] [proxy port #]
;mute-replay-warningsca cert_export_test-CA.crt
cert cert_export_test-client-ovpn-1.crt
key cert_export_test-client-ovpn-1.key
--auth-user-pass user-pwd.txtremote-cert-tls server;tls-auth ta.key 1;cipher x;comp-lzoverb 3;mute 20route 192.168.88.0 255.255.255.0route-delay 5redirect-gateway def1/certificate import file-name=cert_export_test-CA.crt passphrase=""/certificate import file-name=cert_export_test-client-ovpn-1.crt passphrase=""/certificate import file-name=cert_export_test-client-ovpn-1.key passphrase=private-key-password1/interface ovpn-client add name=OVPN_client connect-to={ovpn.my.domain|xxx.xxx.xxx.xxx} port=1194 mode={ip|ethernet} user=test-user-1 password=P@ssword1 profile=default certificate=cert_32 auth=sha1 cipher=blowfish128 add-default-route={no|yes} disabled=noapt update apt upgradeapt install chronytimedatectl set-timezone Europe/Moscowsystemctl enable chronyiptables -I INPUT -p tcp --dport 80 -j ACCEPTiptables -I INPUT -p tcp --dport 443 -j ACCEPTapt install iptables-persistentnetfilter-persistent saveapt install mariadb-serversystemctl enable mariadbsystemctl start mariadbmysqladmin -u root passwordmysql -uroot -pCREATE DATABASE nextcloud DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;GRANT ALL PRIVILEGES ON nextcloud.* TO nextcloud@localhost IDENTIFIED BY 'nextcloud';\qexport PHP_VER=8.1apt search --names-only '^php[.0-9]{3}$'apt install php php-fpm php-common php-zip php-xml php-intl php-gd php-mysql php-mbstring php-curl php-imagickapt install php${PHP_VER}-fpm php${PHP_VER}-common php${PHP_VER}-zip php${PHP_VER}-xml php${PHP_VER}-intl php${PHP_VER}-gd php${PHP_VER}-mysql php${PHP_VER}-mbstring php${PHP_VER}-curl php${PHP_VER}-imagick php${PHP_VER}-gmp php${PHP_VER}-bcmath libmagickcore-6.q16-6-extravi /etc/php/${PHP_VER}/fpm/pool.d/www.confЦитироватьenv[PATH] = /usr/local/bin:/usr/bin:/bin
Цитироватьopcache.enable_cli=1
opcache.interned_strings_buffer=32
opcache.revalidate_freq=1
sed -i 's/;opcache.enable=.*/opcache.enable=1/' /etc/php/8.3/fpm/php.inised -i 's/;opcache.enable_cli=.*/opcache.enable_cli=1/' /etc/php/8.3/fpm/php.inised -i 's/;opcache.memory_consumption=.*/opcache.memory_consumption=128/' /etc/php/8.3/fpm/php.inised -i 's/;opcache.interned_strings_buffer=.*/opcache.interned_strings_buffer=8/' /etc/php/8.3/fpm/php.inised -i 's/;opcache.max_accelerated_files=.*/opcache.max_accelerated_files=10000/' /etc/php/8.3/fpm/php.inisystemctl enable php${PHP_VER}-fpmsystemctl restart php${PHP_VER}-fpmapt install nginxvi /etc/nginx/sites-enabled/nextcloud.confserver {
listen 80;
listen 443 ssl;
server_name nextcloud.yourdomain.com;
if ($scheme = 'http') {
return 301 https://$host$request_uri;
}
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/cert.key;
root /var/www/nextcloud;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
client_max_body_size 10G;
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
index index.php;
error_page 403 = /core/templates/403.php;
error_page 404 = /core/templates/404.php;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location ^~ /.well-known {
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location = /.well-known/webfinger { return 301 /index.php/.well-known/webfinger; }
location = /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo; }
location ^~ /.well-known{ return 301 /index.php/$uri; }
try_files $uri $uri/ =404;
}
location / {
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ index.php;
if ($request_method = OPTIONS) {
return 301 $scheme://$server_name/remote.php/webdav/;
}
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 = 404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_param HTTPS on;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
}
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires modified +30d;
access_log off;
}
}mkdir /etc/nginx/sslcd /etc/nginx/sslopenssl req -new -x509 -days 1461 -nodes -out cert.pem -keyout cert.key -subj "/C=RU/ST=SPb/L=SPb/O=Global Security/OU=IT Department/CN=nextcloud.yourdomain.com/CN=nextcloud"systemctl stop apache2systemctl disable apache2nginx -tsystemctl restart nginxsystemctl enable nginxapt install unzipapt install imagemagickcd /tmpwget https://download.nextcloud.com/server/releases/latest.zipunzip latest.zipmv nextcloud /var/wwwchown -R www-data:www-data /var/www/nextcloudsudo -u www-data php /var/www/nextcloud/occ db:convert-filecache-bigintvi /etc/php/${PHP_VER}/fpm/php.inimemory_limit = 512Msystemctl restart php${PHP_VER}-fpmЦитироватьdnf install php-<название модуля>
apt install php-gmp php-bcmathsystemctl restart php${PHP_VER}-fpmapt install redis-server php-redissystemctl restart php${PHP_VER}-fpmvi /var/www/nextcloud/config/config.php 'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
),apt install memcached php-memcachedsystemctl enable memcachedsystemctl restart php${PHP_VER}-fpmvi /var/www/nextcloud/config/config.php 'memcache.local' => '\\OC\\Memcache\\Memcached',
'memcache.distributed' => '\\OC\\Memcache\\Memcached',
'memcached_servers' =>
array (
0 =>
array (
0 => 'localhost',
1 => 11211,
),
),vi /var/www/nextcloud/config/config.php'default_phone_region' => 'RU',sudo -u www-data php /var/www/nextcloud/occ user:add adminsudo -u www-data php /var/www/nextcloud/occ user:resetpassword adminsc config webclient start= autonet start webclientnet use <Буква диска>: https://<путь до nextcloud>/remote.php/webdav /user:user passwordnet use N: https://nextcloud.yourdomain.com/remote.php/webdav /user:admin passwordreg add "HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters" /v FileSizeLimitInBytes /t REG_DWORD /d 4294967295 /fapt install davfs2yum install davfs2mount -t davfs -o noexec https://nextcloud.yourdomain.com/remote.php/webdav /mntvi /etc/fstabhttps://nextcloud.yourdomain.com/remote.php/webdav/ /mnt davfs user,rw,_netdev 0 0vi /etc/davfs2/secrets/mnt user passwordmount -aapt updateapt upgrade -yapt install chrony -ysystemctl enable chronytimedatectl set-timezone Europe/Moscowtimedatectl list-timezonesiptables -I INPUT -p tcp --dport 8000 -j ACCEPTiptables -I INPUT -p tcp --dport 8082 -j ACCEPTapt install iptables-persistent -ynetfilter-persistent saveapt install memcached libmemcached-dev -yvi /etc/memcached.confЦитировать-m 512
systemctl restart memcachedsystemctl enable memcachedapt install python3 python3-setuptools python3-pip libmysqlclient-dev -ypip3 install --timeout=3600 django==3.2.* Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 django-pylibmc django-simple-captcha python3-ldap mysqlclient pycryptodome==3.12.0 cffi==1.14.0apt install mariadb-server -ymysqladmin -u root passwordmysql -uroot -psystemctl enable mariadbuseradd seafile -rmkdir -p /opt/seafile/binwget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_9.0.10_x86-64.tar.gztar zxf seafile-server_*.tar.gz -C /opt/seafile/bin --strip-components 1chown -R seafile:seafile /opt/seafilesu seafilecd /opt/seafile/bin./setup-seafile-mysql.shvi /opt/seafile/conf/gunicorn.conf.pyЦитироватьbind = "0.0.0.0:8000"
vi /opt/seafile/conf/seahub_settings.pyCACHES = {
'default': {
'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
'LOCATION': '127.0.0.1:11211',
},
}
/opt/seafile/bin/seafile.sh start /opt/seafile/bin/seahub.sh startЦитироватьSeahub is started
Done.
/opt/seafile/bin/seahub.sh stop/opt/seafile/bin/seafile.sh stopexitsystemctl edit --full --force seafile[Unit]
Description=Seafile Service
After=network.target
[Service]
User=seafile
Group=seafile
Type=forking
ExecStart=/opt/seafile/bin/seafile.sh start
ExecStop=/opt/seafile/bin/seafile.sh stop
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.targetsystemctl edit --full --force seahub[Unit]
Description=Seahub Service
After=network.target
[Service]
User=seafile
Group=seafile
Type=forking
ExecStart=/opt/seafile/bin/seahub.sh start
ExecStop=/opt/seafile/bin/seahub.sh stop
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.targetsystemctl enable seafile seahubsystemctl start seafile seahubsystemctl status seafile seahubЦитироватьserver {Код: bash listen 443; server_name security.dmosk.ru; ssl on; ssl_certificate /etc/nginx/ssl/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/cert.key;
...
}
systemctl restart nginxvi /etc/nginx/nginx.confЦитироватьhttp {* в данном примере мы указали, что разрешены подключения только по TLS версий 1.2 и 1.3.
...
.. Код: bash ssl_protocols TLSv1.2 TLSv1.3;
}
systemctl restart nginxvi /etc/nginx/nginx.confЦитироватьhttp {
..... Код: bash ssl_prefer_server_ciphers on;
}
systemctl restart nginxopenssl dhparam -out /etc/nginx/dh2048.pem 2048Цитироватьhttp {
..... Код: bash ssl_dhparam dh2048.pem;
}
Цитироватьserver {} Код: bash listen 80; server_name security.dmosk.ru; return 301 https://$host$request_uri;
systemctl restart nginxdnf config-manager --set-enabled crbsudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpmsudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm -ysudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.noarch.rpmsudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm -ydnf module list phpsudo dnf module enable php:remi-7.4 -ysudo dnf install php php-cli -ysudo dnf install php-fpm php-cli -ysudo dnf install php-cli php-fpm php-curl php-mysqlnd php-gd php-opcache php-zip php-intl php-common php-bcmath php-imagick php-xmlrpc php-json php-readline php-memcached php-redis php-mbstring php-apcu php-xml php-dom php-redis php-memcached php-memcachetimedatectl set-timezone Europe/Moscowyum install chronysystemctl enable chronyd --nowfirewall-cmd --permanent --add-port={5060,5061}/{tcp,udp}firewall-cmd --permanent --add-port=10000-20000/udpfirewall-cmd --permanent --add-service={http,https}firewall-cmd --reloadiptables -I INPUT -p tcp --match multiport --dports 5060,5061 -j ACCEPTiptables -I INPUT -p udp --match multiport --dports 5060,5061 -j ACCEPTiptables -I INPUT -p udp --match multiport --dports 80,443 -j ACCEPTiptables -I INPUT -p udp --dport 10000:20000 -j ACCEPTdnf install iptables-servicessystemctl enable iptablesservice iptables savesetenforce 0sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/configdnf install wget tar glibc-langpack-ruuseradd asterisk -mdnf install mariadb-serversystemctl enable mariadb --nowmysqladmin -u root passworddnf install nginxvi /etc/nginx/nginx.confclient_max_body_size 128M;systemctl enable nginx --nowdnf install php php-fpm php-bcmath php-gd php-json php-mbstring php-mysqlnd php-pear php-snmp php-zipsed -i "s/upload_max_filesize = .*/upload_max_filesize = 128M/" /etc/php.inised -i "s/post_max_size = .*/post_max_size = 128M/" /etc/php.inised -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php.inivi /etc/php.inidate.timezone = "Europe/Moscow"vi /etc/php-fpm.d/www.confЦитироватьuser = asterisk
...
group = asterisk
...
listen.acl_users = asterisk,apache,nginx
systemctl enable php-fpm --nowvi /etc/nginx/nginx.confЦитировать...
http {
...
server {
...
server_name 192.168.1.15;
...
location ~ \.php$ {
set $root_path /usr/share/nginx/html;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SERVER_NAME $host;
}
...
systemctl reload nginxvi /usr/share/nginx/html/index.php<?php phpinfo(); ?>dnf install nodejsnode --versiondnf --enablerepo=powertools install libedit-develwget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gztar -xvf asterisk-*.tar.gzcd asterisk-*/./contrib/scripts/install_prereq installmake distclean./contrib/scripts/get_mp3_source.sh./configureyum install libsrtp libsrtp-devel./configure --libdir=/usr/lib64 --with-crypto --with-ssl=ssl --with-srtpmake menuselectmakemake installdnf install chkconfigmake configmake samplesmake install-logrotateldconfigvi /etc/sysconfig/asteriskЦитироватьAST_USER="asterisk"
AST_GROUP="asterisk"
vi /etc/asterisk/asterisk.confЦитироватьrunuser = asterisk
rungroup = asterisk
Цитироватьdefaultlanguage = ru
documentation_language = ru_RU
chown -R asterisk:asterisk /var/run/asteriskchown -R asterisk:asterisk /etc/asteriskchown -R asterisk:asterisk /var/{lib,log,spool}/asteriskchown -R asterisk:asterisk /var/log/asterisksudo chown -R asterisk.asterisk /etc/asterisk /var/run/asterisk /var/{lib,log,spool}/asterisk /usr/lib64/asteriskasterisk -csystemctl enable asterisksystemctl start asteriskcd ~dnf install sox mpg123 -ywget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-16.0-latest.tgztar zxvf freepbx-*.tgzcd freepbx./start_asterisk startЦитироватьSTARTING ASTERISK
Asterisk is already running
./install -n --dbuser root --dbpass password --webroot=/usr/share/nginx/htmlЦитироватьYou have successfully installed FreePBX
vi /etc/asterisk/manager.confЦитировать#include manager_additional.conf
#include manager_custom.conf
Цитировать;include manager_additional.confПерезапускаем сервис Asterisk:
;include manager_custom.conf
systemctl restart asterisksudo dnf updateuname -rsudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.orgsudo dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpmsudo dnf --enablerepo=elrepo-kernel install kernel-mlicacls "full-path-to-vhd-or-vhdx-file" /grant "NT VIRTUAL MACHINE\Virtual-Machine-ID":(F)icacls "E:\Hyper-V\PC-Name\Virtual Hard Disks\MyVHD.vhdx" /grant "NT VIRTUAL MACHINE\B9C4F7D4-0009-4BE2-90FB-9D60B1A06BDD":(F)