Fedora Linux Support Community & Resources Center
  #1  
Old 9th April 2017, 02:28 AM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
linuxfedorafirefox
Trouble with First Home Based Server

Hi

I am trying to put up my first simple index.html webpage using Apache to www.eloorn.com to point to my home server on Fedora 25.

But it is not working.

My home IP is not fixed, so I am trying to use ddclient and the PremiumDNS service of namecheap.com ( https://www.namecheap.com/support/kn...-is-premiumdns )

I have followed the following steps:

Renamed my name servers with my name registrar.

I have installed apache, ddclient, on a Fedora25 distro and followed the following steps from Namecheap

(per: https://www.namecheap.com/support/kn...ng-dynamic-dns)

Enable Dynamic DNS for the domain;
Create an A record for the hostname;
Download any Dynamic DNS client of your choice;
Enter your configuration details and run the Dynamic DNS client.

I then followed the the following instructions:
on setting up a website with SELinux
http://www.serverlab.ca/tutorials/li...e-web-servers/

However, it is not working.



I would like to troubleshoot and see if I can track down the source of the problem but I am unsure of where to start.

Any suggestions would be appreciated.

Thanks!
Karen

Last edited by karentutor; 9th April 2017 at 02:45 AM.
Reply With Quote
  #2  
Old 9th April 2017, 05:19 AM
Doug G Offline
Registered User
 
Join Date: Jul 2005
Posts: 794
windows_98_nt_2000firefox
Re: Trouble with First Home Based Server

Verify that your internet ISP allows running a web server. Many do not and block port 80

Verify your computer firewall allows http connections.
__________________
======
Doug G
======
Reply With Quote
  #3  
Old 9th April 2017, 08:21 AM
flyingdutchman Offline
Registered User
 
Join Date: Jan 2015
Location: Al Ain, UAE
Posts: 660
linuxfedorafirefox
Re: Trouble with First Home Based Server

Yup - set you port to 8080 and try again.
__________________
--
Have fun!
http://www.aeronetworks.ca
Reply With Quote
  #4  
Old 9th April 2017, 03:52 PM
wolfred Offline
Registered User
 
Join Date: Apr 2014
Location: Brooklyn
Posts: 48
linuxfedorafirefox
Re: Trouble with First Home Based Server

On you system run
Code:
netstat -tupln
to see what port apache is listening on.
Once you can see apache is running and listening on a port make sure you firewall allows you to reach those ports from outside.

If you are using firewalld and the ports are 80 and 443
Code:
firewall-cmd --add-port=80/tcp
firewall-cmd --add-port=443/tcp
This will open port 80 and 443, to make it stick after reboots
Code:
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --add-port=443/tcp --permanent
If you are using iptabes and port is 80 and 443
Code:
iptables -A INPUT -p tcp -m conntrack --ctstate NEW --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m conntrack --ctstate NEW --dport 443 -j ACCEPT
iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
After your firewall rules are set you can use the tail command to go through apache access logs to see if you hit your server.
Code:
tail -f /var/log/httpd/access_log
if you are using ssl/tls then use
Code:
tail -f /var/log/httpd/ssl_access_log
If you think it is a selinux issue you can temporary disable it to see if you can view the site
Code:
setenforce 0
If you disable it and you are able to see the site then enable selinux view logs and then try to load the site again to see why it is being denied.
Code:
setenforce 1
tail -f /var/log/audit/audit.log

Last edited by wolfred; 9th April 2017 at 04:19 PM.
Reply With Quote
  #5  
Old 9th April 2017, 04:28 PM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
macossafari
Re: Trouble with First Home Based Server

Thanks let me give all of these a try!
Reply With Quote
  #6  
Old 9th April 2017, 05:43 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxfirefox
Re: Trouble with First Home Based Server

Wolfred's suggestions are good and detailed.
I might first try
systemctl status httpd.service

which will show if it's at least running, and also, from the machine running apache at home, type localhost into a browser's address bar and see if you get something. If you get, for example, 403 forbidden, you know you did something wrong.

Also, from outside the network, you can try telnet <IP> port 80 to see (assuming that you find it is running) whether it can be reached from outside the network.

I'd also add that if you do have to troubleshoot selinux, there's a good troubleshooting guide on the CentOS wiki that should be applicable to Fedora.

https://wiki.centos.org/HowTos/SELin...9e56191c257c01

One thing you left out (no problem, we all do) is how is it not working. Did you try from inside your network? Outside your network? Did you get a message like apache failed to start, give this up and go jogging? (Though I believe their messages are less confrontational).
Reply With Quote
  #7  
Old 10th April 2017, 02:47 PM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
linuxfedorafirefox
Re: Trouble with First Home Based Server

Hi Thanks

It is now showing locally that he web page is up (I can see my test page).

But, when I try to access it on any device other than the server itself (it is a workstation Fedora25
so it has a browser)

it comes up with the error "Safari cannot open the page because it could not connect to the server"

I am not yet finished going through the suggestions and completing but thanks for requesting clarification.
So, in answer to the question, it works locally but not on any devices off of the server.

ps - let me go through the suggestions top to bottom and carefully check everything -otherwise someone may have already given me the answer
You guys are team awesome!


Karen

Last edited by karentutor; 10th April 2017 at 04:16 PM.
Reply With Quote
  #8  
Old 10th April 2017, 09:14 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxchrome
Re: Trouble with First Home Based Server

Well, without me, awesome would be aweso. (Meh, sounds funnier spoken).

Ok, one thing that I'm not sure we've clearly explained.

It works on the server itself.
However, it doesn't work from any other machine, even if that machine is on the same local network? (If anything we say isn't clear, ask).

Assuming this is the case, try that telnet command I mentioned. While inside your local network, let's assume they have addresses like 192.168.1.2 and 192.168.1.3, with the server's local address being 192.168.1.2.

If you run telnet 192.168.1.2 80 do you get a response or does it just hang. Right now, I'm suspecting your firewall, if I've understood your reply.
Reply With Quote
  #9  
Old 10th April 2017, 09:56 PM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
linuxfedorafirefox
Re: Trouble with First Home Based Server

I type:

root@localhost conf]# telnet 192.168.1.2 80
Trying 192.168.1.2...
telnet: connect to address 192.168.1.2: No route to host

This is what I have with namecheap (www.namecheap.com)

A + Dynamic DNS Record www 127.0.0.1 Automatic

URL Redirect Record @ http://www.eloorn.com/ Unmasked

Interestingly, when I do
[root@localhost conf]# telnet 127.0.0.1
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

1. Connection refused? That might be important?

Of course, I could be entirely barking up the wrong tree here... (ruff ruff)

2. Maybe I shoudl just try a different client?

Right now, I am using ddclient.

I was looking at this one http://zoneclient.sourceforge.net/

but it looks more complicated than ddclient.

3. lastly, is it possible to trace the route of packets to see where they are getting derailed? I mean can I 'ping' my address and watch it travel vis a vis other places and someone pinpoint the location of the failure? This was suggested to me: https://toolbox.googleapps.com/apps/dig/#NS/eloorn.com
but I am not sure what the output means.

thanks

Last edited by karentutor; 10th April 2017 at 10:15 PM.
Reply With Quote
  #10  
Old 10th April 2017, 10:32 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxfirefox
Re: Trouble with First Home Based Server

Doesn't matter, we're talking your home network right now. Are you familiar with the difference between private and public IPs? Internal/External, there are various ways of describing them.

A 192.168.1,x address is private.

So, for example, I have dyndns. I have my home computer, 192.168.1.5. I have a public address, say, 1.2.3.4

Using Dynamic DNS, (similar to what you're using) it gets my public DNS address (I go to their site, and edit hosts, and it picks up my 1.2.3.4 address). Now, on my home router, I set anything coming in on 80 and 443 to go to 192.168.1.5.

In other words, someone sees that smr54.net (not a real site, at least not mine, though it might exist) is available on 1.2.3.4 The DNS servers of the world get that information from dyndns. So, people going to smr54 hit the address 1.2.3.4, which is a router, that routes (duh) inquiries on 80 to 192.168.1.5.

127.0.0.1 refers to local host and lots of systems block on this.

Without being mean, do you know anything about DNS and web servers, or this your very first attempt? No problem if it is, it's just that all of us who are answering may be skipping steps.
Reply With Quote
  #11  
Old 10th April 2017, 11:02 PM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxfirefox
Re: Trouble with First Home Based Server

Ok, something's really wrong, sorry.
If I ping www.eloorn.com I get 127.0.0.1, in other words, my local host

I didn't have time to go through the whole namecheap setup to look, but you better review that.

You should have a public IP address, you can find that out by going to the server and typing in ipchicken.com

You want eloorn.com to have an A record pointing to that address. I know with dyndns, I can set it so my router does it automatically, and I'm sure namecheap has something similar.

You also have the issue that the server doesn't seem to be listening on 80 and 443. So, on top of that, you're doing it with SELinux, which is admirable, but adds another layer of complexity, when you haven't gotten the first part done.

But, your first two steps are to be able to get apache running so that it can be reached within your local network, which is an apache configuration thing.
Your next step is to get eloorn.com's DNS A record to agree with what you see on IPchicken for your public address.

For that aspect, you should probably ask namecheap, their support probably deals with that all the time.

Rereading this, it sounds as if I'm being rude, and please believe me that I'm not intending to be so. We all have to start somewhere, and forums like this are a great place, full of nice people who like to help.

Anyway, either one of those two issues will prevent the site from working. The fact that you can reach it from the server means that some things are configured correctly, but apparently, the machine's firewall or SELinux policy is preventing it.
Reply With Quote
  #12  
Old 10th April 2017, 11:23 PM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
linuxfedorafirefox
Re: Trouble with First Home Based Server

I think that the best question to answer is:

Without being mean, do you know anything about DNS and web servers, or this your very first attempt? No problem if it is, it's just that all of us who are answering may be skipping steps.

Answer:
errr... no.

I know nothing (really, acutally I am completely confused about the whole IP bit).

re:

Ok, something's really wrong, sorry.
If I ping www.eloorn.com I get 127.0.0.1, in other words, my local host

I didn't have time to go through the whole namecheap setup to look, but you better review that. ...

SUMMARY CONCLUSION

I think that in summary, I will need someone to help me set this up end to end. I thought that I could just follow the instructions and set it up. But, apparently not

I will contact namecheap.

Also are any of you able to recommend a service to help with this? Ideally someone / organization I can hire who can explain what they are doing while they are doing it??

Thanks!
Karen

Last edited by karentutor; 11th April 2017 at 12:01 AM.
Reply With Quote
  #13  
Old 11th April 2017, 01:52 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxchrome
Re: Trouble with First Home Based Server

Ok, no problem.
As some medieval mystery novel's lead character said, in a book I read awhile back, Everyone is a beginner at someone else's job.

Probably any college in the area (or even high school) has someone who can do it fairly easily. I don't know how much time and effort you feel like putting into this, as these all seem like fairly easy to fix problems, just not a matter of pointing and clicking.

Let's quickly go over IPs.
Firstly, (and this is for Windows and Mac as well) 127.0.0.1 refers to your local machine--when you turn it on, if you do ping 127.0.0.1 you'll get a result. It's called the lo interface, for loopback.

Your ISP probably gives you a modem to connect to their system. I have RoadRunner, and I have a modem that goes through a router to go the Internet. The router has a public and private IP.

So, the public one is my home network's address from the Internet--as I said, it could 1.2.3.4
The router gets this address from the modem from my ISP. Meanwhile, I hook up a computer to the router,
and it has an IP like 192.168.1.5.

Summary for IPs. You have a public one, that you get from your ISP, and a private one that works on your network.

The other issue is why you can't reach your server from your own network. That network is called a LAN, Local Area Network. The webserver is working, as you're able to reach it from its local host. The fact that you can't telnet on port 80 seems like a firewalld problem. Wolfred gave steps to look into that. What I would do is try his steps with firewalld and see if you can then telnet into your server and report back to us.

Once you get that working, someone here probably knows how to set that up with namecheap.
Reply With Quote
  #14  
Old 11th April 2017, 02:44 AM
karentutor Offline
Registered User
 
Join Date: Apr 2017
Location: Vancouver
Posts: 25
macossafari
Re: Trouble with First Home Based Server

In the Name of the Rose? That's the only medieval mystery I know of (presumably
There are others though). I personally have never read it, but the storyline does sound tantalizingly interesting.

As to Telneting in and Wolfred's steps, I shall try that late tonight my time; as alas, I am at my day job.
I will then revert.

Let me take this step by step as I would much prefer to know what few wonders I can
Reply With Quote
  #15  
Old 11th April 2017, 02:59 AM
smr54 Online
Registered User
 
Join Date: Jan 2010
Posts: 7,072
linuxchrome
Re: Trouble with First Home Based Server

No, a Fidelma mystery, about a Celtic nun/lawyer in 7th Century Ireland.

Step by step is good. It's not horribly difficult to get a basic website going, but there can be many steps.
Reply With Quote
Reply

Tags
based, home, server, trouble

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Fedora 21 based Simple Home Server Pudge Servers & Networking 2 15th February 2015 11:09 PM
Setting up a new network / file / download home server based on Fedora ngdbsdmn Using Fedora 0 14th December 2008 12:23 AM
key based ssh open, odd setting in ifconfig when i came home DigitalDuality Security and Privacy 4 6th February 2008 07:38 PM
NFS Home Directory & Mozilla-based Browsers ThinkOpen Using Fedora 7 3rd July 2007 04:14 PM


Current GMT-time: 22:37 (Sunday, 23-07-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat