LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-12-2020, 12:58 AM   #1
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Rep: Reputation: 15
Localhost or 127.0.0.1 do not resolve


Hi,

It did work fine and got tot eh Apache page and then I disabled 000-default.conf to activate other .conf sites I did for other outside LAN IP's and dom names.

Outside IPs and dom names work fine now. I can get to the sites folder index but when I try localhost it does not resolve.

I can ping localhost okay.

What could I have done to do this/

Thanks

oz
 
Old 01-12-2020, 03:39 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
It seems like this is a duplicate/continuation of https://www.linuxquestions.org/quest...es-4175667172/ or https://www.linuxquestions.org/quest...es-4175667158/
OP currently has 7 apache web server problem threads open. I consider that not constructive.
 
Old 01-12-2020, 04:10 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by ozstar View Post
Hi,

It did work fine and got tot eh Apache page and then I disabled 000-default.conf to activate other .conf sites I did for other outside LAN IP's and dom names.

Outside IPs and dom names work fine now. I can get to the sites folder index but when I try localhost it does not resolve.

I can ping localhost okay.

What could I have done to do this/

Thanks

oz
Your question makes me scratch my head. localhost doesn't resolve, but you can ping it? There is a contradiction in this statement. Names resolve to IP addresses, therefore 127.0.0.1 is already resolved.

What used to work fine? What doesn't work fine now?

I think you should reword your question. At this point, I don't know what your problem is.
 
Old 01-12-2020, 08:35 AM   #4
kermitdafrog8
Member
 
Registered: Dec 2018
Location: Orlando, FL
Distribution: Slackware AARCH64 and X86_64
Posts: 339

Rep: Reputation: Disabled
Localhost or 127.0.0.1 do not resolve

his apache server is blocking localhost connection it sounds like.
 
Old 01-12-2020, 08:36 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Moving this to Server.

The way the question is written, it does appear to be a fragment associated with other questions you've asked.

Perhaps it would be more efficient to keep your progress in one thread so that people can see the history of your topic.
 
Old 01-12-2020, 05:22 PM   #6
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Sorry.. I understand what your saying about the thread flow.

Not sure how it got to that Forum as it was meant for this server thread. I must admit setting up this webserver has has been extremely confusing to me and I guess that has flowed out here to my questions. Anyway back to..

At the start I was able to get to the Apache2 default page thru 'localhost' but I then started adding my own site .conf files to 'sites-available' and read somewhere on a forum or tutorial that I had to disable the 000-default.conf page with a2dissite 000-default.conf, otherwise my outside LAN IPs would not resolve correctly and I would always end up at that Apache page.

That seems to be correct as many of my sites did go to the default, not to their own folder index.html

I disabled it and later noticed that and my IPs were resolving where they should be except the ones I had done incorrectly and they landed on a 'Not Found' page which I thought was normal

When I entered localhost in the browser I got a 404.

Because of this, I questioned whether it was in fact normal for the 000-default to be disabled when I had other sites enabled.

Since posting about this, I have re-enabled the 000-default.conf page with a2ensite 000-default.conf and I am once again able to see that Apache default page in localhost.

I also see that I am still able to see my outslde LAN IP's which have been fully set up correctly those that have't been fully done, I do end up at the Apache default page which I guess is correct.

Other than getting it right, I am doing a new tutorial of how to setup a webserver because of so many variations on forums and websites out there and want to be sure I tell it correctly.

Sorry about the waste of oxygen here but want it clear what my question is and why I ask it..

Should 00-defaulty.conf be enabled so that localhost does work, when one has many other site .conf files ?

Thank you

Last edited by ozstar; 01-12-2020 at 06:04 PM.
 
Old 01-12-2020, 06:38 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
If you need access to the web server via localhost, you must have a corresponding Listen directive in one or more of the conf files, for example Listen 127.0.0.1:80. It doesn't matter whether the Listen directive is in 000-default.conf or another file. In your case though, it appears that the only file that configures Listen on localhost is 000-default.conf.

If you don't want to poke around in configuration files, perhaps your solution is a tool that manages the server via a GUI, such as webmin. However, you may have to buy ease of Apache management with the complexity of setting up webmin. I don't know whether this is worth your while.

In my mind, the real solution is to start learning Apache from the beginning. Use Ubuntu-centric tutorials, as the setup may be quite different on other distros. I also encourage you to read the getting started document at the Apache web site, but I am afraid it is currently overkill for you. I stumbled on a very simple and short tutorial, and the one by Carla Schroeder should be useful as well.

Last edited by berndbausch; 01-12-2020 at 06:45 PM.
 
Old 01-12-2020, 09:18 PM   #8
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
I do thank you for your time and suggestions.

You have been most helpful and I will follow through as much as this old brain can... :-)

oz
 
Old 01-12-2020, 10:33 PM   #9
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Hi again,

I have a QNAP NAS TS231P which we access through.. myname.myqnapcloud.com when out of the office away from the LAN.

When I enter that address from outside the LAN we would normally get the NAS okay, but since I have setup the Linux webserver, it resolves at the apache default page page.

It is using the same static IP as the webserver and I am sure I have to set up a .conf file for it however I am unsure how to do this.

I have tried to setup a .conf file in sites-available with this inside as I was unsure what else to do.

ServerName myname.myqnapcloud.com.conf
DocumentRoot 192.168.20.13 (which is its LAN IP)

I did the a2ensite and systemctl commands but it still resolves at the apache page. Obviously not redirected to the nAAS

I know this may not be exactly about the server but are there any suggestions how I can get access to the NAS not the default page.

Thanks
 
Old 01-13-2020, 10:12 PM   #10
ozstar
Member
 
Registered: Oct 2003
Location: Sydney OZ
Distribution: Ubuntu 20.04LTS, Zorin 16.2 Pro
Posts: 143

Original Poster
Rep: Reputation: 15
Hi,

I re-enabled the 000-default.conf file in sites-available and now all is fine as far as seeing my doms from the net.

Through the browser I can get the web files from my net IP or dom name, but if the index files are not in the server folder or they are not configured correctly, I get to the Apache Page.

So after all this time.. It is done.. That part of it anyway.

Other part was getting to the NAS. Because it is 443 SSL in Pt Fwd, I had to do https:// instead of the http:// I was doing. So simple !

Onward and upward they say... :-)

Last edited by ozstar; 01-13-2020 at 10:30 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Clock skew detected" and 127.127.1.0 in ntp.conf Win32.Neshto Linux - Software 5 03-01-2011 03:15 PM
can't use 127.0.0.1 or 127.0.0.2 Mufasa Linux - Software 2 08-22-2008 08:35 AM
Sendmail : relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refuse macadam Linux - Software 0 09-23-2007 02:44 PM
mailer=relay, pri=30008, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Con pralhad Linux - Software 1 08-11-2007 10:49 AM
DSN: Data format error & relay=[127.0.0.1] [127.0.0.1] calmbomb Linux - Software 0 11-07-2004 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration