Advertisement
Guest User

Untitled

a guest
Oct 8th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.23 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. # All Vagrant configuration is done below. The "2" in Vagrant.configure
  5. # configures the configuration version (we support older styles for
  6. # backwards compatibility). Please don't change it unless you know what
  7. # you're doing.
  8. Vagrant.configure("2") do |config|
  9.   # The most common configuration options are documented and commented below.
  10.   # For a complete reference, please see the online documentation at
  11.   # https://docs.vagrantup.com.
  12.  
  13.   # Every Vagrant development environment requires a box. You can search for
  14.   # boxes at https://vagrantcloud.com/search.
  15.   config.vm.box = "bento/centos-7.4"
  16.   config.vm.hostname = "centos7"
  17.  
  18.   # Disable automatic box update checking. If you disable this, then
  19.   # boxes will only be checked for updates when the user runs
  20.   # `vagrant box outdated`. This is not recommended.
  21.   # config.vm.box_check_update = false
  22.  
  23.   # Create a forwarded port mapping which allows access to a specific port
  24.   # within the machine from a port on the host machine. In the example below,
  25.   # accessing "localhost:8080" will access port 80 on the guest machine.
  26.   # NOTE: This will enable public access to the opened port
  27.   # config.vm.network "forwarded_port", guest: 80, host: 8080
  28.  
  29.   # Create a forwarded port mapping which allows access to a specific port
  30.   # within the machine from a port on the host machine and only allow access
  31.   # via 127.0.0.1 to disable public access
  32.   # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  33.  
  34.   # Create a private network, which allows host-only access to the machine
  35.   # using a specific IP.
  36.    config.vm.network "private_network", ip: "192.168.39.11"
  37.  
  38.   # Create a public network, which generally matched to bridged network.
  39.   # Bridged networks make the machine appear as another physical device on
  40.   # your network.
  41.   # config.vm.network "public_network"
  42.  
  43.   # Share an additional folder to the guest VM. The first argument is
  44.   # the path on the host to the actual folder. The second argument is
  45.   # the path on the guest to mount the folder. And the optional third
  46.   # argument is a set of non-required options.
  47.   # config.vm.synced_folder "../data", "/vagrant_data"
  48.     config.vm.synced_folder "html", "/var/www/magento2.com/html"
  49.  
  50.   # Provider-specific configuration so you can fine-tune various
  51.   # backing providers for Vagrant. These expose provider-specific options.
  52.   # Example for VirtualBox:
  53.   #
  54.    config.vm.provider "virtualbox" do |vb|
  55.     vb.name = "Magento2"
  56.     vb.memory = "2048"
  57.     vb.cpus = 2
  58.    end
  59.   #
  60.   # View the documentation for the provider you are using for more
  61.   # information on available options.
  62.  
  63.   # Enable provisioning with a shell script. Additional provisioners such as
  64.   # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  65.   # documentation for more information about their specific syntax and use.
  66.     config.vm.provision "shell", inline: <<-SHELL
  67.       yum update
  68.       yum upgrade -y
  69.       yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  70.       yum install -y yum-utils
  71.       yum install -y nano
  72.       yum install -y git
  73.       yum install -y wget
  74.       yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  75.       yum-config-manager --enable remi-php72
  76.       yum -y install php php-pdo php-mysqlnd php-opcache php-zip php-xml php-gd php-devel php-mysql php-intl php-mbstring php-bcmath php-json php-iconv php-soap
  77.       wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
  78.       yum localinstall -y mysql57-community-release-el7-11.noarch.rpm
  79.       yum update -y
  80.       yum-config-manager --enable mysql57-community
  81.       yum install mysql-community-server -y
  82.       wget https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64
  83.       wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
  84.       sudo chmod +x mhsendmail_linux_amd64
  85.       sudo chmod +x MailHog_linux_amd64
  86.       sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
  87.       sudo cp mhsendmail_linux_amd64 /usr/local/bin/mhsendmail
  88.       sudo tee /etc/systemd/system/mailhog.service <<EOL
  89. [Unit]
  90. Description=Mailhog
  91. After=network.target vagrant.mount
  92. [Service]
  93. ExecStart=/usr/bin/env /usr/local/bin/mailhog > /dev/null 2>&1 &
  94. [Install]
  95. WantedBy=multi-user.target
  96. EOL
  97.       sudo service mailhog start  
  98.       service mysqld start
  99.       sudo chkconfig mailhog on
  100.       sudo chkconfig httpd on
  101.         sudo chkconfig mysqld on
  102.       egrep "temporary password" /var/log/mysqld.log
  103.       service httpd restart
  104.       sudo sed -i 's/memory_limit = 128M/memory_limit = 2G/g' /etc/php.ini
  105.       sudo sed -i 's/sendmail_path = /usr/sbin/sendmail -t -i/sendmail_path = /usr/local/bin/mhsendmail/g' /etc/php.ini
  106.       sudo sed -i 's/memory_limit = 128M/memory_limit = 2G/g' /etc/php.ini
  107.       sudo sed -i 's/max_input_time = 60/max_input_time = 1800/g' /etc/php.ini
  108.       sudo sed -i 's/max_execution_time = 30/max_execution_time = 1800/g' /etc/php.ini
  109.       service mailhog restart
  110.       service mysqld restart
  111.       service httpd restart
  112.     SHELL
  113.     #mysql user root pass root
  114.     #mysql user vagrant pass vagrant
  115.     #mysql database magento2
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement