8 users online. Create an account or sign in to join them.Users
Virtual hosts and local network testing with Symphony
This is an open discussion with 12 replies, filed under General.
Search
On the PC in your office, you'll need to edit the hosts file (Windows: Windows/System32/drivers/etc/hosts) so that it contains a line like the following.
10.0.1.17 dev.studio-symphony.loc
Nice, that did it! Thanks David!!
I've got another question when it comes to vhosts and local network testing.
Is there an equivalent setup when it comes to the same approach for an iPhone or iPad... a device where I can't modify the host file?
If your iOS device is jailbroken, you can do it the same way (/etc/hosts). I need to edit my Android hosts file for the same reason.
Otherwise, I guess you'll have to get into configuring hostnames and their IP addresses at your local network level, which will depend on how the network is set up.
After messing around with my local network settings and doing some research I've decided to use Charles because it's awesome and just works. This blog posting at RavelRumba details how to set it up. I'm learning to stop trying things the hard way in all situations.
I've also done the host file changes on my MBPro and that works nicely, just like the PC. I thought I'd give Charles a try on the MBPro and it's all good. The Proxy can be set by going to System Preferences > Network > Wi-Fi > Advanced... > Proxies > Web Proxy (HTTP), then you put the IP address in the Server, like 10.0.1.17:8888.
Works great for iPad/MBPro browsing to the same local domains on my main iMac dev machine. I haven't tried the Proxy setup on the PC, the host file works pretty good, but I bet it's just a matter of finding the Control Panel setting.
iPhone/iPad testing is easy, especially from a Mac. Just create a wifi network from the menu bar wifi list, change the ip address on your virtualhost to the network's ip address, then connect your iOS device to the network and browse the ip address in Safari.
Wow, that's cool! Thanks!! So many ways to slice the pie now. :)
I tend to manage several test and development sites in subdirectories of my Sites directory. So, I will have Symphony sites installed at a URL like this:
http://home/sym/sitename/
I was trying to follow @designermonkey's instructions to see if I could access my sites in the same way I do locally, and was a little confused about the step to create a WiFi network. I ended up doing the following.
Go to System Preferences > Network and find the IP of my MacBook Pro on the local network:
Status: Connected Wi-Fi is connected to `networkname` and has the IP address `10.0.1.1`.
Add a line to the /etc/hosts file to assign the IP to a virtual host name:
10.0.1.1 local
Then, add the directive for the local virtual host name to the virtual hosts configuration file, which in my case is /etc/apache2/users/username.conf:
NameVirtualHost *:80
NameVirtualHost 127.0.0.1
<Directory "/Users/username/Sites">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
<VirtualHost 127.0.0.1>
ServerName home
DocumentRoot /Users/username/Sites
</VirtualHost>
<VirtualHost 10.0.1.1>
ServerName local
DocumentRoot /Users/username/Sites
</VirtualHost>
Then, from any other device on the local network, I can navigate to the IP address of my Mac and view the Symphony site.
http://10.0.1.1/sym/sitename/
Or, I can view it on the localhost machine with either of the following URLs:
http://home/sym/sitename/ http://local/sym/sitename/
I think that's pretty much the same method I use, as described by Jeremy Keith in Hacky holidays on OS X. These instructions have worked well for me on Mac OS X Leopard, Snow Leopard, and now Lion.
It was a little rushed, my previous post ;o)
I can see what you're doing Steven, but for a iOS device, that won't work. The mention about creating a new network was to create a device to device adhoc network, which is easy on a mac. Not so sure about a PC though ;o)
What won't work for an iOS device? I am accessing the localhost on my MacBook Pro from an iPad and iPhone via the device IP on my local network to test Symphony sites, etc.
Ok...
I have never been able to get that to work...
Create an account or sign in to comment.
I'm developing a site locally on a Mac using the system AMP setup. I'm using virtual hosts and host file. I can browse to the site and Symphony admin using something like: dev.studio-symphony.loc and it works great.
What I'd like to do is browse to the same site under development on my local network from another machine, like the PC in my office. From that machine I would usually browse there through my Mac's address (currently 10.0.1.17). So I'd go: http://10.0.1.17/studio-dev-symphony/ But when I do that with a Symphony setup I get a 500 Internal Server Error. (I also get that error if I use that address on the Mac)
Is there a setting I can add that will allow for me to view a site under development through my local network address?
I apologize if this is outside what should be discussed here, I've been searching and haven't found any solutions yet.
My httpd-vhosts.conf file looks like this:
# Local Symphony Dev <VirtualHost *:80> ServerName dev.studio-symphony.loc DocumentRoot "/Users/kaplan/Sites/studio-dev-symphony" <Directory "/Users/kaplan/Sites/studio-dev-symphony/"> Options Indexes Multiviews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>And my host file: