WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12457 closed defect (bug) (fixed)

Using localhost without VHOST should be allowed for MS sites

Reported by: Denis-de-Bernardy Owned by: nacin
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Multisite Keywords: has-patch needs-testing featured
Focuses: Cc:

Description

I recall managing to have made WPMU work in such a setup, using IIS on a Windows box. I fail to see why an Apache Box running on a Mac can't do as much.

Attachments (1)

12457.diff (2.8 KB) - added by Denis-de-Bernardy 4 years ago.
first pass: allow to install MS in localhost/~denis/wp-trunk/

Download all attachments as: .zip

Change History (16)

Denis-de-Bernardy4 years ago

first pass: allow to install MS in localhost/~denis/wp-trunk/

comment:1 Denis-de-Bernardy4 years ago

  • Keywords has-patch added

comment:2 Denis-de-Bernardy4 years ago

  • Keywords needs-testing added

Tested on MacOS X/Apache, I'm not running into any issues (beyond the bugs I'm reporting) while playing around with the network options.

Needs testing by a few more devs.

comment:3 nacin4 years ago

What's wrong with localhost.localdomain?

comment:4 Denis-de-Bernardy4 years ago

  • Keywords featured added

comment:5 westi4 years ago

This sounds like a reasonable idea.

It would be great to have an easy way to test on localhost for subdir multisite installs.

comment:6 nacin4 years ago

I agree. Unless I'm missing something, the only reason is for subdomain installs, in which case this looks good.

comment:7 nacin4 years ago

  • Owner set to nacin
  • Status changed from new to reviewing

Apparently, the historical reason for blocking localhost lies with cookie domains. I briefly looked through the code and did not see this to be a problem at this point.

I have a refreshed patch already running locally, so I'll kick the tires a bit more on this.

comment:8 nacin4 years ago

  • Status changed from reviewing to accepted

Some notes:

First, http://trac.mu.wordpress.org/ticket/182, from 2006.

Second, I ran into some cookie problems converting a localhost.localdomain install to localhost. But a fresh install performed great. (I probably missed something I needed to change in the DB in the conversion attempt.)

I'm going to commit some improvements and also my patch. If we find it has problems, we can revert.

comment:9 nacin4 years ago

Actually, I forgot -- I did have to make a modification to the constant definitions to make it work.

comment:10 nacin4 years ago

(In [13622]) Allow localhost in a multisite subdirectory install. More network.php improvements. see #12457 for localhost. see #11816

comment:11 follow-up: nacin4 years ago

I'm thinking we can abstract this out further and check for the lack of a period in the hostname, instead of == 'localhost'. Necessary?

comment:12 in reply to: ↑ 11 ; follow-up: Denis-de-Bernardy4 years ago

Replying to nacin:

I'm thinking we can abstract this out further and check for the lack of a period in the hostname, instead of == 'localhost'. Necessary?

that would be slower. are there any benefits for doing so?

comment:13 in reply to: ↑ 12 nacin4 years ago

Replying to Denis-de-Bernardy:

Replying to nacin:
that would be slower. are there any benefits for doing so?

Slower? Marginally. The benefit is we would catch the rare local hostname that isn't localhost but also doesn't support subdomains.

comment:14 wpmuguru4 years ago

(In [13707]) fix warning on cookie_domain, see #12457

comment:15 nacin4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

Re-open if any other bugs are found in testing.

Note: See TracTickets for help on using tickets.