Can a local server give services to the internet from a Mac? I have Apache and want to invite a user to see my website coded in my root folder via email. I saw a tutorial on YouTube suggesting this can be done, only they used a internet provider I don't have. I have Verizon.
Asked
Active
Viewed 115 times
0
-
Your personal devices are far from suitable to host web sites for public access via the internet, no matter how hard you want it. While there might not be free options today, you can find various cheap options out there. – Lex Li Jun 10 '22 at 03:52
-
I use netlify, and enjoy it's simplicity and cost; however, suddenly their invites don't work, and their confirm password feature doesn't work. A supporter in their forum gave me email templates as an alternative and I cannot get those to work either. When I responded that I couldn't there was no more replies. I posted my issue in stack flow too to no avail. – Chauncey Moore Jun 10 '22 at 05:07
-
In context, it's not price that is my concern. It is relying on another party, but being met with resistance. From my understanding hosting from my Mac puts me in control of everything. – Chauncey Moore Jun 10 '22 at 05:10
-
While you might feel like in control of everything, be aware that you also open up everything on this Mac to the whole world. Web servers (and web apps) are very very vulnerable to attacks, and you should expect tons of hacker attempts per day. Once compromised, your Mac (and other devices on the same network) can be fully taken over by the hackers and no longer yours. – Lex Li Jun 10 '22 at 14:40
-
So there is a way to do it? How would I secure my Mac? Other web servers don't get compromised and protect themselves from hackers daily I gather. What do they do? Can I do what they do? – Chauncey Moore Jun 10 '22 at 16:20
-
People tend not to discuss much about being compromised, so except that you train yourself a security professional or hire someone with that capabilities that landscape won't reveal itself to you fully. I am not sure what's your purpose of setting up this web server, for personal interest or business. If you want to run business web apps on a server, it is highly recommended to hire a security professional. If it's just a personal site and you host it on a dedicate machine (such as a web server on a hosting platform), then at least when compromised you just lost that server. – Lex Li Jun 11 '22 at 04:12
-
Do you have any recommendations to a book, website, or tutorial for training oneself to be a security professional? – Chauncey Moore Jun 11 '22 at 05:31
2 Answers
0
Assuming you have hotspot access via Verizon, you can use Ngrok to give a public address to your local site.

navjotjsingh
- 126
- 4
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 16 '22 at 19:20
0
This is a general question which many solutions are already provided for. If you can already reach your site locally, the question is probably about networking ("How to reach my host from the outside?") rather than a question about system administration ("How to setup my Apache server?").
- If your host has a public IPv4, you can reach it from the outside through that public IPv4 (assuming the client is IPv4-enabled too)
- If your host has a public IPv6, you can reach it from the outside through that public IPv6 (assuming the client is IPv6-enabled too)
- In both cases, make sure no firewall (internal or upstream) is blocking connections
- In IPv4, if you are behind a NAT or a CG-NAT, you must "port forward" from the public facing router down to the local host.
For some reasons, you may not be able to get a public IP address assigned to the host or to do port forwarding because:
- You are behind a CG-NAT and your ISP does not allow port fowarding on the router outside your home
- The router provided by your ISP gets a public IP but port forwarding is not allowed. In this case, you could replace it with your own router.
- Sometimes, self-hosting is forbidden by your ISP terms.
In such cases, you have to rely on an external server:
- You can use a hosted tunnel solution like CloudFlare Tunnels, Ngrock, ... You can even install such services on a remote server (baremetal or VPS) if you do not want to rely on 3rd party. See here for a list of hosted or self-hosted tunnels.
- A remote server (baremetal or VPS) can be used as a "remote NAT", or as more commonly named, a full-tunnel VPN. In a general way, a VPN is the technology used to create a virtual network of hosts over another network (Internet). A more specific (but popular) use case is to set one of the host in this virtual network as a "remote" gateway/router/NAT. The key is that this gateway/router is actually a NAT, this is why full-tunnel VPNs make you appear online with another IP address, and because of this, they can do port forward too.

Dylan
- 461
- 2
- 6