Creating Test Environment for Laravel using Fedora 21


Dec 25, 2016    Janaki Mahapatra, Laravel

For this environment we will use vagrant to import boxcutter/fedora21 box . Here are the steps
  1. Install vagrant if you have not installed yet. You can download it from https://www.vagrantup.com/downloads.html
  2. Now we will import a virtual box from https://atlas.hashicorp.com
  3. Go to any drive in your computer where we will import that box and open command prompt.
  4. Type the command as shown in below image, if you are using virtual box then use provider=virtialbox(first image) otherwise use provider=parallels (second image) how to create a test env using vagrant and fedora
  5. It will create a Vagrantfile. Open and update the code as I mentioned here [code lang="ini"] Vagrant.configure(2) do |config| config.vm.box = "boxcutter/fedora21" config.vm.network "forwarded_port", guest: 80, host: 8000 config.vm.network "forwarded_port", guest: 10000, host: 10000 config.vm.synced_folder "D:\\Applications\\Projects\\test", "/home/vagrant/public_html/test" config.vm.synced_folder "D:\\Applications\\Projects\\errorLogs", "/home/vagrant/public_html/logs" config.vm.provider "virtualbox" do |v| v.name = "laravag_vm" v.memory = "2048" end config.vm.provision "shell", inline: <<-SHELL sudo yum install httpd -y sudo systemctl start httpd.service sudo systemctl eneable httpd.service sudo yum install nano -y sudo yum install wget -y cd /home/vagrant mkdir public_html sudo wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm sudo wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm sudo rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm sudo yum --enablerepo=remi,remi-php56 sudo sudo yum install php php-gd php-mysql php-mcrypt php-mbstring php-xml php-cli php-pear php-pdo php-mysqlnd php-sqlite -y sudo systemctl restart httpd.service 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 sudo setsebool -P httpd_enable_homedirs 1 # if SElinux enabled sudo chown -R vagrant:apache public_html cd /home/vagrant 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 sudo systemctl enable httpd.service SHELL end
  6. Save it and in command prompt type
    vagrant provision
    it will take a little bit time to install everything for you including virtualmin for easy access to the dev server.
  7. Once done, open a browser and browse http://localhost:8000
That's it, you have successfully configured your dev environment. Click here to see how to create your first virtual host.