zepgram / magento2-fast-vm

Optimal vagrant developer box for Magento2. Folders synced by nfs/rsync. This box includes Magento developer utilities.
MIT License
110 stars 35 forks source link

Magento nginx docroot location #49

Closed Vikwip closed 4 years ago

Vikwip commented 4 years ago

Hello zepgram,

I don't understand how the nginx docroot is configured on my machine. When I type the name of my server or ip address in the browser I just have the Nginx homepage displayed for now. If I search in the browser for exisiting sub-folders in my home magento directory I get 404 errors.

How do I make it link to the cd directory /home/vagrant/magento/?

Thanks!

zepgram commented 4 years ago

If you have only the nginx page, it's because Magento directory mount failed. If you installed Magento through rsync, it's very important to wait the rsync back to be done. Or run the command right after the installation to send back your files from guest to host machine.

Le lun. 27 janv. 2020 à 16:27, Viktor notifications@github.com a écrit :

Hello zepgram,

I don't understand how the nginx docroot is configured on my machine. When I type the name of my server or ip address in the browser I just have the Nginx homepage displayed for now. If I search in the browser for exisiting sub-folders in my home magento directory I get 404 errors.

How do I make it link to the cd directory /home/vagrant/magento/?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zepgram/magento2-fast-vm/issues/49?email_source=notifications&email_token=AD4BLLVWY3GJACAITALNX53Q734MRA5CNFSM4KMDF4S2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4II6RJFA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4BLLXXM44QPD7OQFMGTJDQ734MRANCNFSM4KMDF4SQ .

Vikwip commented 4 years ago

Okay, thanks for your answer. I actually installed Magento through default mount, but it didn't work because of the composer error.

I'm trying to install it manually now.

In this case do I need at worst to reinstall my virtual machine, or else just run a vagrant rsync-back command, or eventually trying to modify nginx.conf file?

zepgram commented 4 years ago

The process to get it work correctly would be:

  1. set config mount to "rsync" (this way you should avoid the manual composer install)
  2. wait for the rsync-back to be done completely
  3. stop your machine with vagrant halt
  4. set config mount to "default" then restart vagrant with vagrant up

Check your repository /home/vagrant/magento with vagrant ssh if it's again empty, tell me and we'll find an other process.

nginx conf is fine: your repository /home/vagrant/magento is symlinked to /var/www/magento, if you just have the nginx page it's because the mount failed.

zepgram commented 4 years ago

Note: rsync-back is only required when mount option is "rsync" and when you generate files from guest machine.

Vikwip commented 4 years ago

Hi zepgram,

In fact my /home/vagrant/magento directory is not empty.

There was actually already a directory that I cloned from github.

By the way, when I start the machine with rsync mount nothing happens on the first window, even after 10 minutes. Is that normal?:

==> zepgram: >>> Do not close this terminal: open new one for ssh login ==> zepgram: --------------------------------------------------------- ==> zepgram: rsync-back and rsync auto triggered... ==> zepgram: Duration: ~10min. Install is done when rsync-auto will start watching. zepgram: Running local: Inline script zepgram: vagrant rsync-back zepgram | vagrant rsync-auto --rsync-chown zepgram zepgram: ==> zepgram: Doing an initial rsync... zepgram: ==> zepgram: Rsyncing folder: /cygdrive/c/Users/user/magento2-fast-vm/www/magento/ => /home/vagrant/magento zepgram: ==> zepgram: - Exclude: [".vagrant/", "generated/code/*", "var/page_cache/*", "var/view_preprocessed/*", "pub/static/adminhtml/*", "pub/static/base/*", "pub/static/frontend/*", "dev", "node_modules", "phpserver", "setup", "update"] zepgram: ==> zepgram: Watching: C:/Users/user/magento2-fast-vm/www/magento

zepgram commented 4 years ago

If you use rsync mount the process for transferring files between host and guest is not conventional. First rsync is single directional, and transfer are made from host to guest with rsync-auto. The rsync-auto is launched automatically on vagrant up: this will allow a watcher to do continuous files transfers. The terminal must be kept open in order to transfer files correctly. If you modify any file from your most machine, you'll see a new line on your terminal indicating that files have been transferred.

Then if you do any change under the guest machine (composer install for exemple) you must run rsync-back to get your files on host machine. If you don't, on next startup, files will be erased by host machine. So if your directory /www/magento/vendor is empty on host machine, the directory /home/vagrant/magento/vendor on guest will be empty on next vagrant up.

Vikwip commented 4 years ago

Hi zepagram, Thanks again for your advices and your explanations. I finally created an additional virtualhost in my nginx configuration file. Then I linked it to my magento installation folder.