Бесплатное облачный сервер на Nextcloud
Nextcloud – это аналог Dropbox, который можно развернуть на собственном VPS и сделать облако для хранения файлов — фотографий, видео и любых других.
*****************Консольный режим*****************
yum -y install epel-release -y
yum install epel-release yum-utils -y
yum update -y
reboot
**********************************************************************
Настраиваем время
**********************************************************************
yum install chrony
systemctl enable chronyd --now
hostnamectl set-hostname cloud.ваш домен.ру
****************************************************************************
Настройка безопасности
***************************************************************************
firewall-cmd --permanent --add-port=22/tcp
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --zone=public --add-service=ftp
firewall-cmd --permanent --add-port=49000-55000/tcp
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --add-port=10000/{tcp,udp}
firewall-cmd --reload
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
****************************************************************************
Устанавливаем необходимые программы
****************************************************************************
yum install gcc ntpdate automake libtool -y
yum install mc -y
yum install wget -y
yum install net-tools -y
yum install unzip -y
****************************************************************************
Устанавливаем MySQL/MariaDB
****************************************************************************
yum -y install mariadb-server mariadb
systemctl start mariadb
systemctl enable mariadb
mysqladmin -u root password 'ваш пароль'
mysql_secure_installation
-------------------------------------------------------------------------
Chang the root password=no
а со стальным соглашаемся
-------------------------------------------------------------------------
******************************************************************************
Установка Apache
******************************************************************************
yum -y install httpd mod_ssl
systemctl start httpd.service
systemctl enable httpd.service
##############################################################################
Проверяем:http://ваш ip-адрес/
##############################################################################
mcedit /etc/httpd/conf.d/welcome.conf
------------------------------ Заменяем в welcome.conf--------------------
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL. To disable the
# Welcome page, comment out all the lines below.
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
#<LocationMatch "^/+$">
# Options -Indexes
# ErrorDocument 403 /.noindex.html
#</LocationMatch>
#<Directory /usr/share/httpd/noindex>
# AllowOverride None
# Require all granted
#</Directory>
#Alias /.noindex.html /usr/share/httpd/noindex/index.html
#Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
#Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
#Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
#Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
--------------------------------------------------------------------------------------
******************************************************************************
Установка PHP
******************************************************************************
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php74
yum install httpd php php-gd php-json php-mysql php-curl php-mbstring php-intl php-mcrypt php-imagick php-xml php-zip php-ldap
---------------------------------------------------------------------------------------
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxf ioncube_loaders_lin_x86-64.tar.gz
mv ioncube /usr/local
Настройка PHP
mcedit /etc/php.ini
-----------------------------Вставляем в php.ini -----------------------------------
находим и исправляем на наши данные
realpath_cache_size = 1024k
max_execution_time 128
max_input_time 128
post_max_size 2048M
upload_max_filesize 2048M
#Вставляем самом внизу php.ini
[Zend Modules]
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.4.so
zend_extension_ts = /usr/local/ioncube/ioncube_loader_lin_5.4_ts.so
----------------------------------------------------=-------------------------------
*************************************************************************************
Установка phpmyadmin
*************************************************************************************
yum install -y phpmyadmin
После успешной установки
cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.orig
mcedit /etc/httpd/conf.d/phpMyAdmin.conf
--------------------------------- Заменяем в phpMyAdmin.conf------------------------
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
---------------------------------------------------------------------------------------
******************************************************************************
Установка Nextcloud
******************************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-24.zip
unzip /tmp/latest-24.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-20.zip
unzip /tmp/latest-20.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-22.zip
unzip /tmp/latest-22.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/nextcloud-25.0.3.zip
unzip /tmp/nextcloud-25.0.3.zip -d /var/www
chown -R apache: /var/www/nextcloud
******************************************************************************
Настройте Apache
******************************************************************************
mcedit /etc/httpd/conf.d/nextcloud.conf
------------------------------------------------------------------------------
Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>
----------------------------------------------------------------------------
systemctl restart httpd
http://domain_name_or_ip_address/nextcloud
*****************Консольный режим*****************
yum -y install epel-release -y
yum install epel-release yum-utils -y
yum update -y
reboot
**********************************************************************
Настраиваем время
**********************************************************************
yum install chrony
systemctl enable chronyd --now
hostnamectl set-hostname cloud.ваш домен.ру
****************************************************************************
Настройка безопасности
***************************************************************************
firewall-cmd --permanent --add-port=22/tcp
firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --zone=public --add-service=ftp
firewall-cmd --permanent --add-port=49000-55000/tcp
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --add-port=10000/{tcp,udp}
firewall-cmd --reload
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
****************************************************************************
Устанавливаем необходимые программы
****************************************************************************
yum install gcc ntpdate automake libtool -y
yum install mc -y
yum install wget -y
yum install net-tools -y
yum install unzip -y
****************************************************************************
Устанавливаем MySQL/MariaDB
****************************************************************************
yum -y install mariadb-server mariadb
systemctl start mariadb
systemctl enable mariadb
mysqladmin -u root password 'ваш пароль'
mysql_secure_installation
-------------------------------------------------------------------------
Chang the root password=no
а со стальным соглашаемся
-------------------------------------------------------------------------
******************************************************************************
Установка Apache
******************************************************************************
yum -y install httpd mod_ssl
systemctl start httpd.service
systemctl enable httpd.service
##############################################################################
Проверяем:http://ваш ip-адрес/
##############################################################################
mcedit /etc/httpd/conf.d/welcome.conf
------------------------------ Заменяем в welcome.conf--------------------
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL. To disable the
# Welcome page, comment out all the lines below.
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
#<LocationMatch "^/+$">
# Options -Indexes
# ErrorDocument 403 /.noindex.html
#</LocationMatch>
#<Directory /usr/share/httpd/noindex>
# AllowOverride None
# Require all granted
#</Directory>
#Alias /.noindex.html /usr/share/httpd/noindex/index.html
#Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
#Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
#Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
#Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
--------------------------------------------------------------------------------------
******************************************************************************
Установка PHP
******************************************************************************
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php74
yum install httpd php php-gd php-json php-mysql php-curl php-mbstring php-intl php-mcrypt php-imagick php-xml php-zip php-ldap
---------------------------------------------------------------------------------------
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxf ioncube_loaders_lin_x86-64.tar.gz
mv ioncube /usr/local
Настройка PHP
mcedit /etc/php.ini
-----------------------------Вставляем в php.ini -----------------------------------
находим и исправляем на наши данные
realpath_cache_size = 1024k
max_execution_time 128
max_input_time 128
post_max_size 2048M
upload_max_filesize 2048M
#Вставляем самом внизу php.ini
[Zend Modules]
zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.4.so
zend_extension_ts = /usr/local/ioncube/ioncube_loader_lin_5.4_ts.so
----------------------------------------------------=-------------------------------
*************************************************************************************
Установка phpmyadmin
*************************************************************************************
yum install -y phpmyadmin
После успешной установки
cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.orig
mcedit /etc/httpd/conf.d/phpMyAdmin.conf
--------------------------------- Заменяем в phpMyAdmin.conf------------------------
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
---------------------------------------------------------------------------------------
******************************************************************************
Установка Nextcloud
******************************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-24.zip
unzip /tmp/latest-24.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-20.zip
unzip /tmp/latest-20.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/latest-22.zip
unzip /tmp/latest-22.zip -d /var/www
chown -R apache: /var/www/nextcloud
***********************************************************************
wget -P /tmp https://download.nextcloud.com/server/releases/nextcloud-25.0.3.zip
unzip /tmp/nextcloud-25.0.3.zip -d /var/www
chown -R apache: /var/www/nextcloud
******************************************************************************
Настройте Apache
******************************************************************************
mcedit /etc/httpd/conf.d/nextcloud.conf
------------------------------------------------------------------------------
Alias /nextcloud "/var/www/nextcloud/"
<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>
----------------------------------------------------------------------------
systemctl restart httpd
http://domain_name_or_ip_address/nextcloud
- root от