wamp server 3.0 virtual host on another device - apache

I am trying to view my site on other devices, mainly mobile devices. I am using Wampserver 3.0 with apache 2.4.17. I am also using the virtual host feature built in wampserver to view my site and my code is not in the wamp64\www\ folder, instead it is in my documents folder. I have been able to allow other devices view the wampserver default page but whenever I go to my website i get "fitly's server DNS address could not be found"
Here is the httpd-vhosts.conf file
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp64/www
<Directory "C:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName fitly
DocumentRoot c:/users/juan/documents/fitly
<Directory "c:/users/juan/documents/fitly/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

This is a solution I have used in the past. Although I admit there must be other
ways, none that I have found are quicker/easier to implement.
Here is another way, without using Fiddler
The basic problem is of course that we cannot address our Virtual Host by name from a mobile device, even when it is wifi connected to our routers subnet, because the devices browser does not know where to find our Virtual Hosted domain name when we try and use it.
As most if not all mobile devices are locked down and assuming like me you dont want to have to jailbreak all your test devices, we cannot take the easy option of adding our Virtual Host's name to a devices HOSTS file, which of course does exists, but we are prevented by the devices security from accessing it.
So I use Fiddler to create a reverse proxy on the Server PC so I can use a website address like 192.168.1.10:8888 (my web server PC's ipaddress and a port number) and get Fiddler to capture that address and convert it to http://fitly and pass that on to Apache which will then correctly find my development Virtual Hosted site.
For this you will need to install Fiddler which can be found here and is free
First make sure that your Virtual Hosted domain works properly on the PC running WAMPServer(Apache).
Then make these amendments to the Fiddler config, dont worry its quite simple. Here are the instruction on how to do that on the Fiddler Site which are basically
Click Tools > Fiddler Options. Ensure Allow remote clients to connect is checked.
Click Tools > Fiddler Options, and ensure the "Allow remote clients to connect" checkbox is checked.
Restart Fiddler if prompted.
Click Rules > Customize Rules.
Inside the OnBeforeRequest handler*, add a new line of code:
if ( oSession.host.ToLower() == "192.168.1.2:8888" ) {
oSession.host = "fitly";
}
192.168.1.2 being the ip address of the PC running Apache i.e. the IP Address of the PC we have installed WAMPServer(Apache) and Fiddler.
Using the device, go to http://192.168.1.2:8888. Fiddler should now capture that address and forward it on to Apache using the domain name of your Virtual Host so Apache can see it and pass you to the right site, similiarly responses will be sent back to the device that made the call.
Of course you can use any port number you like it does not have to be 8888.
You will also find Fiddler very useful for debugging many issues with your website, so dont assume its just a reverse proxy alone.

Related

XAMPP hosted website only reachable locally

Sorry if my question isn't phrased well, I am a complete novice when it comes to this kind of stuff.
I have a website in HTML format that i'd like to host locally to the internet using XAMPP. I have managed to access the site using other devices on my network so far, but can't figure out how to get it on the world wide web. I port forwarded port 80 with my IPv4 adress as 'Local Host', which I think is the correct way to do it. During testing I have my firewall disabled to make sure that that isn't a factor. When typing either my IPv4 adress or public IP adress into a browser on a device on another network, the connection just times out. I haven't edited the apache.conf files much, apart from changing:
<Directory /
AllowOverride none
Require all denied
/Directory>
#to:
<Directory /
AllowOverride none
Require all granted
/Directory>
This enabled me to access the site from other devices on my network.
Trying to change parameters like Listen and ServerName just break Apache from starting up again.
I'd also like to attach a domain name I have to this IP address, but that isn't much use as of now.

Hosts - Access local website with external device

After hours of searching and googling I've still not found anything so I decided to ask here.
I've set up a virtual host called test.dev. This means that I can have access one of my local XAMPP projects by typing that to an address bar. The set up is following:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/test"
ServerName test.dev
<Directory "C:/xampp/htdocs/test">
Options Indexes FollowSymLinks ExecCGI Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
It works perfectly fine on my local computer but if I want to access it using an external device connected to a same network, it doesn't.
The question is how should I set up my hosts - file in order to have access to that project with external devices?
I've tried with following:
192.168.0.10 test.dev # Ip address
127.0.0.1 test.dev # Local address
But it only works on my local computer. Is it even possible to target same server name twice on different IP's?
E: I figured it out! For all of those wondering the same as I was, here's the answer to get it work on all devices that are connected to a same network.
Install NPM
With NPM, install grunt
Install grunt-localtunnel-me
After installing, start it with command: lt --port 80 --subdomain "name of the wanted subdomain"
First of all you have to verify following thing if its working or not.
Make sure that your port 80 is open for all. Check your windows firewall. If you want to allow everyone to access port 80 then follow instruction list here
Allow xampp-apache is accessible from outside. you can follow instruction from here
If you above steps fails then share some screen shot with error messages.

Can't access apache from Internet

It must be a common question but I've not found any appropriate answer:
I have a website on apache server running in my office LAN. I can view pages from all computers (even smart-phones via Wifi).
All computers are connected to a router (with static IPs) which supports port forwarding.
I forwarded the routers port 8080 to the internal IP 192.168.1.5:80 which is the apache box (xubuntu 14.04).
The problem is that when I try to view the site from the internet, I always get connection refused response. I tried the http://www.canyouseeme.org but still the response is the same. This happens both when I try from my LAN->Internet->Router->Apache or directly from home Internet->Router->Apache.
I know (rather suspect) that the routed does its job because if I hit the external static IP:80 I get into its interface while when I hit IP:8080 I get the connection refused response. Canyouseeme agrees (it times out as it's waiting for a password).
Funny(?) thing is that I have not installed a firewall and the apache2.conf is the default.
Can somebody help?
Finally it is all clear; my ISP didn't allow to set the routers firewall so every setting I made was void.
So to recap first make sure that your ISP is really forwarding your ports.
However I couldn't up my site (zoneminder app) so I write down the solution in case someone else finds it useful:
First of all I assume that Apache is running without problems with the default settings. In case that you want to make a site (in your system you'll see directory) available as the root site of your apache serer, you must create a "rule" for apache:
First copy the 000-default.conf file that lies in /etc/apache2/sites-available/ directory (in Ubuntu systems) by executing
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/mysite.conf
The mysite.conf file will be a setting for virtual host and you will need to add/change contents accordingly with:
DocumentRoot /my/site/directory
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /my/site/directory/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Don't forget to change (if needed) the port apache is listening to by editing the /etc/apache2/ports.conf.

Configure WAMP to Allow iPad Testing of Subdomains via LAN

I've currently got my WAMP environment configured so that the Windows 7 hosts file redirects wildcard sub-domains appropriately. What I would like to do is use my iPad which is connected to the same LAN as the development machine to test deployment without pushing the site live.
On the development machine I can view the site via http://beta.localhost.com/ but the only way I can access the development machine from the iPad is via local IPv4 with the sub-domain as a folder for example http://192.168.0.6/beta/ which breaks the design elements of the site due to how the site is designed to rewrite URLs and the nature of CSS relative pathing.
Is there a way to enable access to http://beta.localhost.com/ directly from the iPad?
After a bit of fiddling around I figured it out. The trick was actually opening an additional port. I'm still open to any other solutions, but for the moment here's what I did to enable access:
Setup a Virtual Server on the LAN router to forward port 81 to the development machine's port 81 mapped through its local IPv4 address.
Opened port 81 on the Windows 7 development machine via Control Panel > Windows Firewall > Advanced Settings > Inbound Rules (via Left Pane) > New Rule (via Right Pane).
Via Wizard:
~ Select Port
~ Select TCP, Specific Local Port (enter 81 into the box)
~ Select Allow Connection
~ Check Domain, Private and Public
~ Name and describe as you wish
Added the following code to the httpd-vhosts.conf file:
NameVirtualHost *:81
<VirtualHost *:81>
ServerName localhost.com
ServerAlias www.localhost.com
DocumentRoot "D:\wamp\www\beta"
ErrorLog "logs\errors.log"
<directory "D:\wamp\www\beta">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost></pre>
*Take note of the inclusion of the "beta" sub-domain I included. Change this to whatever is relevant to your needs.
Add Listen 81 to your Apache httpd.conf file.
Restart all services in WAMP. Access the "beta" (or whatever you decided on) via the public IP of your router using port 81, for example 255.255.255.255:81.

Cannot access wamp server on local network

I want to host a website on my local network. For some reason I can only access wamp in my local computer.
I have 2 computers in my network. Both computer A and computer B have wamp server installed. when I type the ip address of computer A from computer B I am able to connect to it. But when I do it the other way around it does not work! In other words when I type the ip address of computer B from computer A the browsers says: server at 192.168.0.120 is taking to long to respond.
Things that I have done in order to solve the problem on computer B: (remember I want to connect to computer B from computer A)
1) turn off the firewall
2) Uninstall wamp and reinstall it.
3) turn off the anti-virus.
4) turn off windows firewall
5) Place wamp online and after putting it online restart all services
after doing all those steps I still cannot connect to it from computer B!
I have not chaged any ini file plus I have uninstall it and install it again so why is it not possible to connect to it!? I have used wamp for the last 3 years and I have never experienced this.
Also wamp is the only web server that I have installed on this computer. I don't have IIS nor any other web server installed on my computer.
Turn off your firewall for port 80 from any address. Turn off 443 if you need https (SSL) access. Open the configuration file (http.conf) and find the lines that say:
Allow from 127.0.0.1
Change them to read
Allow from all
Restart the wampserver. It will now work. Enjoy!!
Perhaps your Apache is bounded to localhost only. Look in your apache configuration file for:
Listen 127.0.0.1:80
If you found it, replace it with:
Listen 80
Then restart Apache.
(More info about Apache Binding)
1.
first of all
Port 80(or what ever you are using) and 443 must be allow for both TCP and UDP packets. To do this, create 2 inbound rules for TPC and UDP on Windows Firewall for port 80 and 443.
(or you can disable your whole firewall for testing but permanent solution if allow inbound rule)
2.
If you are using WAMPServer 3 See bottom of answer
For WAMPServer versions <= 2.5
You need to change the security setting on Apache to allow access from anywhere else, so edit your httpd.conf file.
Change this section from :
# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
To :
# onlineoffline tag - don't remove
Order Allow,Deny
Allow from all
if "Allow from all" line not work for your then use "Require all granted"
then it will work for you.
WAMPServer 3 has a different method
In version 3 and > of WAMPServer there is a Virtual Hosts pre defined for localhost so dont amend the httpd.conf file at all, leave it as you found it.
Using the menus, edit the httpd-vhosts.conf file.
It should look like this :
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Amend it to
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp/www
<Directory "D:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Note:if you are running wamp for other than port 80 then VirtualHost will be like VirtualHost *:86.(86 or port whatever you are using) instead of VirtualHost *:80
3.
Dont forget to restart All Services of Wamp or Apache after making this change
go Setting -> General and change url in WordPress Address (URL) and Site Address (URL)
enter your pc name or your ip address in place of localhost
before : http://localhost/wordpress-test
after : http://your-pc-name/wordpress-test
...and that's it..you can access wordpress from any pc in your LAN...!!!
I had to uninstall my anti virus! Before uninstalling I clicked on the option where it said to disable auto-protect for 15 min. I also clicked on another option that supposibly disabled the anti-virus. That still was blocking my server! I don't understand why Norton makes it so hard to literally stop doing everything it's doing. I know I could had solve it by adding an exception to the firewall but Norton was taking care of windows firewall as well.
Wamp server share in local network
Reference Link: http://forum.aminfocraft.com/blog/view/141/wamp-server-share-in-local-netword
Edit your Apache httpd.conf:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
#Deny from all
and
#onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
#Deny from all
to share mysql server:
edit wamp/alias/phpmyadmin.conf
<Directory "E:/wamp/apps/phpmyadmin3.2.0.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
#Deny from all
Allow from all
I had the same issue, tried all nothing works, following works for me
Following is what i had
#onlineoffline tag - don't remove
Require local
Change to
Require all granted
Order Deny,Allow
Allow from all
I know this is an old post BUT I have been having problems getting WAMP server seen on my windows 7 pro network for days, tried all of the solutions offered (including changing windows system files) but still not working. finally in pure desperation I put everything on the system back as it was and installed WAMP Server on a different drive (E:\WAMP ) in my case. The result was it worked perfectly first time with no editing configs or messing with the system. Other users may wish to try this before reaching the 'tear your hair out stage', it certainly saved my sanity or what I have left of it
I hope this helps someone
Dave
If you are using wamp stack, it will be fixed by open port in Firewall (Control Pannel). It work for my case (detail how to open port 80: https://tips.alocentral.com/open-tcp-port-80-in-windows-firewall/)
I had the same problem but mine worked fine. Turn off your firewall, antivirus. Make sure your port 80 is enabled and both pcs are set to be remotely accessed. In each pc under users, add new user using the host ip address of the other pc. Restart all services. Put your wampserver online. It should connect