CentOs Vagrant Configuration file

[code lang=”ini”]
# -*- mode: ruby -*-
Vagrant.configure(“2”) do |config|
config.vm.box = “centos/7”
config.vm.box_check_update = true

# Any Port you want to forward
config.vm.network “forwarded_port”, guest: 80, host: 8000
config.vm.network “forwarded_port”, guest: 3306, host: 3307

# Folder Mappings
# config.vm.synced_folder “../data”, “/vagrant_data”
config.vm.synced_folder “/Users/janaki/MyApplications/Research”, “/home/vagrant/public_html/apps”

#Custom VM Settings
config.vm.provider “virtualbox” do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = “3072”
end
#
#Shell Install
config.vm.provision “shell”, inline: <<-SHELL # Install Apache Server sudo yum install httpd -y sudo systemctl start httpd.service sudo systemctl enable httpd.service # Install common tools sudo yum install nano -y sudo yum install wget -y sudo yum install net-tools -y cd /home/vagrant mkdir public_html # Install PHP sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm sudo yum install php70w php70w-cli php70w-opcache # Install Webmin for GUI cd /opt sudo wget http://www.webmin.com/jcameron-key.asc sudo wget http://www.webmin.com/download/rpm/webmin-current.rpm sudo yum -y install perl perl-Net-SSLeay openssl perl-IO-Ttysu sudo rpm --import jcameron-key.asc sudo rpm -Uvh webmin-*.rpm # Configure home folder for apache sudo setsebool -P httpd_enable_homedirs 1 sudo chown -R vagrant:apache public_html sudo chmod -R 775 /home/vagrant/public_html sudo chmod -R a+rX /home/vagrant/public_html sudo chmod a+rx ~ sudo systemctl restart httpd.service SHELL end 0

About the author

Janaki(http://mjanaki.com) - A Software developer with 9+ years of experience in multiple technology projects across web, mobile, and cloud applications with expertise in PHP, C#, MySQL, Web services and open source platforms.

Similar Posts

Comments are closed.