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

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.

Related

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.

Ubuntu Server with Apache domain management

I'm currently trying to set my Apache configuration on ubuntu server. I have one IP(ex: 34.228.1xx.xx) and one domain(ex: mydomain.com).
I succeed to connect "Apache2 Ubuntu Default page" using IP 34.228.1xx.xx
Then I added 34.228.1xx.xx mydomain.com in hosts file(/etc/hosts) and restarted apache using this command sudo service apache2 restart
But I can't see "Apache2 Ubuntu Default page" using domain mydomain.com, but I still can connect it using IP 34.228.1xx.xx
This is my first web hosting I know my question is messed.
Thanks you in advance.
0.0.0.0 is not a port, it's an IP. And it is a special one which shouldn't go to /etc/hosts. Remove it.
To access Apache on the local machine (on the same on which Apache is running), use "127.0.0.1" or "localhost" as host name in your browser.
On all other machines, use either the machine's IP or its DNS name.
Of course, you have to ensure that the DNS name is pointing to the right IP. This should be a public IP (not something like 192.168.x.x or 10.x.x.x etc.) If you haven't done so already, you must register this name with your DNS hosting provider as a DNS "A" record.
Additional points to consider:
Firewall on Apache machine must be open for incoming traffic on ports tcp/80 and/or tcp/443
If your server is behind NAT, there must be a "forwarding" rule on the NAT machine

How host Webserver from Outside Network

I have subscribed to Local Broadband plan in Delhi, They have 1 static ip through which their all subscribe use it. When I Enter my ip from outside then it will forwarded to their Local IP management Software Page. How can i access to my web server, Is there my port forwarding technique like through unique port i can access to my localhost from out side or any other way. Even Dynamic DNS service like no-ip isnt working. they all are landing on same IP Management page.
Thank You in Advance.
Note: Using Nginx on Raspberry Pi.
The problem is with your Local Broadband company. Sounds like they need to do the port forwarding, or you from that "management page" you get to access.
You have to be able to forward port 80 from your router (the one with the Public Static IP) to the private (NAT) IP of the PI; both on port 80.

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.

show my localhost in someother pc via ip

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