show my localhost in someother pc via ip - virtualhost

I have a site in my local which is running under xampp.Now in another Mac I want to access the local site.It can be done via sharing the ip? or something to write in host file.The source machine is windows and the target machine is mac.
I dont know how to include the ip in host file in Mac.

Assuming that it's running on port 80 or 443 and your firewall is set to allow requests on those ports, you should be able to navigate to the ip address in a browser. If you're requesting your local site from outside your subnet then you might need to configure port forwarding on your router

Related

Host the site on my computer and make is available on internet

I have the following config on my computer:
OS: Ubuntu 18.04
Server installed: Apache2 (XAMPP)
I have static IP bound on my computer (Let's say 100.100.100.100)
I have developed my website on the localhost and now I want to point my IP address on my localhost so that my website should be accessible on internet
How can I do that?
P.S.: I obviously can use the shared/dedicated hosting but I don't want to go for that and my computer has 24*7 internet + power.
I think you can adding NAT rules to you router, if your Apache server use port 80 and 443 you could try NAT these ports from 100.100.100.100 to your external IP address or dynamic dns name (if you have one).
I think is better if you register a dyndns name, if you don't have a static external ip address.

Raspberry pi web server from internet

I have been trying to make an access to my Apache server on Raspberry Pi from internet for several days.
I set up Apache, PHP, mySQL, myadmin and put index.php to 'www' folder
I edited dhcpcd.conf to set static IP.
interface eth0
static ip_address=192.168.1.220/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
I registered mydomainname.net on no-ip.net for my internal IP address
Installed No-IP Dynamic Update Client on raspberry pi and it's status is active
I opened port 80 on my router for static IP Address of my RASPBERRY (192.168.1.220)
On my router I added my no-ip account and it shows status 'Success'
I even tried to change Apache listened port from 80 to 8090
But, whatever I do, I can't get access to mydomainname.net from internet, but I can do it from my local network on my static Raspberry IP - 192.168.1.220.
So the problem is the IP you are using is your internal IP. This IP is inaccessible from the outside. As long as you are inside your network you can use the internal IP adress tho.
try using https://www.canyouseeme.org/ to obtain your router IP adress maybe then you'll be able to acces it trough IP already. also this is the IP that you need to register on the host of your site.

cannot access my webpage from outside (xampp)

I am trying to set up a web server with Xampp (ver 7.0.13) on my home PC. I redirect port 80 from router to my PC and Xampp is listening to port 80. Also, I change router's web server's port to 8080 in order to avoid conflict.
Result: I can access my helloworld.html on my pc and my phone. However, If i turn off my iphone wi-fi and using 4G network, I will not able to access dashboard and my helloworld.html by public ip (56.XXX.XXX.XXX/helloworld.html)
I try :
reinstall xampp
try different version off xampp
change config file >> Order deny,allow from all (something like that
try to change but cannot be found in most of the config files.
change router port forward setting.
But nothing work. What did I do wrong? ┐(´д`)┌
Maybe external traffic is blocked by the Windows-Firewall?
Is it a static IP? You should use a static IP in your server, if not, is impossible

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 set up xampp as online server?

I'm using xampp as a testing host, but I want to be able to access it from anywhere. currently I can access it through localhost only, and through lan by typing my local ip, but not by typing my external ip from anywhere. I tried setting up apache vhosts, but I'm not sure what to put there, examples online aren't very clear, and I don't even know if it works. so if someone could give me a heads up, I'd appreciate!
Log into your router and set up port forwarding to your computer with xampp on it. You probably want to forward port 80 (default for http) to your computer's LAN IP. Then you should be able to access your xampp setup over the Internet by going to your external IP address.
first you need to make sure the incoming traffic on port 80 is not blocked by your firewall or ISP - see this video demo
then you need to configure your Router to forward:
incoming requests to your External IP port 80 towards your Internal IP port 80 - video demo here
and finally test if port open - see this demo