I discovered the problem while working withe aggregator.module. In version 1.480 of common.inc drupal_http_request() appends the default port number to the URI.

I have a system set up with two domain names running Drupal 4.6.3 sites from a single code tree. One has a configuration subdirectory, the other uses the settings.php file in the default location. The Drupal aggregator, when accessing either of them, connects to the system set up in the default settings.php.

I thought it was a problem with the change to drupal_http_request() but I just tried accessing the site with the configuration subdirectory with a web browser including a port number in the url. I was connected to default site.

Comments

Prometheus6’s picture

Assigned: Unassigned » Prometheus6
Status: Active » Needs review
StatusFileSize
new817 bytes

The problem:

Example for a fictitious site installed at
http://www.drupal.org/mysite/test/
the 'settings.php' is searched in the following directories:

1. $confdir/www.drupal.org.mysite.test
2. $confdir/drupal.org.mysite.test
3. $confdir/org.mysite.test

4. $confdir/www.drupal.org.mysite
5. $confdir/drupal.org.mysite
6. $confdir/org.mysite

7. $confdir/www.drupal.org
8. $confdir/drupal.org
9. $confdir/org

10. $confdir/default

Example for the same site accessed as
http://www.drupal.org:80/mysite/test/
the 'settings.php' is searched in the following directories:

1. $confdir/www.drupal.org.80.mysite.test
2. $confdir/drupal.org.80.mysite.test
3. $confdir/org.80.mysite.test
4. $confdir/80.mysite.test

6. $confdir/www.drupal.org.80.mysite
7. $confdir/drupal.org.80.mysite
8. $confdir/org.80.mysite
9. $confdir/80.mysite

10. $confdir/www.drupal.org.80
11. $confdir/drupal.org.80
13. $confdir/org.80
14. $confdir/80

15. $confdir/default

This patch checks the array created by splitting the $_SERVER['HTTP_HOST'], eliminating the port number if the default port is specified before building the paths to be searched.

This problem exists in 4.6 too. You can get around it with a symbolic link or copying $confdir/SERVER/settings.php to $confdir/SERVER.80/settings.php on Windows systems.

Prometheus6’s picture

StatusFileSize
new875 bytes

Okay, this is the right patch.

drumm’s picture

Status: Needs review » Closed (duplicate)
cog.rusty’s picture

Duplicate or not, after two months the aggregator still only works in the primary site of a multisite.
Cron only triggers the primary site and none of the other sites.

drumm’s picture

Please open a new issue for the cron trouble. Have you tried running cron at the url for each site? Cron is not meant to trigger every site at once.

cog.rusty’s picture

My mistake. I was expecting that one cronjob would be enough. It works fine now.