Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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 ?
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.
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.
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 !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.