Skip to content

Instantly share code, notes, and snippets.

@prasanjit-
Last active April 4, 2021 16:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save prasanjit-/0033e4596aabff5101033c9762c5caa4 to your computer and use it in GitHub Desktop.
Save prasanjit-/0033e4596aabff5101033c9762c5caa4 to your computer and use it in GitHub Desktop.
Install Vtiger 7.1 on CentOS7
#!/bin/bash
#....................................................................#
# Script: Installs LAMP, PhpMyadmin & Vtiger 7.1 on a fresh CentOS-7
# Author: Prasanjit Singh
#....................................................................#
# INSTALL LAMP
cd /tmp/
yum install wget vim telnet systemd -y
yum -y update
yum -y install httpd
systemctl start httpd
systemctl enable httpd
cp -p /etc/httpd/conf/httpd.conf /tmp/
#EPEL repository installation:
yum -y install epel-release ; yum -y update ; yum clean all
#Webtatic repository installation:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#Installation of php and its modules:
yum -y install php56w php56w-mysql php56w-imap php56w-curl php56w-xml php56w-zlib php56w-gd php56w-mbstring
#Php.ini configuration:
wget https://github.com/prasanjit-/warehouse/blob/master/c7.php.ini
yes | mv c7.php.ini /etc/php.ini ; systemctl restart httpd
wget https://github.com/prasanjit-/warehouse/blob/master/selinux
mv selinux /etc/sysconfig/selinux
setenforce 0
# Configure and restart Apache
sed -i "/^<Directory \"\/var\/www\/html\">/,/^<\/Directory>/{s/AllowOverride None/AllowOverride All/g}" /etc/httpd/conf/httpd.conf
systemctl enable httpd.service
systemctl start httpd.service
systemctl restart httpd
#Download VTIGER 7.1.0 & PHPMYADMIN
rm -rf vtigercrm-7.1-patched
yum install git -y ; git clone https://github.com/prasanjit-/vtigercrm-7.1-patched.git
wget "https://files.phpmyadmin.net/phpMyAdmin/4.0.0/phpMyAdmin-4.0.0-english.tar.gz"
#Extract PMA
tar xvf phpMyAdmin-4.0.0-english.tar.gz
rm -f phpMyAdmin-4.0.0-english.tar.gz
#Move files to root web location
echo "Smile :)" >> /var/www/html/index.html
mv phpMyAdmin* /var/www/html/pma
mv vtigercrm-7.1-patched /var/www/html/vtigercrm
chown -R apache:apache /var/www/html
cd /var/www/html/vtigercrm
chmod -R 777 cache includes include cron data logs storage test
#Install the Mariadb server:
yum -y install mariadb mariadb-server
#Start the Mariadb server
systemctl start mariadb
systemctl enable mariadb
# Add the database
echo 'CREATE DATABASE vtigercrm;' | mysql
echo "GRANT ALL PRIVILEGES ON vtigercrm.* TO 'vtigercrm'@'localhost' IDENTIFIED BY 'DBpA55W0rd';" | mysql
echo "FLUSH PRIVILEGES;" | mysql
echo "use vtigercrm; ALTER DATABASE vtigercrm CHARACTER SET utf8 COLLATE utf8_general_ci;" | mysql
#Secure installation of mysql:
mysql_secure_installation
echo "Components installed. Run the web installer from your browser now! http://Server-IP/vtigercrm"
echo "You Server-IP is:"
curl icanhazip.com
echo "Phpmyadmin url is http://Server-IP/pma"
echo "DB user is vtigercrm & password is DBpA55W0rd"
echo "Default admin password is pA55W0rd if installed via pre-populated database.sql from https://github.com/prasanjit-/vtigercrm-7.1-patched.git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment