Hey guys I’m having a big problem. I’ve been trying to set up my web server in CentOS. I successfully set up LAMP already but my friends can’t access it. How do I fix that? And how do I set up a domain name in Apache? I tried changing the ServerAddress to like http://www.example.com but when I typed in my server address in Chrome, it says http://www.example.com could not be found. What could be the problem? Please, help me.
Share
DNS
Setting the ServerName in apache doesn’t affect other computers. Your computer has an IP address. DNS is how a name like example.com gets translated to an IP address.
For the time being try to use your IP address in the browser. You can find your ip address by using the
ifconfigcommand. Then prefix your IP address with http:// in your browser.If you don’t have a public IP address (behind a router, etc), only people on your network can access it.
http://192.168.X.X is a private IP address, there are a few others
A quick way to fake DNS is to use the “hosts” file.
If all of that is set up and it still doesn’t work, check the firewall…
Firewall
Try disabling the firewall to test access.
This will take down your firewall for 1m. If that’s the issue, then open a hole in your firewall for port 80 and restart it.