Riggs,
I stumbled across all of this information as I was looking up how to enable access to my apache server on my LAN. I must say, i'm a novice apache/php user, and I've spent the better part of my evening trying to wrap my head around all of this. I believe I understand the purpose and the benefit of using virtual hosts going forward for local development, and have set it up to work for the wordpress I'm currently working on. I was hoping to ask a few questions regarding this situation as a whole from the perspective of someone this change is exactly intended for.
Version of Operating system? Win 7 64bit
Version of Wamp Server installed? 2.5
Version of Apache you are running? 2.4.9
Version of MySQL you are running? 5.6.17
Version of PHP you are running? 5.5.12
Green Icon
Up until now, I have been using 'localhost/mywebsite' to access my wordpress. After enabling virtual hosts, I'm able to access my wordpress using 'http://mywebsite/'. I've also enabled the virtual hosts menu in the wampmanager icon, and it lists my host 'mywebsite' correctly.
I plan to move this wordpress to another server that is hosted on an internal network, and I'm trying understand what it is I must do now to fix any dragons that might fire up down the road. For example, after landing on my home page at 'http://mywebsite/', I expected to click on a link and get taken to 'http://mywebsite/newapage', except I'm redirected to localhost/mywebsite/newpage. Is this intended? Or is this part of the problem I'm going to experience down the road? If so, what are my options as far as correcting this?
My second is issue is actually being able to connect to my apache server from inside my subnet to allow some close coworkers to demo this site before it gets moved to the company wide network. I've tried fiddling with my virtual host to allow specific IPs on my subnet (10.10.50.xxx), as well as the entire subnet (10.10.50.0/24), but when I try to access my website from another machine on the same network, I get a 403 forbidden error.
My current virtualhost for this website is as follows
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/mywebsite"
ServerName www.mywebsite.com
ServerAlias mywebsite.com
<Directory "C:/wamp/www/mywebsite">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I have added the correct address to my hosts file on the server machine
(127.0.0.1 www.mywebsite.com
::1 www.mywebsite.com)
I am using the address 10.10.50.xxx/mywebsite to connect from the client machine that gets the forbidden error.
Any time/help anyone can offer is extremely appreciated! I must get some sleep, my head feels like it's going to split open soon.
edit: So after a nice refreshing sleep I've been reading more of the apache documentation on virtual hosts, and I've since removed some redundant pieces.
I've also begun to feel more and more as if I need to create a fresh install of wordpress using a new virtualhost and rebuild my wordpress to eliminate any issues that could happen when moving this to a different server.
I'm also still getting a 403 error when trying to connect to my apache machine from a client on the network.
edit2: So I've gotten past the 403 forbidden error. I believe it was an issue with my listen setting in httpd that I had changed to 0.0.0.0:80, after switching that back to just 80 it appears to be allowing me to connect from another machine on my network. Unfortunately I'm running into the same issue as this thread [
forum.wampserver.com] . It's interesting because nothing works other than my homepage, as soon as I direct somewhere else, I'm pointing to a localhost address that doesn't work on my client obviously. This is where my rookieness hits hard I think, because I believe I will have to start from scratch using a new virtual host installation of wordpress. Any suggestions would be great.
edit3: It works! After updating the url's of my wordpress using this guide [
codex.wordpress.org], I'm able to navigate the site fully from a client machine on my network. Hopefully all of my rambling here will help anyone else in this situation down the road.
I'd also like to add that I made a change to my virtual host definition to allow people to connect to my wordpress using just my ip address rather than have to add a hosts definition in etc/hosts for each machine.
<VirtualHost myinternalserverip:80>
DocumentRoot "C:/wamp/www/mywebsite"
ServerName www.mywebsite.com
<Directory "C:/wamp/www/mywebsite">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Edited 11 time(s). Last edit at 10/02/2014 04:58PM by Otomatic.