You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by gh...@hushmail.com on 2015/01/03 01:52:33 UTC

[users@httpd] Virtual Hosting: One website doesn't work.

Hello,

Running Ubuntu 14.04 LTS on a Digital Ocean droplet.  This machine is running Apache/2.4.10

The /etc/apache2/apache2.conf has never been modified and is hosting a number of sites.  But there is one site that is does not load at all:

$ telnet example.com 80
Trying 104.236.25.70...
Connected to example.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: www.example.com

HTTP/1.1 301 Moved Permanently
Date: Sat, 03 Jan 2015 00:45:03 GMT
Server: Apache/2.4.10 (Ubuntu)
X-Powered-By: PHP/5.5.12-2ubuntu4.1
X-Pingback: http://example.com/xmlrpc.php
Location: http://example.com/
Content-Length: 0
Content-Type: text/html; charset=UTF-8

Connection closed by foreign host.

What is quite perplexing, is that I go to sites-available and copy the example.org to example.com and modify the ServerName and DocumentRoot fields to the correct data.  After enabling, reloading, I still get the same results.  I should mention that example.org works perfectly fine.  I verified that DocumentRoot belongs to www-data, recursively.

So why?  I've never had this happen before. 


In case you need it...

Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)


Thank you all very much.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Freek de Kruijf <f....@gmail.com>.
Op zaterdag 3 januari 2015 21:35:32 schreef ghalvors78@hushmail.com:
> When I perform the telnet 80 test, I get a "501 Not Implemented", but the
> wget command pulls the index.html correctly.  I never trust a web browser
> when diagnosing a web page because they like to cache web files.  I used
> telnet to simulate a web browser request, as explained in a blog, but it is
> apparently wrong...

When you use "telnet something 80" that something, when it is a name, does not 
appear in the communication with your web server, only the IP address is used, 
which is needed to end up in a named virtual host. So in this case you always 
ends up in the default web site of your apache configuration.
When you use wget something/... that something, when it is a name, will appear 
in the communication and apache will use that name to find the named virtual 
host.

When testing different virtual named hosts on the same system I define these 
names, like example.com, www.example.com, etc. in /etc/hosts pointing to 
127.0.0.1. You can always use the reconnect icon of the web browser to get a 
fresh version of the page you are accessing. Never had any problem with that.

-- 
fr.gr.

Freek de Kruijf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Noel Butler <no...@ausics.net>.
 

get rid of wordpress and anything else, install a temp placeholder
index.html file, get it working with basics before expanding, if that
works, then your problem is wordpress and you should take it up with
their lists/forums/newsgroups 

On 04/01/2015 12:35, ghalvors78@hushmail.com wrote: 

> On January 3, 2015 at 9:09 PM, "Stormy" <st...@stormy.ca> wrote:
> At 08:40 PM 1/3/2015 -0500, ghalvors78@hushmail.com wrote: [snip] I'm not sure why these two behave differently (www.example.com [1] vs example.com) I always thought the extra four letters were something that Apache knew how to deal with. It's hard to guarantee that the user will user type or omit the 'www.' What should be done about this? ServerAlias ?

It was undefined. I thought I would implement it according to online
documentation. I retyped an equivalent excerpt from my sites-available
directory.

ServerName www.example.com [1]
ServerAlias example.com
DocumentRoot /var/www/example.com/ht-docs/

When I perform the telnet 80 test, I get a "501 Not Implemented", but
the wget command pulls the index.html correctly. I never trust a web
browser when diagnosing a web page because they like to cache web files.
I used telnet to simulate a web browser request, as explained in a blog,
but it is apparently wrong...

This is the offending article I used, by the way.

http://www.the-art-of-web.com/system/telnet-http11/ [2]

> Best -- Paul ------------------------------------------------------------------- -- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

 

Links:
------
[1] http://www.example.com
[2] http://www.the-art-of-web.com/system/telnet-http11/

Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.
Classify this thread resolved.  I didn't know that HTTP was case sensitive, and that resulted in inconsistent behavior.  Just as I was about to call a priest to exorcize a virtual machine.

* It appears that adding ServerAlias corrected the behavior.

* It is true that misuse of the telnet www.example.com 80 as a testing method led to misleading results.

Thanks all for the help.  Things are up and running as they should be.  This is soooo going into my blog.


On January 4, 2015 at 9:00 AM, "Zimmi" <zi...@gmail.com> wrote:
>
>Hi,
>
> From the 501 Not implemented and from some of your telnet 
>sessions 
>copies, I see you use also "get / http/1.1" but beware, HTTP is 
>case 
>sensitive, and you should use "GET / HTTP/1.1". This would explain 
>why 
>wget gets your resource correctly but you can't get it through 
>telnet.
>
>Hope this help!
>Zimmi
>
>Le 04.01.2015 03:35, ghalvors78@hushmail.com a écrit :
>>
>> On January 3, 2015 at 9:09 PM, "Stormy" <st...@stormy.ca> 
>wrote:
>>> At 08:40 PM 1/3/2015 -0500, ghalvors78@hushmail.com wrote:
>>> [snip]
>>>> I'm not sure why these two behave differently (www.example.com 
>vs
>>>> example.com) I always thought the extra four letters were
>>> something that
>>>> Apache knew how to deal with.  It's hard to guarantee that the
>>> user will
>>>> user type or omit the 'www.'  What should be done about this?
>>> ServerAlias ?
>> It was undefined.  I thought I would implement it according to 
>online documentation.  I retyped an equivalent excerpt from my 
>sites-available directory.
>>
>> ServerName www.example.com
>> ServerAlias example.com
>> DocumentRoot /var/www/example.com/ht-docs/
>>
>> When I perform the telnet 80 test, I get a "501 Not 
>Implemented", but the wget command pulls the index.html correctly. 
> I never trust a web browser when diagnosing a web page because 
>they like to cache web files.  I used telnet to simulate a web 
>browser request, as explained in a blog, but it is apparently 
>wrong...
>>
>> This is the offending article I used, by the way.
>>
>> http://www.the-art-of-web.com/system/telnet-http11/
>>
>>
>>> Best -- Paul
>>>
>>>
>>> ----------------------------------------------------------------
>---
>>> --
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>> -----------------------------------------------------------------
>----
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Zimmi <zi...@gmail.com>.
Hi,

 From the 501 Not implemented and from some of your telnet sessions 
copies, I see you use also "get / http/1.1" but beware, HTTP is case 
sensitive, and you should use "GET / HTTP/1.1". This would explain why 
wget gets your resource correctly but you can't get it through telnet.

Hope this help!
Zimmi

Le 04.01.2015 03:35, ghalvors78@hushmail.com a écrit :
>
> On January 3, 2015 at 9:09 PM, "Stormy" <st...@stormy.ca> wrote:
>> At 08:40 PM 1/3/2015 -0500, ghalvors78@hushmail.com wrote:
>> [snip]
>>> I'm not sure why these two behave differently (www.example.com vs
>>> example.com) I always thought the extra four letters were
>> something that
>>> Apache knew how to deal with.  It's hard to guarantee that the
>> user will
>>> user type or omit the 'www.'  What should be done about this?
>> ServerAlias ?
> It was undefined.  I thought I would implement it according to online documentation.  I retyped an equivalent excerpt from my sites-available directory.
>
> ServerName www.example.com
> ServerAlias example.com
> DocumentRoot /var/www/example.com/ht-docs/
>
> When I perform the telnet 80 test, I get a "501 Not Implemented", but the wget command pulls the index.html correctly.  I never trust a web browser when diagnosing a web page because they like to cache web files.  I used telnet to simulate a web browser request, as explained in a blog, but it is apparently wrong...
>
> This is the offending article I used, by the way.
>
> http://www.the-art-of-web.com/system/telnet-http11/
>
>
>> Best -- Paul
>>
>>
>> -------------------------------------------------------------------
>> --
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.

On January 3, 2015 at 9:09 PM, "Stormy" <st...@stormy.ca> wrote:
>
>At 08:40 PM 1/3/2015 -0500, ghalvors78@hushmail.com wrote:
>[snip]
>>I'm not sure why these two behave differently (www.example.com vs 
>>example.com) I always thought the extra four letters were 
>something that 
>>Apache knew how to deal with.  It's hard to guarantee that the 
>user will 
>>user type or omit the 'www.'  What should be done about this?
>
>ServerAlias ?

It was undefined.  I thought I would implement it according to online documentation.  I retyped an equivalent excerpt from my sites-available directory.

ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example.com/ht-docs/

When I perform the telnet 80 test, I get a "501 Not Implemented", but the wget command pulls the index.html correctly.  I never trust a web browser when diagnosing a web page because they like to cache web files.  I used telnet to simulate a web browser request, as explained in a blog, but it is apparently wrong...

This is the offending article I used, by the way.

http://www.the-art-of-web.com/system/telnet-http11/


>
>Best -- Paul 
>
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Stormy <st...@stormy.ca>.
At 08:40 PM 1/3/2015 -0500, ghalvors78@hushmail.com wrote:
[snip]
>I'm not sure why these two behave differently (www.example.com vs 
>example.com) I always thought the extra four letters were something that 
>Apache knew how to deal with.  It's hard to guarantee that the user will 
>user type or omit the 'www.'  What should be done about this?

ServerAlias ?

Best -- Paul 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Noel Butler <no...@ausics.net>.
 

and the httpd vhost conf details are? 

please dont say standard, there is nothing standard about how ubuntu
names httpd's files and dirs 

On 04/01/2015 12:19, ghalvors78@hushmail.com wrote: 

> Okay, it occurred to me that I never at any point expected the file xmlprc.php to load automatically. I would have guessed something like an index.php or index.html to load instead. I reinstalled wordpress, but that seemed to make no difference.
> 
> All that is in my DocumentRoot directory is a single index.html, and that doesn't even load. I'm starting to wonder if this particular domain name is somehow tainted since the other sites seem to work just fine.
> 
> What I noticed that is particularly weird is that my method for testing seems to be flawed. According to my method for testing via telnet gives the same results for all my sites, whereas testing with wget on my other site returns the correct page. So the lines of "get / http/1.1", "Host: example.com" seem to be an inaccurate test. Nothing is as it seems. I really thought I understood how this webserver works... I'm totally at a loss of explanation of why it just doesn't work; this shouldn't be so hard.
> 
> So I did a 'wget example.info' and I get the correct webpage. I follow the same approach via telnet on port 80, as seen below, I get totally different results. What is wrong with this test that would give a different result from wget?
> 
> $ telnet example.info 80
> Trying 104.236.xxx.yyy...
> Connected to example.info.
> Escape character is '^]'.
> get / http/1.1
> host: www.example.info [1]
> 
> HTTP/1.1 501 Not Implemented
> Date: Sun, 04 Jan 2015 02:05:32 GMT
> Server: Apache/2.4.10 (Ubuntu)
> Allow: GET,HEAD,POST,OPTIONS
> Content-Length: 282
> Connection: close
> Content-Type: text/html; charset=iso-8859-1
> 
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>501 Not Implemented</title>
> </head><body>
> <h1>Not Implemented</h1>
> <p>get to /index.html not supported.<br />
> </p>
> <hr>
> <address>Apache/2.4.10 (Ubuntu) Server at www.example.info [1] Port 80</address>
> </body></html>
> Connection closed by foreign host.
> 
> $ telnet example.info 80
> Trying 104.236.xxx.yyy...
> Connected to example.info.
> Escape character is '^]'.
> get / http/1.1
> host: example.info
> 
> HTTP/1.1 301 Moved Permanently
> Date: Sun, 04 Jan 2015 02:06:01 GMT
> Server: Apache/2.4.10 (Ubuntu)
> Location: http://www.example.info// [2]
> Content-Length: 309
> Content-Type: text/html; charset=iso-8859-1
> 
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>301 Moved Permanently</title>
> </head><body>
> <h1>Moved Permanently</h1>
> <p>The document has moved <a href="http://www.example.info// [2]">here</a>.</p>
> <hr>
> <address>Apache/2.4.10 (Ubuntu) Server at example.info Port 80</address>
> </body></html>
> Connection closed by foreign host.
> 
> On January 3, 2015 at 8:40 PM, ghalvors78@hushmail.com wrote:
> On January 3, 2015 at 7:36 PM, "Nick Kew" <ni...@webthing.com> wrote: On Sat, 03 Jan 2015 12:19:38 -0500 ghalvors78@hushmail.com wrote: I'm making a guess here. Are you asking whether I assign Host: as being example.com or www.example.com? [3] Here's the script from each. They are slightly different, but the result is the same. Not actually the same ...
 Yes, I noticed that. I noticed the difference later on in composing the
message, but forgot to modify the first sentence during proofreading. 

>> $ telnet www.example.com [4] 80 Trying 104.236.xxx.yyy... Connected to example.com. Escape character is '^]'. get / http/1.1 Host: www.example.com [4] HTTP/1.0 301 Moved Permanently Date: Sat, 03 Jan 2015 17:07:37 GMT Server: Apache/2.4.10 (Ubuntu) X-Powered-By: PHP/5.5.12-2ubuntu4.1 X-Pingback: http://example.com/xmlrpc.php [5] Location: http://example.com/ [6] Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8
> That redirect is issued by your PHP script. 
> 
>> $ telnet www.example.com [4] 80 Trying 104.236.xxx.yyy... Connected to example.com. Escape character is '^]'. GET / HTTP/1.1 Host: example.com HTTP/1.1 301 Moved Permanently Date: Sat, 03 Jan 2015 17:06:38 GMT Server: Apache/2.4.10 (Ubuntu) Location: http://www.example.com// [7] Content-Length: 317 Content-Type: text/html; charset=iso-8859-1
> ... whereas that looks like a server redirection with a stray extra slash, and is probably generated from your apache configuration. Decide which you want to use, then configure your server and your PHP to agree on it.
 That file, xmlprc.php is something generated by wordpress. I'm in no
way familiar with how wordpress works. So this may be a wordpress
configuration issue. The simplest may be to reinstall wordpress and hope
it works. I'm not sure why these two behave differently (www.example.com
[4] vs example.com) I always thought the extra four letters were
something that Apache knew how to deal with. It's hard to guarantee that
the user will user type or omit the 'www.' What should be done about
this? 

> -- Nick Kew ------------------------------------------------------------------
 - 

> -- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org
 ------------------------------------------------------------------- --
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For
additional commands, e-mail: users-help@httpd.apache.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

 

Links:
------
[1] http://www.example.info
[2] http://www.example.info//
[3] http://www.example.com?
[4] http://www.example.com
[5] http://example.com/xmlrpc.php
[6] http://example.com/
[7] http://www.example.com//

Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.
Okay, it occurred to me that I never at any point expected the file xmlprc.php to load automatically.  I would have guessed something like an index.php or index.html to load instead.  I reinstalled wordpress, but that seemed to make no difference.

All that is in my DocumentRoot directory is a single index.html, and that doesn't even load.  I'm starting to wonder if this particular domain name is somehow tainted since the other sites seem to work just fine.

What I noticed that is particularly weird is that my method for testing seems to be flawed.  According to my method for testing via telnet gives the same results for all my sites, whereas testing with wget on my other site returns the correct page.  So the lines of "get / http/1.1", "Host: example.com" seem to be an inaccurate test.  Nothing is as it seems.  I really thought I understood how this webserver works...  I'm totally at a loss of explanation of why it just doesn't work; this shouldn't be so hard.

So I did a 'wget example.info' and I get the correct webpage.  I follow the same approach via telnet on port 80, as seen below, I get totally different results.  What is wrong with this test that would give a different result from wget?

$ telnet example.info 80
Trying 104.236.xxx.yyy...
Connected to example.info.
Escape character is '^]'.
get / http/1.1
host: www.example.info

HTTP/1.1 501 Not Implemented
Date: Sun, 04 Jan 2015 02:05:32 GMT
Server: Apache/2.4.10 (Ubuntu)
Allow: GET,HEAD,POST,OPTIONS
Content-Length: 282
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Not Implemented</title>
</head><body>
<h1>Not Implemented</h1>
<p>get to /index.html not supported.<br />
</p>
<hr>
<address>Apache/2.4.10 (Ubuntu) Server at www.example.info Port 80</address>
</body></html>
Connection closed by foreign host.


$ telnet example.info 80
Trying 104.236.xxx.yyy...
Connected to example.info.
Escape character is '^]'.
get / http/1.1
host: example.info

HTTP/1.1 301 Moved Permanently
Date: Sun, 04 Jan 2015 02:06:01 GMT
Server: Apache/2.4.10 (Ubuntu)
Location: http://www.example.info//
Content-Length: 309
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.example.info//">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Ubuntu) Server at example.info Port 80</address>
</body></html>
Connection closed by foreign host.



On January 3, 2015 at 8:40 PM, ghalvors78@hushmail.com wrote:
>
>On January 3, 2015 at 7:36 PM, "Nick Kew" <ni...@webthing.com> 
>wrote:
>>
>>On Sat, 03 Jan 2015 12:19:38 -0500
>>ghalvors78@hushmail.com wrote:
>>
>>> I'm making a guess here.  Are you asking whether I assign Host: 
>>as being example.com or www.example.com?  Here's the script from 
>>each.  They are slightly different, but the result is the same.
>>
>>Not actually the same ...
>
>Yes, I noticed that. I noticed the difference later on in 
>composing the message, but forgot to modify the first sentence 
>during proofreading.
>
>>
>>> 
>>> $ telnet www.example.com 80
>>> Trying 104.236.xxx.yyy...
>>> Connected to example.com.
>>> Escape character is '^]'.
>>> get / http/1.1
>>> Host: www.example.com
>>> 
>>> HTTP/1.0 301 Moved Permanently
>>> Date: Sat, 03 Jan 2015 17:07:37 GMT
>>> Server: Apache/2.4.10 (Ubuntu)
>>> X-Powered-By: PHP/5.5.12-2ubuntu4.1
>>> X-Pingback: http://example.com/xmlrpc.php
>>> Location: http://example.com/
>>> Content-Length: 0
>>> Connection: close
>>> Content-Type: text/html; charset=UTF-8
>>
>>That redirect is issued by your PHP script.
>>
>>> $ telnet www.example.com 80
>>> Trying 104.236.xxx.yyy...
>>> Connected to example.com.
>>> Escape character is '^]'.
>>> GET / HTTP/1.1
>>> Host: example.com
>>> 
>>> HTTP/1.1 301 Moved Permanently
>>> Date: Sat, 03 Jan 2015 17:06:38 GMT
>>> Server: Apache/2.4.10 (Ubuntu)
>>> Location: http://www.example.com//
>>> Content-Length: 317
>>> Content-Type: text/html; charset=iso-8859-1
>>
>>... whereas that looks like a server redirection
>>with a stray extra slash, and is probably generated
>>from your apache configuration.
>>
>>Decide which you want to use, then configure your server
>>and your PHP to agree on it.
>>
>
>That file, xmlprc.php is something generated by wordpress.  I'm in 
>no way familiar with how wordpress works.  So this may be a 
>wordpress configuration issue.  The simplest may be to reinstall 
>wordpress and hope it works.  I'm not sure why these two behave 
>differently (www.example.com vs example.com) I always thought the 
>extra four letters were something that Apache knew how to deal 
>with.  It's hard to guarantee that the user will user type or omit 
>the 'www.'  What should be done about this?
>
>>-- 
>>Nick Kew
>>
>>------------------------------------------------------------------
>-
>>--
>>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>For additional commands, e-mail: users-help@httpd.apache.org
>
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.

On January 3, 2015 at 7:36 PM, "Nick Kew" <ni...@webthing.com> wrote:
>
>On Sat, 03 Jan 2015 12:19:38 -0500
>ghalvors78@hushmail.com wrote:
>
>> I'm making a guess here.  Are you asking whether I assign Host: 
>as being example.com or www.example.com?  Here's the script from 
>each.  They are slightly different, but the result is the same.
>
>Not actually the same ...

Yes, I noticed that. I noticed the difference later on in composing the message, but forgot to modify the first sentence during proofreading.

>
>> 
>> $ telnet www.example.com 80
>> Trying 104.236.xxx.yyy...
>> Connected to example.com.
>> Escape character is '^]'.
>> get / http/1.1
>> Host: www.example.com
>> 
>> HTTP/1.0 301 Moved Permanently
>> Date: Sat, 03 Jan 2015 17:07:37 GMT
>> Server: Apache/2.4.10 (Ubuntu)
>> X-Powered-By: PHP/5.5.12-2ubuntu4.1
>> X-Pingback: http://example.com/xmlrpc.php
>> Location: http://example.com/
>> Content-Length: 0
>> Connection: close
>> Content-Type: text/html; charset=UTF-8
>
>That redirect is issued by your PHP script.
>
>> $ telnet www.example.com 80
>> Trying 104.236.xxx.yyy...
>> Connected to example.com.
>> Escape character is '^]'.
>> GET / HTTP/1.1
>> Host: example.com
>> 
>> HTTP/1.1 301 Moved Permanently
>> Date: Sat, 03 Jan 2015 17:06:38 GMT
>> Server: Apache/2.4.10 (Ubuntu)
>> Location: http://www.example.com//
>> Content-Length: 317
>> Content-Type: text/html; charset=iso-8859-1
>
>... whereas that looks like a server redirection
>with a stray extra slash, and is probably generated
>from your apache configuration.
>
>Decide which you want to use, then configure your server
>and your PHP to agree on it.
>

That file, xmlprc.php is something generated by wordpress.  I'm in no way familiar with how wordpress works.  So this may be a wordpress configuration issue.  The simplest may be to reinstall wordpress and hope it works.  I'm not sure why these two behave differently (www.example.com vs example.com) I always thought the extra four letters were something that Apache knew how to deal with.  It's hard to guarantee that the user will user type or omit the 'www.'  What should be done about this?

>-- 
>Nick Kew
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Nick Kew <ni...@webthing.com>.
On Sat, 03 Jan 2015 12:19:38 -0500
ghalvors78@hushmail.com wrote:

> I'm making a guess here.  Are you asking whether I assign Host: as being example.com or www.example.com?  Here's the script from each.  They are slightly different, but the result is the same.

Not actually the same ...

> 
> $ telnet www.example.com 80
> Trying 104.236.xxx.yyy...
> Connected to example.com.
> Escape character is '^]'.
> get / http/1.1
> Host: www.example.com
> 
> HTTP/1.0 301 Moved Permanently
> Date: Sat, 03 Jan 2015 17:07:37 GMT
> Server: Apache/2.4.10 (Ubuntu)
> X-Powered-By: PHP/5.5.12-2ubuntu4.1
> X-Pingback: http://example.com/xmlrpc.php
> Location: http://example.com/
> Content-Length: 0
> Connection: close
> Content-Type: text/html; charset=UTF-8

That redirect is issued by your PHP script.

> $ telnet www.example.com 80
> Trying 104.236.xxx.yyy...
> Connected to example.com.
> Escape character is '^]'.
> GET / HTTP/1.1
> Host: example.com
> 
> HTTP/1.1 301 Moved Permanently
> Date: Sat, 03 Jan 2015 17:06:38 GMT
> Server: Apache/2.4.10 (Ubuntu)
> Location: http://www.example.com//
> Content-Length: 317
> Content-Type: text/html; charset=iso-8859-1

... whereas that looks like a server redirection
with a stray extra slash, and is probably generated
from your apache configuration.

Decide which you want to use, then configure your server
and your PHP to agree on it.

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.
I'm making a guess here.  Are you asking whether I assign Host: as being example.com or www.example.com?  Here's the script from each.  They are slightly different, but the result is the same.

$ telnet www.example.com 80
Trying 104.236.xxx.yyy...
Connected to example.com.
Escape character is '^]'.
get / http/1.1
Host: www.example.com

HTTP/1.0 301 Moved Permanently
Date: Sat, 03 Jan 2015 17:07:37 GMT
Server: Apache/2.4.10 (Ubuntu)
X-Powered-By: PHP/5.5.12-2ubuntu4.1
X-Pingback: http://example.com/xmlrpc.php
Location: http://example.com/
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8

Connection closed by foreign host.



$ cat example.com.txt 
$ telnet www.example.com 80
Trying 104.236.xxx.yyy...
Connected to example.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: example.com

HTTP/1.1 301 Moved Permanently
Date: Sat, 03 Jan 2015 17:06:38 GMT
Server: Apache/2.4.10 (Ubuntu)
Location: http://www.example.com//
Content-Length: 317
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.example.com//">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Ubuntu) Server at example.com Port 80</address>
</body></html>
Connection closed by foreign host.


Notice something odd here, might be a clue.  The "Location:" field is assigned with a FQDN appended with '//' which doesn't seem proper to me.  I'm not sure how extra slashes are dealt with in the specification, but that's not something I typically type in when typing URL's into a web browser.


On January 2, 2015 at 10:32 PM, "Eric Covener" <co...@gmail.com> wrote:
>
>On Fri, Jan 2, 2015 at 7:52 PM,  <gh...@hushmail.com> wrote:
>> But there is one site that is does not load at all:
>>
>> $ telnet example.com 80
>> Trying 104.236.xxx.yyy...
>> Connected to example.com.
>> Escape character is '^]'.
>> GET / HTTP/1.1
>> Host: www.example.com
>>
>> Location: http://example.com/
>
>Does example.com work? Have you looked in your configuration to see
>what performs this redirect from www to no-www?
>
>Does it fail only for the hostname of the actual system?
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by gh...@hushmail.com.
I'm not sure what you are asking.  No, it doesn't work.  That was the one I demonstrated in telnet.  I did not get my screen filled with HTML, instead I got an error message.

I actually copied the conf file from a working website and only renamed the ServerName and DocumentRoot, noting else.  The directory, and all subdirectories have the same ownership.

How come I can host seven different websites and have one that fails, even though their conf files differ only in the DocumentRoot and ServerName.  IT seems unusual.  I wouldn't think that I'm hosting too many websites, but 7 is (2^3)-1.  Just kidding there, but sometimes I wonder.
 
On January 2, 2015 at 10:32 PM, "Eric Covener" <co...@gmail.com> wrote:
>
>On Fri, Jan 2, 2015 at 7:52 PM,  <gh...@hushmail.com> wrote:
>> But there is one site that is does not load at all:
>>
>> $ telnet example.com 80
>> Trying 104.236.25.70...
>> Connected to example.com.
>> Escape character is '^]'.
>> GET / HTTP/1.1
>> Host: www.example.com
>>
>> Location: http://example.com/
>
>Does example.com work? Have you looked in your configuration to see
>what performs this redirect from www to no-www?
>
>Does it fail only for the hostname of the actual system?
>
>-------------------------------------------------------------------
>--
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosting: One website doesn't work.

Posted by Eric Covener <co...@gmail.com>.
On Fri, Jan 2, 2015 at 7:52 PM,  <gh...@hushmail.com> wrote:
> But there is one site that is does not load at all:
>
> $ telnet example.com 80
> Trying 104.236.25.70...
> Connected to example.com.
> Escape character is '^]'.
> GET / HTTP/1.1
> Host: www.example.com
>
> Location: http://example.com/

Does example.com work? Have you looked in your configuration to see
what performs this redirect from www to no-www?

Does it fail only for the hostname of the actual system?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org