Apologies in advance if I this question has been answered elsewhere (I seem to remember reading a post, but can't find it anywhere).
Currently, to access websites in the guest from the host I am editing '000-default' in the 'config' directory and changing occurrences /var/www to the location of a particular site e.g. /home/quickstart/websites/example.dev.
DocumentRoot /home/quickstart/websites/example.dev
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/quickstart/websites/example.dev>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
DocumentRoot /home/quickstart/websites/techno.dev
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/quickstart/websites/techno.dev>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Comments
Comment #1
pau1_m commentedWoops, I hit save instead of preview and hadn't finished editing. I meant to say...
At the moment, to access a site in the guest from the host I change
to
and then change networking from NAT to Bridged and run
Is there a more elegant solution for this?
Would it be possible to have something like 'localhost/mysites' or 'localhost:8080' point to '/home/quickstart/websites'? With an appropriate .htaccess in that directory one could access all of the sites on the guest from the host.
I have found Firefox, Chrome and Chromium all have random problems with JavaScript and Flash so it's really important to be able to check sites with browsers on Mac / Windows.
Comment #2
pau1_m commentedForgot to say, also have to change a line in 'example.dev' in the 'config' dir to the current IP of the guest.
from
to
And then type the IP into a browser on the host to access the site.
Is really not a very elegant solution the problem, but it works for the moment. Any thoughts on how to improve?
Comment #3
pau1_m commentedWhilst writing the above, I got to thinking about different ways to approach this problem. At the risk of turning this support request in to a stream of consciousness I'll post a new (simpler) solution.
First, add a new listening port to Apache. In this example I'm going to use port 55555.
In ports.conf located at
Add this line to the end of the file
Now we tell apache to point this port to example.dev. Edit the file at
and change the first line
to
In the terminal, restart Apache
Ensure that networking mode is Bridged rather than NAT.
You should now be able to access example.dev from a browser on the host (or any other machine on the network) by entering the guests IP and sites port number. In my case this is
or on the guest at
This procedure can be followed for any number of sites - just use different port numbers for each.
edit: There's a solution for the same issue on a quickstart handbook page. But this one is not dependent on fixed IPs or making changes to the host OS.
Comment #4
MichaelCole commentedHi pau1_m,
All these things are possible... I don't have any special feedback.
I hope you find what works for you.
Best luck,
Mike
Comment #6
danny_joris commentedThanks Paul, #3 worked great for me! For newbs like me: an easy way to find out the guest IP is to right click the 'network connections' icon on top, and choose 'connection information'. You can find the IP Address there. (mine was 192.168.1.7)
Comment #7
danny_joris commentedIs it possible to connect with ftp or ssh to the Guest OS as well using this technique?
Comment #8
danny_joris commentedActually this solution made me understand the one in the documentation better: http://drupal.org/node/789006 . I'm using this solution now using NAT & Host-Only and the hosts files. Awesome!
Still wondering on how to get access from the Host to the Guest using FTP and SSH (putty?).
Comment #9
danny_joris commentedSolved (s)FTP and SSH (putty) by installing OpenSSH on the Guest OS. Instructions are here: https://help.ubuntu.com/10.04/serverguide/C/openssh-server.html . Only need to install openssh-server on the Guest OS if you're using Putty (as far as I know).
This is great! :)
Comment #10
rootworkI've edited the handbook page and added all of the options mentioned here:
https://drupal.org/node/789006
Comment #11
rootworkComment #12
danny_joris commentedThanks for adding this. I saw the note about bridged networking. Just want to say that it runs very well and I only use NAT and Host-Only.
Cheers!