I have Vagrant setup and CentOS 6.5 x64 is working and it works fine. There is no problem running multiple sites inside this virtual machine. All sites are launched from the / var / www / public folder, with the exception of PhpMyAdmin, which runs on / var / www / html . I am trying to use a stray share to gain access to any of the running host sites. The problem is that the stray share only displays the contents of the / var / www / html folder.
Is there anything else I need to do to access my newly created / var / www / public folder? I tried to edit the hosts file on another computer to check if I can redirect any URL that I assigned to these sites to the current "firewall" funk, but this does not work. I'm just personally at a loss for what I have to do next.
This is my basic setup. Vagrant version 1.5.4, VirtualBox version 4.3.8, Windows 7 x64, Config file from PuPHPet, but highly customizable after loading to add vhosts, ssh, mysql and bash files.
Hope someone else might run into this problem. Does anyone have a good direction I can turn?
Thanks everyone
c0p
SELF UPDATE
I have made significant progress with my own question. What I am doing is allowing access to a person outside my car. I don’t need them to have full access all the time, but just to look at things as they are and notify me of any changes that they may need. You know, standard developer stuff. So this is what I came up with.
Researching the network as a whole, I came across this link: https://groups.google.com/forum/#!topic/vagrant-up/IcEl9-V9wsU
This guy works with Nginx and seems to be asking the same question as me, but using a different web server. Please take a look at the page if you are working with something similar to Nginx. He has an answer. I don't know anything about Nginx, but I can still extrapolate a bit of what I need.
So what I got on this page is that when he received an unusual link from the Vagrant website, he quickly edited his configuration files for Nginx and restarted the web server. Now the crazy url pointed to the location of the virtual hosts file and called up the page that he wanted to display in order to actually display, and not just show the default welcome page.
I thought about this for a while and decided to edit my own configuration and see what happens.
I am running CentOS, so I edited the file /etc/httpd/conf/httpd.conf .
There is a commented line #Listen 80 about halfway down this file. Immediately after this line (or give it a space if you want), I added the following:
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin some_dude@home.com DocumentRoot /var/www/public/sitename ServerName hungry-lovebird-7142.vagrantshare.com ServerAlias hungry-lovebird-7142 ErrorLog /var/www/www.sitename.dev-error_log CustomLog /var/www/www.sitename.dev-access_log common </VirtualHost>
I pointed DocumentRoot to the site folder that I want to access, and set ServerName and ServerAlias to the firewall link. Then I saved the file and restarted Apache with sudo service httpd restart
Then I jumped back to Firefox (Windows 7) and updated the oddball page of vagrantshare.com, which I already had before editing this file. In fact, this led to the contents of the sitename folder that I gave in the httpd.conf file. And so it works! Friggin 'cool!
The only problem I am facing is that I received this warning when restarting Apache:
Stopping httpd: [ OK ] Starting httpd: [Wed May 21 00:11:37 2014] [warn] NameVirtualHost *:80 has no Vi rtualHosts
Apache will start fine, but I did not know what to do with this warning. Later, I just deleted the NameVirtualHost *: 80 part of what I added and restarted Apache. This time without any warning.
Understand that this allows me to show client updates on only one site. This worked for both static sites and WordPress sites. I just changed where the vagrantshare.com link looked for files. I was able to change to several sites by editing the httpd.conf file and restarting Apache all within the same firewall session (they time out). I use Windows, so I had two copies of git - bash (msysgit) running at the same time. One of them hosts a share stroller session, and the other accepts the changes to httpd.conf after the ssh stroller that enters the virtual machine.
If you intend to use this for any WordPress site, you will also need to edit the wp_options table for that site. Change the siteurl and home values in the option_value column to the full URL of the link provided to you by the tramp. . You can also just edit these values in the admin panel, but I am much faster with MySql, so I chose this route.
Hooray! OK, great. I almost reached where I wanted to start. Hopefully someone can shed some light on why what I did really work. Did I just basically do a redirect for this address?
By the way, when you finish with a stray share , do not forget to comment on these lines (save them as you will probably need later) and restart Apache. Now get back to work with what the customer wants to change!
In any case, I hope that someone can answer the question “why is this work” that remains, and I really hope that it helps someone along the way.
Thanks,
c0p