How to remotly access a custom wampserver's virtual host in a local network? - apache

I use Wampserver 3.0.6 under windows 10 and I want to share my application between my personal PC (The host) and some other computers linked to the same home network (Clients).
I changed a line on httpd-vhosts.conf file to let the application be accessible from other machines in the network from this:
Require lacal
to this:
Require all granted
The problem is that the default virtual host (localhost) is accessible from those clients using the host's ip adress like this 192.168.###.###/ but not my customized virtualhost (tilelli on this case). Here is the content of httpd-vhosts.conf file now:
enter image description here
I tried to access it via 192.168.###.###/tilelli/ and directly via tilelli/ but didn't work.
Can anybody help me please ?

If you define a Virtual Host Servername as tilelli then Apache will serve that site when it sees that domain name in the connection request i.e. http://tilelli.
If you have a local (company) DNS Server, add that domain to it, pointing to your WAMPServers PC's IP Address. If you dont have a local DNS Server, then change the HOSTS file on the PC's that need to see this server so they know where to look for it
HOSTS FILE
192.168.xxx.yyy tilelli
You do have to change each and every one of the other PC unfortunately.

Related

website can be accessed using ip but not with the url(domain name) in wamp

from default httpd.conf to updating the host file and httpd.conf i tried but the website fails to open with domain name give
in host file
<my current public ip address> <domain name>
in httpd.conf
Listen [my public ip]:port
then restart of wamp server and finally restart of PC and of-course change of ip is done in above all.
But of no use
Please help
Thanks for time and response
Aaron,
I think you are misunderstanding the function of the HOSTS file.
The hosts file acts a little like a local DNS Server. Any changes you make to it will only effect the single PC that you made the change on.
What the HOST file actually does
When windows starts it starts a service called DNS Client also known as dnscache. That service reads the HOSTS file and seeds the dnscache with any domain names you put in it and the ip that should be connected to for each domain name.
Any program (the browser in this case) that wants to connect to a domain, checks this cache first, to reduce accesses to an actual DNS Server out on the web and therefore speed up the conversion of domain name to Ip Address.
So if you want external users, i.e. anybody on the internet to be able to access your site you have to either purchase a real domain name and get it pointed to your WAN ip address, or use a Dynamic DNS service like DYNDNS or NO-IP, to mention only a few, and get that dynamic dns service to point to your WAN IP.
You will also have to change your Apache config so it will serve that domain name, my suggestion would be to create a Virtual Host to do this.
This post may help with the process of creating a Virtual Host

Access virtual host on apache without host redirection?

I have apache 2.4 installed on Ubuntu server 14.04 and have setup different virtual host like domain1.com,domain2.com,domain3.com. The web server is meant to be accessed only from local network. So I tried to edit /windows/syste32/drivers/hosts and added line like this
192.168.1.90 domain1.com
and can now access the domain1 from that machine by simply putting domain1.com in browser. However I wonder if I can access specific virtual host on apache without editing the hosts file, I mean entering something like this in browser
192.168.1.90/domain1.com
, but this doesn't work since apache tries to retrieve content from the default host. In other words: If I know the apache server ip and virtual host domain, can I access it via browser directly?

Website in lan with virtual host?

I have a specefic problem, i have more websites on my localhost server (xammp), they has a virtul host, but i want to access this websites trough lan or wlan because so i can test it on mobile devices. If i call only ip on other device then i see xammp control panel, but i don't know how can i call websites in lan like: "site1.local, site2.local, site3.local", are here static ip's needed? On the router is DHCP enabled. I read few topics and this is all clear for me, the problem is only access on this sites trough network.
Read topics:
How to set up Apache virtual host such as http://home/, http://office/, etc
Accessing localhost (xampp) from another computer over LAN network - how to?
How to set up Apache virtual host such as http://home/, http://office/, etc
Apache: see named virtual hosts from LAN
Find your IP of your server machine. If it uses windows, press start then type into the search bar cmd. Then when a command promt comes up type in ipconfig and hit enter. Look for "IPv4-address" and to the right of that is your local IP of your computer.
Then you can use a computer on your wireless LAN or a wired connection. Simply type in the IP of your computers local IP with XAMP, and you are good to go!
Hope this helped
-Kad
I do this on work for testing. We have a XAMPP localhost server. My projects are in the htdocs folder. like this: c:\xampp\htdocs\niceproject
The IP for reqesting xampp is something like this: 192.168.10.104.
Now for calling the Websites just do this: 192.168.10.104/niceproject
I hope this is what you are looking for.
To access multiple sites (virtual hosts) served from one machine (say lanwww running apache) on mobile devices the usage of ServerName (say site1, ServerAlias site1.lanwww) fails - the DHCP on the router won't map subhosts (site1.lanwww). I found that using different ports for the subsites works nicely though - remember to add appropriate Listen statements to the ports.conf. The configuration of other webservers is left as an exercise to the reader.

How to access Apache server from inside network?

Hi, I've created an Apache server and it's accessible through its domain name outside of my home network. I can also access it by going to the localhost on the PC that serves the site. My problem is that I can't access the site from any other devices connected to my network. I've tried both domain and localhost, and neither of them work. Is it possible to make the site accessible to devices within the network that its hosted on?
Your problem is probably caused by NAT: you have a public domain for your apache webserver, which points to your public IP. From inside your network, your apache's server cannot be reached through your public IP because of network address translation. But you apache webserver will also have a private IP address in the form of 192.168.1.X (or something similar). So, from a PC in your private network, just point to the private IP address of your apache's web server and it will work.
For completeness, I must also mention the fact that this solution relies on the settings you made in your httpd.conf file in apache: if the virtual host is mapped to *:80 (or *:port) everything will be fine

symlink or alias? Not sure what its called

I want to redirect request on my local webserver much like "http://localhost/" redirects to my ServerRoot. I have seen it done with "http://www/" and also with "http://helpdesk/" How would I go about adding my own?
Are you saying you want to redirect something like http://custom to your web server? If so you can do this by creating an entry in your hosts file, or configuring your local DNS server to return local addresses for those hostnames.
Add the following to your hosts file (On *nix /etc/hosts and C:\Windows\System32\drivers\etc\hosts on Windows)
127.0.0.1 custom www.custom
Then you can optionally configure a virtual host on your Apache server to handle requests for those hosts. If you don't create a virtual host, it will just serve up the same content as localhost. You can also have your local webserver host the site and add that entry to your local PC's hosts file and be able to browse it from that hostname as well.
If that isn't what you wanted, can you please clarify your question.