| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/installer/ |
Upload File : |
#!/bin/bash
if [ -f "include/startup.sh" ]; then
. include/startup.sh
chmod -R u+x *
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
chmod -R u+x ../*
<<<<<<< HEAD
fi
install_apache() {
echo "Installing apache2..." | log
apt update && apt install -y apache2
=======
fi
export DEBIAN_FRONTEND=noninteractive
install_apache() {
echo "Installing apache2..." | log
apt update
apt install -y apache2
>>>>>>> origin/master
echo "Installing passenger module for apache2..." | log
apt install -y libapache2-mod-passenger
}
idxHTMLPath="/var/www/html"
if [ ! -d "$idxHTMLPath" ]; then
mkdir -p "$idxHTMLPath"
fi
if [ -f "$idxHTMLPath/index.html" ]; then
rm -f "$idxHTMLPath/index.html"
fi
confPath="/etc/apache2/sites-available"
if [ ! -d "$confPath" ]; then
mkdir -p "$confPath"
fi
# Define variables
update_status="include/updateInstallStatus.sh"
web_path="/var/www/html"
img_root="include/Logos"
logo_img_name="Redmine_logo.png"
icon_img_name="Redmine_icon.png"
img_root_path="$img_root/$logo_img_name"
icon_img_root_path="$img_root/$icon_img_name"
html_path="/var/www/html/index.html"
local_html_path="include/index.html"
<<<<<<< HEAD
=======
echo "Installing apache..." | log
>>>>>>> origin/master
install_apache
if [ ! -d "$web_path" ]; then
mkdir -p "$web_path"
fi
echo "Writing apache configuration file..." | log
cat <<_EOF_ > /etc/apache2/sites-available/installProgress.conf
<VirtualHost *:80>
ServerName _
DocumentRoot $idxHTMLPath
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName _
DocumentRoot $idxHTMLPath
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
</VirtualHost>
_EOF_
echo "Copying HTML related files..."
cp -r "$local_html_path" "$html_path"
cp -r "$img_root_path" "$web_path/$logo_img_name"
cp -r "$icon_img_root_path" "$web_path/$icon_img_name"
chmod 644 "$web_path/$logo_img_name"
chmod 644 "$web_path/$icon_img_name"
<<<<<<< HEAD
a2enmod ssl
a2ensite installProgress
a2dissite 000-default
systemctl start apache2
"$update_status" "$html_path" -uf "$icon_img_name"
"$update_status" "$html_path" -ut "Redmine 5.1.1 Installation"
"$update_status" "$html_path" -ui "$logo_img_name"
"$update_status" "$html_path" -uh "Redmine 5.1.1 Installation"
"$update_status" "$html_path" -ap "Initiating setup..."
=======
echo "Starting apache2 service..." | log
systemctl start apache2
echo "Enabling apache2 SSL..." | log
a2enmod ssl
echo "Enabling installProgress apache2 site..." | log
a2ensite installProgress
echo "Disablind default apache2 site..." | log
a2dissite 000-default
echo "Enabling apache2 service..." | log
systemctl enable apache2
echo "Updating installer content..." | log
"$update_status" "$html_path" -uf "$icon_img_name"
"$update_status" "$html_path" -ut "Redmine 5.1.3 Installation"
"$update_status" "$html_path" -ui "$logo_img_name"
"$update_status" "$html_path" -uh "Redmine 5.1.3 Installation"
>>>>>>> origin/master
tag httpd.success
tag apache2.success
tagScript success
# Define execute list
declare -a steps=(
"include/installInProgressSSH"
"tweaks/ubuntu-ufw-enable"
"tweaks/ubuntu-ufw-allowmysql"
"tweaks/ubuntu-ufw-allowhttp"
"tweaks/ubuntu-updateos-noupgrade"
<<<<<<< HEAD
"tweaks/apache-enable-ssl-light"
"services/mysqlserver-8.0-osrepo"
"services/ruby-latest-offirepo-ruby-dev"
"apps/redmine-5.1.1-offisrc-apache-rails-mysql-8.0"
"tweaks/cwm-description-autoconfig"
"installInProgressSSH-remove"
=======
"tweaks/apache-enable-ssl-cloudRon"
"services/mysqlserver-8.0-osrepo"
"services/ruby-latest-offirepo-ruby-dev"
"apps/redmine-5.1.1-offisrc"
"tweaks/cwm-description-autoconfig"
>>>>>>> origin/master
)
for run in "${steps[@]}"; do
printf "Executing %s\n" "$run" | log
# Update HTML status based on the task
case "$run" in
"services/mysqlserver-8.0-osrepo")
"$update_status" "$html_path" -rp "Install dependencies..............[SUCCESS]\nInstall MySQL server 8.0..."
;;
"services/ruby-latest-offirepo-ruby-dev")
"$update_status" "$html_path" -rp "Install dependencies..............[SUCCESS]\nInstall MySQL server 8.0...................[SUCCESS]\nInstalling Ruby 3.2.3..."
;;
"apps/redmine-5.1.1-offisrc-apache-rails-mysql-8.0")
<<<<<<< HEAD
"$update_status" "$html_path" -rp "Install dependencies..............[SUCCESS]\nInstall MySQL server 8.0...................[SUCCESS]\nInstall Ruby 3.2.3..............[SUCCESS]\nInstalling Redmine 5.1.1..."
=======
"$update_status" "$html_path" -rp "Install dependencies..............[SUCCESS]\nInstall MySQL server 8.0...................[SUCCESS]\nInstall Ruby 3.2.3..............[SUCCESS]\nInstalling Redmine 5.1.3..."
>>>>>>> origin/master
;;
esac
if ! $run; then
local script_exit_code=$?
printf "Exit Code: %d\n" "$script_exit_code" | log
case "$script_exit_code" in
0) printf "Done. (0)\n" | log ;;
1) printf "Error during %s. Exiting.\n" "$run" | log
return 1
;;
98) printf "Exit Code 98. Script already executed, can run only once. Continuing. (98)\n" | log ;;
99) printf "Exit Code 99. Continuing. (99)\n" | log ;;
127) printf "Error. %s not found. Exiting. (127)\n" "$run" | log
return 1
;;
*) printf "Exit Code not configured. Exiting. (%d)\n" "$script_exit_code" | log
return 1
;;
esac
fi
<<<<<<< HEAD
=======
# if [[ "$run" == "apps/redmine-5.1.1-offisrc-apache-rails-mysql-8.0" ]]; then
# return 0
# fi
>>>>>>> origin/master
done