Dec 21

Quick – I Need a Cloud Server!

Tags:

#This installation assumes CentOS/RedHat/Fedora

NEXTCLOUD SETUP:

SERVER SOFTWARE INSTALLS:
sudo yum -y install screen vim iptables-services net-tools wget unzip epel-release
#if you’d rather ‘firewalld’ use this:
sudo yum -y install screen vim firewalld net-tools wget unzip epel-release

SELINUX DISABLE:
#change selinux=disabled
sudo vim /etc/selinux/config

FIREWALL SETUP:

#iptables:
sudo iptables -L
sudo iptables -I INPUT -m tcp -p tcp –dport 22 -j ACCEPT
#if you want to change your configuration ports (recommended):
sudo iptables -I INPUT -m tcp -p tcp –dport 10001 -j ACCEPT
sudo iptables -I INPUT -m tcp -p tcp –dport 10002 -j ACCEPT
#to keep the default ports:
sudo iptables -I INPUT -m tcp -p tcp –dport 80 -j ACCEPT
sudo iptables -I INPUT -m tcp -p tcp –dport 443 -j ACCEPT
sudo service iptables save
#ensure firewall remains on at reboot
sudo systemctl enable iptables

#firewalld:
sudo firewall-cmd –get active zones
sudo firewall-cmd –list-all
sudo firewall-cmd –zone=public –permanent –add-port=22/tcp
#if you want to change your configuration ports (recommended):
sudo firewall-cmd –zone=public –permanent –add-port=10001/tcp
sudo firewall-cmd –zone=public –permanent –add-port=10002/tcp
#to keep the default ports:
sudo firewall-cmd –zone=public –permanent –add-port=80/tcp
sudo firewall-cmd –zone=public –permanent –add-port=443/tcp
sudo firewall-cmd –reload
#ensure firewall remains on at reboot
sudo systemctl enable firewalld

MARIADB INSSTALL (database):
#cd /etc/yum.repos.d/
#sudo vim MariaDB.repo
sudo yum install mariadb mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
#select the defaults
mysql -u root -p

APACHE SETUP:
sudo yum install httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo sed -i ‘s/^/#&/g’ /etc/httpd/conf.modules.d/00-dav.conf
sudo service httpd restart
sudo systemctl enable httpd

sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install yum-utils
sudo yum update
sudo yum-config-manager –enable remi-php71
sudo yum install php71-php php-mbstring php-zip php71-php-opcache php71-php-mysql php71-php-pecl-imagick php71-php-intl php71-php-mcrypt php71-php-pdo php-ZendFramework-Db-Adapter-Pdo-Mysql php71-php-pecl-zip php71-php-mbstring php71-php-gd php71-php-xml
sudo cp /etc/php.ini /etc/php.ini.bak
sudo sed -i “s/post_max_size = 8M/post_max_size = 0/” /etc/php.ini
sudo sed -i “s/upload_max_filesize = 2M/upload_max_filesize = 999M/” /etc/php.ini
sudo systemctl restart httpd
sudo cp -R nextcloud /var/www/html/
sudo ps -ef | egrep ‘(httpd|apache2|apache)’ | grep -v `whoami` | grep -v root | head -n1 | groups $(awk ‘{print $1}’)
sudo chown apache:apache -R /var/www/html/nextcloud
cd /etc/httpd/
sudo vim cloud.thefitzfamily.com.conf
sudo reboot
sudo yum install tcpdump
sudo tcpdump ‘port 10876’