Last active
December 18, 2015 22:57
-
-
Save admataz/69116980cf3fad0feea5 to your computer and use it in GitHub Desktop.
Setting up Vagrant dev server for LAMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "start provisioning with the shell script" | |
| sudo yum update | |
| echo "ran yum update" | |
| sudo yum install httpd -y | |
| sudo systemctl enable httpd.service | |
| echo "installed httpd" | |
| sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm -y | |
| sudo yum install mysql-server -y | |
| sudo systemctl enable mysqld.service | |
| echo "installed mysql" | |
| sudo yum install php php-mysql -y | |
| sudo systemctl restart httpd.service | |
| sudo yum install php-cli php-gd php-pear php-xml -y | |
| echo "installed php" | |
| sudo yum install gcc gcc-c++ autoconf automake -y | |
| sudo yum install php-devel -y | |
| sudo pecl install xdebug -y | |
| echo "installed build tools and xdebug - will need configuring in php.ini with the following:" | |
| echo "[xdebug]" | |
| echo "zend_extension=\"/usr/lib64/php/modules/xdebug.so\"" | |
| echo "xdebug.remote_connect_back=1" | |
| echo "xdebug.remote_enable=1" | |
| echo "xdebug.remote_port=9000" | |
| echo "xdebug.remote_handler=dbgpecho" | |
| echo "xdebug.remote_log=\"/tmp/xdebug.log\"" | |
| sudo systemctl restart httpd.service | |
| echo "restarted apache" | |
| pear channel-discover pear.drush.org -y | |
| sudo pear channel-discover pear.drush.org -y | |
| sudo pear install drush/drush -y | |
| echo "installed drush" | |
| sudo yum -y install sqlite-devel ruby-devel | |
| sudo gem install mailcatcher | |
| echo "installed ruby and mailcatcher - will need configuring for php sendmail and starting as a service" | |
| echo "start mailcatcher with \"mailcatcher --ip 0.0.0.0\" - specifying the actual ip causes issues " | |
| echo "Have installed the basic setup for this server" | |
| echo "Further manual configurations possible:" | |
| echo "TODO: customise /etc/httpd/conf/httpd.conf" | |
| echo "TODO: any further php.ini customisations" | |
| echo "TODO: install phpunit" | |
| echo "TODO: get mailcatcher to start at boot" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "start provisioning with the shell script" | |
| sudo apt-get update | |
| echo "ran apt-get update" | |
| sudo debconf-set-selections <<< 'mysql-server \ | |
| mysql-server/root_password password root' | |
| sudo debconf-set-selections <<< 'mysql-server \ | |
| mysql-server/root_password_again password root' | |
| sudo apt-get install -y php5-mysql mysql-server | |
| echo "installed mysql, set root password to 'root" | |
| sudo apt-get install -y apache2 | |
| sudo apt-get install -y php5 libapache2-mod-php5 php5-mcrypt php5-cli php5-gd php5-curl | |
| sudo apt-get install -y php5-xdebug | |
| sudo a2enmod rewrite | |
| # TODO: any php.ini customisations | |
| # TODO: allowoverride all for apache config | |
| # TODO: enable xdebug | |
| # TODO: install phpunit | |
| echo "installed apache and php" | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
| # echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
| # sudo apt-get update | |
| # sudo apt-get install -y mongodb-org | |
| # sudo apt-get install -y php5-mongo | |
| # echo "installed mongo and php mongo" | |
| sudo apt-get install -y drush | |
| echo "installed drush" | |
| sudo service mysql restart | |
| sudo service apache2 restart | |
| echo "Have installed the basic setup for this server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| config.vm.network "private_network", ip: "192.168.33.33" | |
| config.vm.network :forwarded_port, guest: 22, host: 2223, id: 'ssh' | |
| config.vm.provision "shell", path: "./vagrant_setup.sh" | |
| config.vm.synced_folder "./webroot", "/var/www/html", type: "nfs" | |
| config.vm.provider "virtualbox" do |vb| | |
| vb.memory = "2048" | |
| vb.name = "Virtual Dev Server" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment