LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2019, 11:32 AM   #1
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Rep: Reputation: Disabled
Unhappy Weird problem with apache2


I just installed apache2 on my virtual machine with the following specs:


Linux version 4.18.0-16-generic (buildd@lcy01-amd64-006) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019

After installing I can type localhost into my firefox browser and get the Apache2 Ubuntu default page indicating I have installed it correctly.

However, when trying to use another url with apache2 (test.dev) I get the following error:

Secure Connection Failed

The connection to the server was reset while the page was loading.

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

Nevertheless, I can ping test.dev and it goes right to my localhost address(127.0.0.1).

Here is the code I have in my /etc/apache2/sites-available/test.dev.conf file:

<VirtualHost *:80>
ServerName test.dev
ServerAdmin als20@protonmail.com
DocumentRoot /var/www/test



ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Does anybody recognize anything wrong with this code or could the problem be with the browser or perhaps something else?
 
Old 03-22-2019, 12:17 PM   #2
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
The browser isn't the issue

I guess I should've done this before posting put I just installed opera and I got a similar error.
 
Old 03-22-2019, 12:47 PM   #3
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Andrew Stallard View Post
I just installed apache2 on my virtual machine with the following specs:


Linux version 4.18.0-16-generic (buildd@lcy01-amd64-006) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019

After installing I can type localhost into my firefox browser and get the Apache2 Ubuntu default page indicating I have installed it correctly.

However, when trying to use another url with apache2 (test.dev) I get the following error:

Secure Connection Failed

The connection to the server was reset while the page was loading.

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

Nevertheless, I can ping test.dev and it goes right to my localhost address(127.0.0.1).

Here is the code I have in my /etc/apache2/sites-available/test.dev.conf file:

<VirtualHost *:80>
ServerName test.dev
ServerAdmin als20@protonmail.com
DocumentRoot /var/www/test



ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined



</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Does anybody recognize anything wrong with this code or could the problem be with the browser or perhaps something else?
Have you reviewed the logs?
And, if you use code tags for config that makes it easier to read.
 
Old 03-22-2019, 12:58 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Also (using [code] tags) Please post the contents of /etc/hosts and /etc/resolv.conf
 
Old 03-22-2019, 04:14 PM   #5
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
is that you real email address? you might want to remove that (and dc.901 also).
 
Old 03-22-2019, 05:55 PM   #6
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by ondoho View Post
is that you real email address? you might want to remove that (and dc.901 also).
Thanks for checking! "dc.901" is not my email prefix. I am not sure if that is what you are referring to?
 
Old 03-22-2019, 06:24 PM   #7
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Also (using [code] tags) Please post the contents of /etc/hosts and /etc/resolv.conf
My /etc/resolv.conf file is:

Code:
 nameserver 127.0.0.53
 18 options edns0
My /etc/hosts file is:

Code:
 127.0.0.1 localhost test.shit
  122.0.0.1   test.shit
  127.0.1.1 andrew-VirtualBox
  
   # The following lines are desirable for IPv6 capable hosts
   ::1     ip6-localhost ip6-loopback
   fe00::0 ip6-localnet
   ff00::0 ip6-mcastprefix
   ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
I was advised on another forum that Google owned the top-level domain .dev so I would not be able to use that domain without an SSL certificate so I changed my top-level domain to something that nobody could ever want and I still get the same error.
 
Old 03-22-2019, 06:25 PM   #8
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
is that you real email address? you might want to remove that (and dc.901 also).
It's a throwaway address I use for these purposes.

Thanks anyway
 
Old 03-22-2019, 07:08 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by Andrew Stallard View Post
My /etc/resolv.conf file is:

Code:
 nameserver 127.0.0.53
 18 options edns0
My /etc/hosts file is:

Code:
 127.0.0.1 localhost test.shit
  122.0.0.1   test.shit
  127.0.1.1 andrew-VirtualBox
  
   # The following lines are desirable for IPv6 capable hosts
   ::1     ip6-localhost ip6-loopback
   fe00::0 ip6-localnet
   ff00::0 ip6-mcastprefix
   ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
I was advised on another forum that Google owned the top-level domain .dev so I would not be able to use that domain without an SSL certificate so I changed my top-level domain to something that nobody could ever want and I still get the same error.
Inside your network, and certainly within a single host, you can name your server anything you want, but yes, test.dev is a real domain name apparently owned by google, so if your name server is using the worlds real DNS, you'd be connection to that server.

But you said a ping of test.dev (now test.shit?) resolved to localhost, and it looks like you have your test.shit also pointing to localhost. Not sure why it's also pointing to 122.0.0.1...that's a real IP address owned by Ministry of Foreign Affairs in Thailand.

I'm also not sure what happens if one points the same name to two different IPs in /etc/hosts. I think the first one "wins", but I just don't know.
 
Old 03-22-2019, 08:03 PM   #10
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Inside your network, and certainly within a single host, you can name your server anything you want, but yes, test.dev is a real domain name apparently owned by google, so if your name server is using the worlds real DNS, you'd be connection to that server.

But you said a ping of test.dev (now test.shit?) resolved to localhost, and it looks like you have your test.shit also pointing to localhost. Not sure why it's also pointing to 122.0.0.1...that's a real IP address owned by Ministry of Foreign Affairs in Thailand.

I'm also not sure what happens if one points the same name to two different IPs in /etc/hosts. I think the first one "wins", but I just don't know.
It gets curiouser and curiouser..

When I change that ip address in my /etc/hosts file to 127.0.0.1 or else comment it out I can't access at all. (It's file not found, not secure connection error.). However, in either case I am still able to ping the address test.shit which returns my localhost ip address 127.0.0.1 without interruption.

I am looking at the error log files to see what I can do with that information.

Thank you for your support.
 
Old 03-22-2019, 09:03 PM   #11
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by dc.901 View Post
Have you reviewed the logs?
And, if you use code tags for config that makes it easier to read.
In the error.txt file in the apache2 logs, I was getting this message:

Code:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Thu Mar 21 21:37:46.211276 2019] [mpm_event:notice] [pid 32552:tid 140149875088320] AH00489: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
Looking around the internet I discovered that a possible solution was to add the line

ServerName localhost

to the apache2.conf file. I did this; the problem persists. However, the error.txt file has slightly different messages, such as:

Code:
[Fri Mar 22 21:43:29.195814 2019] [mpm_event:notice] [pid 11588:tid 139778524482496] AH00489: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Mar 22 21:43:29.196118 2019] [core:notice] [pid 11588:tid 139778524482496] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 22 21:47:42.136468 2019] [mpm_event:notice] [pid 11588:tid 139778524482496] AH00491: caught SIGTERM, shutting down
[Fri Mar 22 21:47:42.367673 2019] [mpm_event:notice] [pid 11694:tid 140467604179904] AH00489: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Fri Mar 22 21:47:42.368024 2019] [core:notice] [pid 11694:tid 140467604179904] AH00094: Command line: '/usr/sbin/apache2'
Most of these just involve the stopping and re-starting of the service, I believe. So, I'm still at a loss.

Thank You.
 
Old 03-22-2019, 09:23 PM   #12
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by Andrew Stallard View Post
It gets curiouser and curiouser..

When I change that ip address in my /etc/hosts file to 127.0.0.1 or else comment it out I can't access at all. (It's file not found, not secure connection error.). However, in either case I am still able to ping the address test.shit which returns my localhost ip address 127.0.0.1 without interruption.

I am looking at the error log files to see what I can do with that information.

Thank you for your support.
Progress! You’ve connected but the Apache configuration is trying to serve a file that doesn’t exist...

What’s in /var/www/test ?
 
1 members found this post helpful.
Old 03-23-2019, 09:38 AM   #13
Andrew Stallard
Member
 
Registered: Nov 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Progress! You’ve connected but the Apache configuration is trying to serve a file that doesn’t exist...

What’s in /var/www/test ?
Yes, I got a blank screen when accessing test.shit!

In the file /var/www/test there is a single php file. (I have a new issue with php, it appears.)

I changed it to an html file and was able to get it to work just fine.
 
Old 03-23-2019, 11:01 AM   #14
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by Andrew Stallard View Post
Yes, I got a blank screen when accessing test.shit!

In the file /var/www/test there is a single php file. (I have a new issue with php, it appears.)

I changed it to an html file and was able to get it to work just fine.
What is your DirectoryIndex set to? See the documentation.
The server won't server php files natively unless you tell it to.
 
Old 03-24-2019, 10:59 AM   #15
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
Quote:
Originally Posted by dc.901 View Post
Thanks for checking! "dc.901" is not my email prefix. I am not sure if that is what you are referring to?
you quoted op's email address.

but no matter, it seems they don't mind.
 
  


Reply

Tags
apache2conf, browser



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
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 08:09 PM
Weird, weird problem nonades Slackware 2 10-11-2006 11:45 AM
HP Photosmart weird weird weird.... Vlad_M Linux - General 5 02-20-2005 05:41 AM
Weird, weird apache2 problem atheist Debian 1 09-17-2004 08:26 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:41 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