From 43f6db942c045c1f7db8182bf4567e772895580f Mon Sep 17 00:00:00 2001 From: Axel DE VIGNON Date: Wed, 27 Sep 2017 15:29:48 +0200 Subject: [PATCH] =?UTF-8?q?[WIP]=C2=A0Readme=20in=20english?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d109d06..9f488a4 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ You must understand that the VM is meant to be disposable, it is not supposed to As a consequence, you may mess up with the VM, do heavy testing, install new apps to evaluate them and even crash it. If you need to rollback, just destroy it and recreate it as pure as the driven snow. It is as simple as a `vagrant destroy && vagrant up`. +Also this starter kit was tested and used on a Apple computer. It supposed on any system but this is **untested**. +Let me know if you encounter any issue. ## Content of the starter kit @@ -78,18 +80,18 @@ As a consequence, you may mess up with the VM, do heavy testing, install new app - Download and install VirtualBox (http://www.virtualbox.org/) - Download and install Vagrant (https://www.vagrantup.com/) -- Clone the latest version of this repository (https://github.com/axeloz/vagrant-lamp) into your Home directory, whereever you want it to be. For example for Mac: `/Users/my-user/Sites/vagrant-lamp` -- Open your terminal app, `cd` to the vagrant directory -- Run a `vagrant up` command. For the first run, Vagrant will download the Linux Ubuntu 16.04 image from VagrantUp, create a new VirtualBox VM, boot the VM and run the Chef recipes. This will install all the dependencies, it may take some time. +- Clone the latest version of this repository (https://github.com/axeloz/vagrant-lamp) into your Home directory, wherever you want it to be. For example for Mac: `/Users/my-user/Sites/vagrant-lamp` +- Open your terminal app, `cd` to the `vagrant-lamp` directory +- Run a `vagrant up` command. During the first boot, Vagrant will download the Linux Ubuntu 16.04 box from VagrantUp, create a new VirtualBox VM, boot the VM and run the Chef recipes. This will install all the dependencies, it may take some time. - Optionally, you can install Vagrant Manager (http://vagrantmanager.com/) which is a GUI to manage your Vagrant VMs. -### ⚠ Attention ⚠ +### ⚠ Attention for Mac and Unix systems ⚠ -**For Mac and Unix systems** -When starting the VM, Vagrant will create a mount point between the VM and the host computer. On the VM, the mount point is made on `/vagrant`. -Mounting is done using NFS for security and performance purposes. **Vagrant will require your host computer password** in order mount the folder. I **do not** ask for this password and I **do not** have access to this password. This password is asked by your computer in order to run a command as `sudoer`. +When starting the VM, Vagrant will create a mount point between the VM and the host computer. On the VM, the mount point is made on `/vagrant` and will contain the entire `vagrant-lamp` folder. -If you want to avoid typing your password each time you start your VM, you can edit the `sudoers` file and allow permanently Vagrant to mount NFS folders without password. In your terminal application on your host computer, edit the `/etc/sudoers` file with `sudo`. Then paste the following lines at the end of the file: +Mounting is done using NFS for security and performance purposes. **Vagrant will require your host computer password** in order mount the folder. I **do not** ask for this password myself and I **do not** have access to this password. This password is asked by your computer in order to run a command as `sudo`. + +If you want to avoid typing your password each time you start your VM, you can edit the `sudoers` file and allow Vagrant to mount NFS folders without requiring any password. In your terminal application on your host computer, edit the `/etc/sudoers` file with `sudo`. Then paste the following lines at the end of the file: ``` Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports @@ -98,7 +100,7 @@ Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE ``` -You might have to logout and login back on your computer to apply these changes. Then next time you boot your VM, it should mount the NFS directly, no password asked. +You might have to logout and login back to your computer to apply these changes. Then next time you boot your VM, it should mount the NFS directly, no password asked. ## Upgrade @@ -108,7 +110,7 @@ In order to upgrade, just: ## Accessing the tools -- To SSH into the VM, run the `vagrant ssh` command from the root of the vagrant-lamp folder. The login is `vagrant` and the password is `vagrant` +- To SSH into the VM, run the `vagrant ssh` command from the root of the `vagrant-lamp` folder. The login is `vagrant` and the password is `vagrant` - To sudo in the VM, just run `sudo `. The `vagrant` user belongs to the sudoers and you may `sudo` with no password asked - The IP address `192.168.99.100` is created by VM - The VM is also available on hostname `localhost` @@ -141,14 +143,16 @@ Your local environment is available from your host computer at the address: http - show the PHP configuration - show the server informations +The default document root is: `/vagrant/www` + #### Dedicated Apache virtual host -In some cases, you might need to create a dedicated virtual host to access your project. For example: http://myproject.local:8080. +In some cases, you might need to create a dedicated virtual host to access your projects. For example: http://myproject.local:8080. -For Mac and Unix systems: in order to do so, a script `create-vhost.sh` is provided to the root of the repository. Make sure it is executable (`chmod +x create-vhost.sh`) and run it (`./create-vhost.sh`). Just follow the instructions, the script will then create an entry into the `/etc/hosts` file and will add the virtual host to Apache into the `vagrant-lamp/apache/conf` folder. Finally it will reload Apache. +For Mac and Unix systems: in order to do so, the script [create-vhost.sh](https://github.com/axeloz/vagrant-lamp/blob/master/create-vhost.sh) is provided. Make sure it is executable (`chmod +x create-vhost.sh`) and run it from the **host** (`./create-vhost.sh`). Just follow the instructions, the script will then create an entry into the `/etc/hosts` file and will add the virtual host to Apache into the `vagrant-lamp/apache/conf` folder. Finally it will reload Apache. -In any case: you may also do it manually by creating the Apache virtual host configuration file into the `vagrant-lamp/apache/conf`. Attention: the file must be named with a `.conf` suffix. -You must also add manually an entry into the `hosts` file. +In any case: you can also do it manually by creating the Apache virtual host configuration file into the `vagrant-lamp/apache/conf`. Attention: the file must be named with a `.conf` suffix. +You must also add manually an entry into the computer's `hosts` file. Finally you must reload Apache on the VM machine using `service apache2 reload`. #### Mailcatcher test form @@ -164,7 +168,7 @@ The Apache log files are located into the `vagrant-lamp/apache/logs` folder. #### Access MariaDB is running on port 3306 on the VM. -There is a port redirection from the host to the VM: 3307 -> 3306. +There is a port redirection from the host to the VM: host:3307 -> vm:3306. The root user for MariaDB is: - login: vagrant @@ -180,13 +184,13 @@ The MariaDB log files are located into the `vagrant-lamp/mysql/logs` ### Gulp -Please check the chapter "File changes watcher". +Please refer to the chapter [File changes watcher](#file-changes-watcher)". ## Questions / Know issues -### Issues on boot +### Issues at boot time -You may encounter some issues at boot time. I'm still not sure why as it works on my Mac but I have seen it fail occasionnally on other computers. +You may encounter some issues at boot time. I'm still unsure why as it works on my Mac but I have seen it fail occasionnally on other computers. - issue with APT: there seem to be a conflict when the Ubuntu box starts automatically an `apt-get upgrade` command after boot. It prevents the Chef recipe to also call the `apt` command as there can be only one upgrade process at a time. I tried to disable the automatic upgrade on the box. Let me know if this occurs. - issue with MariaDB: for some reasons, the permissions on the `/var/run/mysqld` folder are incorrect despite I fix them during the recipes. As a consequence, MariaDB refuses to boot. To fix manually, SSH to the VM, run a `chown -R vagrant:vagrant /var/run/mysqld` command and try restarting MariaDB. Let me know if this occurs to you or if you know how to fix this once for all.