Published December 16, 2018 by

Install Redmine in Ubuntu using Shell Script


Redmine is a project management tool that allows users to manage projects flexibly while offering robust tracking tools and an extensive library of plug-ins. This free and open source solution offers an alternative to paid project management tools and includes support for wikis, forums, calendars, and data visualization tools.

This guide will show you how to install and set up Redmine on Ubuntu using a single shell script.


Install Redmine

What this script does:
  1. Install Apache Web server
  2. Install MySQL
  3. Install Redmine
For Install Redmine Create a file named redmine.sh
 sudo vim redmine.sh  

Insert Below script in a redmine.sh file and save.
 #!/bin/bash  
   
 #######################################  
 # Bash script to install a Redmine Project Management Tool in ubuntu  
 # Author: Subhash (serverkaka.com)  
   
 # Check if running as root  
 if [ "$(id -u)" != "0" ]; then  
   echo "This script must be run as root" 1>&2  
   exit 1  
 fi  
   
 # Check port 80 is Free or Not  
 netstat -ln | grep ":80 " 2>&1 > /dev/null  
 if [ $? -eq 1 ]; then  
    echo go ahead  
 else  
    echo Port 80 is allready used  
    exit 1  
 fi  
   
 # Ask value for mysql root password   
 read -p 'db_root_password [secretpasswd]: ' db_root_password  
 echo  
   
 # Update System  
 apt-get update  
   
 # Install Apache and mod-passenger  
 apt-get install apache2 libapache2-mod-passenger -y  
   
 # Install MySQL database server  
 export DEBIAN_FRONTEND="noninteractive"  
 debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"  
 debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"  
 apt-get install mysql-server mysql-client -y  
 unset DEBIAN_FRONTEND  
   
 # Installing and configuring the Ubuntu Redmine package  
 apt-get install redmine redmine-mysql -y  
   
 # Install bundler gem  
 gem update  
 gem install bundler  
   
 # Configuring Apache  
 cd /etc/apache2/mods-available/   
 rm passenger.conf  
 wget https://s3.amazonaws.com/serverkaka-pubic-file/redmine/passenger.conf  
   
 # create a symlink to connect Redmine into the web document space  
 ln -s /usr/share/redmine/public /var/www/html/redmine  
   
 # Configuring Apache  
 cd /etc/apache2/sites-available/  
 rm 000-default.conf  
 wget https://s3.amazonaws.com/serverkaka-pubic-file/redmine/000-default.conf  
   
 # Create and set the ownership of a Gemfile.lock file so that apache's www-data user can access it  
 touch /usr/share/redmine/Gemfile.lock  
 chown www-data:www-data /usr/share/redmine/Gemfile.lock  
   
 # Adjust the Firewall  
 ufw allow 80/tcp  
   
 # Restart Apache  
 service apache2 restart  
   
 # Set auto start tomcat as a system boot  
 sudo systemctl enable apache2  
   
 echo "Redmine is successfully installed. For Access Redmine Go to http://localhost/redmine/  

Give execute permission to redmine.sh file
 sudo chmod +x redmine.sh  

Finally, now run the redmine.sh file
 sudo ./redmine.sh  

After successfully script execute, Go to a browser and hit http://localhost/redmine OR http://ip_address/redmine

For login press sign in button



When it asks for login and password provide default credentials. Your default login is admin and Password is also admin.


Now Redmine is ready to use.

Take Backup of Redmine

Below script is take auto backup for Redmine files and database
 #!/bin/bash  
   
 /usr/bin/mysqldump -u root -p<password> redmine_default | gzip > /path/to/backups/redmine_db_`date +%y_%m_%d`.gz  
 rsync -a /var/lib/redmine/default/files /path/to/backups/files  
Before run backup script, insert proper database password and Backup path.


Reference: https://github.com/SubhashPatel?tab=repositories
Read More
Published December 16, 2018 by

How to Increase EBS Volume Size of AWS EC2 Linux Instance

If we face data limitations in our EC2 instance's volume, we can modify or resize it.

In this tutorial, I will show you how to increase the EBS volume size in AWS using a Linux instance.

First, stop EC2 instance:


You can also perform this step in running instance without stopping it, but if possible to take downtime, then I suggest stopping the instance. 

Select instance>>Actions>>Insatnce State>>Stop

Read More
Published December 15, 2018 by

Install LAMP stack in Ubuntu using Shell Script


Read More
Published December 15, 2018 by

Install and Configure Latest WordPress in CentOS using Shell Script


Read More
Published December 15, 2018 by

Install and Configure Latest WordPress in Ubuntu using Shell Script


WordPress is a powerful, free and open-source, highly pluggable and customizable CMS that is being used by millions around the world to run blogs and fully functional websites.

In this tutorial, we install and configure the latest WordPress using run single shell script on Ubuntu LAMP (Linux, Apache, MySQL and PHP, PhpMyAdmin) stack.

This Script will be working on all Ubuntu versions.

What this script does:

  1. Install Apache Web server
  2. Install PHP
  3. Install MySQL
  4. Install latest Wordpress
  5. Configure Wordpress with Apache
  6. Configure Wordpress with MySql
  7. Install PhpMyAdmin

For Install Wordpress Create a Wordpress.sh file
 sudo vim Wordpress.sh  

Insert Below script in Wordpress.sh file and save. 
 #!/bin/bash  
   
 #######################################  
 # Bash script to install WordPress on ubuntu  
 # Author: Subhash (serverkaka.com)  
   
 ## Check if running as root  
 if [ "$(id -u)" != "0" ]; then  
   echo "This script must be run as root" 1>&2  
   exit 1  
 fi  
   
 ## check Current directory  
 pwd=$(pwd)  
   
 ## Ask value for mysql root password   
 read -p 'wordpress_db_name [wp_db]: ' wordpress_db_name  
 read -p 'db_root_password [only-alphanumeric]: ' db_root_password  
 echo  
   
 ## Update system  
 apt-get update -y  
   
 ## Install Apache  
 sudo apt-get install apache2 apache2-utils -y  
 systemctl start apache2  
 systemctl enable apache2  
   
 ## Install PHP  
 apt-get install php libapache2-mod-php php-mysql -y  
   
 ## Install MySQL database server  
 export DEBIAN_FRONTEND="noninteractive"  
 debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"  
 debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"  
 apt-get install mysql-server mysql-client -y  
   
 ## Install Latest WordPress  
 rm /var/www/html/index.*  
 wget -c http://wordpress.org/latest.tar.gz  
 tar -xzvf latest.tar.gz  
 rsync -av wordpress/* /var/www/html/  
   
 ## Set Permissions  
 chown -R www-data:www-data /var/www/html/  
 chmod -R 755 /var/www/html/  
   
 ## Configure WordPress Database  
 mysql -uroot -p$db_root_password <<QUERY_INPUT  
 CREATE DATABASE $wordpress_db_name;  
 GRANT ALL PRIVILEGES ON $wordpress_db_name.* TO 'root'@'localhost' IDENTIFIED BY '$db_root_password';  
 FLUSH PRIVILEGES;  
 EXIT  
 QUERY_INPUT  
   
 ## Add Database Credentias in wordpress  
 cd /var/www/html/  
 sudo mv wp-config-sample.php wp-config.php  
 perl -pi -e "s/database_name_here/$wordpress_db_name/g" wp-config.php  
 perl -pi -e "s/username_here/root/g" wp-config.php  
 perl -pi -e "s/password_here/$db_root_password/g" wp-config.php  
   
 ## Enabling Mod Rewrite  
 a2enmod rewrite  
 php5enmod mcrypt  
   
 ## Install PhpMyAdmin  
 apt-get install phpmyadmin -y  
   
 ## Configure PhpMyAdmin  
 echo 'Include /etc/phpmyadmin/apache.conf' >> /etc/apache2/apache2.conf  
   
 ## Restart Apache and Mysql  
 service apache2 restart  
 service mysql restart  
   
 ## Cleaning Download  
 cd $pwd  
 rm -rf latest.tar.gz wordpress  
   
 echo "Installation is complete."  

Give execute permission to Wordpress.sh file
 sudo chmod +x Wordpress.sh  

Finally, now run Wordpress.sh file
 sudo ./Wordpress.sh  

After successfully script execute, Go to a browser and hit http://localhost/



Read More
Published December 14, 2018 by

How to Reduce EBS volume size of AWS EC2 Linux Instance

In this tutorial, I will show you how to reduce EBS volume size in AWS using an Ubuntu Linux instance. In this example, I have 25GB root volume and try to decrease it to 8GB.

1. Login to AWS management consoles and stop the instance.
Read More