marvin

OK, further to this, I’ve been reading; I see there are four levels of Networking: ‘Basic Usage’, ‘Forwarded Ports’, ‘Private Network’ and ‘Public Network’. But if you’re using VirtualBox (which I am) VirtualBox shared folders are the default synced folder type.

@Firesphere and @wmk, thanks for the comments. @wmk, it would be great to have a look at your config file. While I’m using a different box (silverstripeltd/dev-cwp) I’m hoping to get some tips as to what paths need to be configured — I’m trying to find the paths from my vagrant folder which sits inside Users/username/Sites, which is also where my development sites also reside.

I think I’m almost there, it’s just getting the final paths linked up. Having said that, am I correct in the assumption that the Vagrant box used contains the necessary Apache, PHP etc and these are not additional configurations? (sorry, another silly question I’m sure! But it is getting late!!)

marvin

Can somebody answer a question (I’ll ask in the right place this time!):

I’m setting up Vagrant on my system. The vagrant folder sits inside Users/username/Sites, which is also where my development sites reside. I can’t find the right configuration settings for the following:

  1. # Share an additional folder to the guest VM. The first argument is
  2. # the path on the host to the actual folder. The second argument is
  3. # the path on the guest to mount the folder. And the optional third
  4. # argument is a set of non-required options.
  5. config.vm.synced_folder "/", "Users/username/Sites"

Can anybody see where I’ve gone wrong? Also what would I type in browser to bring up /Sites/ and its contents? Or do I need to do separate vagrantfile for each dev site?

Apologies for what is probably a silly question — it’s all a bit of a steep learning curve at this point in time!

marvin

thanks @Firesphere, something like this:

  1. # Share an additional folder to the guest VM. The first argument is
  2. # the path on the host to the actual folder. The second argument is
  3. # the path on the guest to mount the folder. And the optional third
  4. # argument is a set of non-required options.
  5. # config.vm.synced_folder "../data", "/vagrant_data"

… if I change the last line to match your example…

marvin

OK, I’ve set:

  1. config.vm.network "private_network", ip: "192.168.33.10"

used browser address 192.168.33.10 and my browser hasn’t done a 404 — it’s sitting thinking — which will probably lead to timeout

… and sure enough it did…

marvin

You’re right, that didn’t do it… would this be the right one:

  1. # Create a private network, which allows host-only access to the machine
  2. # using a specific IP.
  3. # config.vm.network "private_network", ip: "192.168.33.10"
marvin

Hi @Firesphere, didn’t see #virtualisation — but thanks for yoru comment. Think I missed this — do I uncomment:

  1. # config.vm.network "forwarded_port", guest: 80, host: 8080
marvin

Hi again people, hoping that I’m almost there with my Vagrant build. I’ve got Vagrant and associated files in /Sites, can boot up the virtual machine using vagrant up but when I test using vagrant ssh i get the following:

  1. -bash: cd: /var/www/mysite/www: No such file or directory

Obviously I missed something? Or put it in the wrong place?

marvin

Good morning ‘locked down’ people! — quick question; can anybody advise how I can tell if I’m running the latest version of Vagrant for my version of Mac OS? I have Version 2.0 running on El Capitan (yes, I know it’s old but I love my old MacPro tower). Just tried to update to the latest version which won’t run at all — have tried to find a definitive answer to no avail… does anybody have a definition? Just asking…

marvin

Hi people, got a mod-rewrite issue here. I have the following .htaccess file in the root directory of my site:

  1. RewriteEngine On
  2. RewriteRule ^(.*)$ public/$1

Any idea why I still need to type /public after the domain in order to see the site?

jkersu

Because the public folder directory is whats publicly accessible. It should also be where your index.php is living in. Also contains another .htaccess which blocks access to sensitive files and more...

marvin

Thanks @jkersu, I’ve got that set on both counts. But mod_rewrite isn’t happening… typing the domain produces a server page…

marvin

… specifically a Plesk: A Great Website Will Be Here Soon type of page…

null

Point your document root at /path/to/whatever/public instead of /path/to/whatever

marvin

Hi @null, understand what you’re getting at. I thought .htaccess example I had posted achieves this?

Or might it be a Plesk thing?

null

It could be that Plesk does not allow .htaccess rules for security reasons

null

but you're saying that the site works correctly if it goes to /public?

marvin

That’s right… but it’s not rewriting — every URL includes /public

nightjarnz

@marvin it could be that the host has disallowed mod_rewrite

nightjarnz

or you may have to do something in plesk to see if it is enabled.

nightjarnz

I last used plesk in 2012, so I can't say for sure.

nightjarnz

first things first though - check that mod-rewrite exists :)

marvin

thanks @nightjarnz — that’s an excellent point!!

🙂 (1)

Show less replies