Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UFW to install script #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion itflow_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install_packages() {
apt-get install -y apache2 mariadb-server \
php libapache2-mod-php php-intl php-mysqli \
php-curl php-imap php-mailparse libapache2-mod-md \
certbot python3-certbot-apache git sudo
certbot python3-certbot-apache git sudo ufw

mariadb_secure_installation

Expand All @@ -59,6 +59,13 @@ modify_php_ini() {
sed -i 's/^;\?post_max_size =.*/post_max_size = 500M/' $PHP_INI_PATH
}

setup_ufw() {
ufw allow https
ufw allow http
ufw allow ssh
ufw enable
}

setup_webroot() {
mkdir -p /var/www/${domain}
chown -R www-data:www-data /var/www/
Expand Down Expand Up @@ -124,6 +131,8 @@ echo "#############################################"
echo ""
echo "Please follow the prompts to complete the installation."
echo ""
echo "Please note, UFW will be setup during the installation, restricting access to HTTP, HTTPS, and SSH."
echo ""

# Execution begins here
check_root
Expand All @@ -137,6 +146,9 @@ install_packages
echo -e "\n${GREEN}Step 3: Modifying PHP configurations...${NC}"
modify_php_ini

echo -e "\n${GREEN}Step 4. Setting up ufw"
setup_ufw

echo -e "\n${GREEN}Step 4: Setting up webroot...${NC}"
setup_webroot

Expand Down