From ebf0fb5db5e2eaa2e781c8a4829eb268d2fce608 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 6 Aug 2007 11:58:48 +0000 Subject: Make the installer more verbose. Normalise the name (as much as possible) git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1014 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- index-install.php | 97 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 36 deletions(-) (limited to 'index-install.php') diff --git a/index-install.php b/index-install.php index 84753d9..0b30bac 100644 --- a/index-install.php +++ b/index-install.php @@ -9,6 +9,8 @@ if( $_SERVER[ 'HTTP_HOST' ] == 'localhost' ) { } define('WP_INSTALLING', true); +$dirs = array( dirname(__FILE__), dirname(__FILE__) . "/wp-content/" ); + function printheader() { ?> @@ -63,26 +65,13 @@ text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: it -

WordPress MU

+

WordPress µ

FAILED
Quick Fix: chmod 777 $dir
"; - return false; - } else { - if( $ret == true ) { - return true; - } else { - return false; - } - } -} - function filestats( $err ) { print "

Server Summary

"; - print "

If you post a message to the MU support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:

"; + print "

If you post a message to the µ support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:

"; print "
"; print "
ERROR: $err
"; @@ -172,17 +161,28 @@ function do_htaccess( $oldfilename, $newfilename, $base, $url ) { } function checkdirs() { + global $dirs; + $ret = true; - $ret = check_writeable_dir( dirname(__FILE__), $ret ); - $ret = check_writeable_dir( dirname(__FILE__) . "/wp-content/", $ret ); + foreach( $dirs as $dir ) { + if( false == is_writeable( $dir ) ) { + $err[] = $dir; + } + } - if( $ret == false ) { - print "

Warning!

"; - print "
"; - print "

One or more of the above directories must be made writeable by the webserver.
"; - print "Please chmod 777 directory-name or chown that directory to the user the web server runs as (usually nobody, apache, or www-data)
"; - print "Refresh this page when you're done!

"; - print "
"; + if( is_array( $err ) ) { + ?>

Warning!

+
+

One or more of the directories must be made writeable by the webserver. You will be reminded to reset the permissions at the end of the install.
+ Please chmod 777 directory-name or chown that directory to the user the web server runs as (usually nobody, apache, or www-data)
+ Refresh this page when you're done!

+
+

Quick fix:
chmod 777 

Installing WPµ"; + ?>

Installing WordPress µ

+

Welcome to WordPress µ. I will help you install this software by asking you a few questions and asking that you change the permissions on a few directories so I can create configuration files and make a directory to store all your uploaded files.

+

If you have installed the single-blog version of WordPress before, please note that the WordPress µ installer is different and trying to create the configuration file wp-config.php youself may result in a broken site. It's much easier to use this installer to get the job done.

+

What do I need?

+

+ If the mod_rewrite module is disabled ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.

"; if( function_exists( "apache_get_modules" ) ) { $modules = apache_get_modules(); @@ -227,7 +232,7 @@ function step1() { } function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'password', $dbhost = 'localhost', $vhost = 'yes', $prefix = 'wp_' ) { - $weblog_title = 'My new WPMU Site'; + $weblog_title = 'My new WordPress MU Site'; $email = ''; $hostname = $_SERVER[ 'HTTP_HOST' ]; if( substr( $_SERVER[ 'HTTP_HOST' ], 0, 4 ) == 'www.' ) @@ -236,7 +241,7 @@ function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'pas

Blog Addresses

-

Please choose whether you would like blogs for the MU install to use sub-domains or sub-directories. You can not change this later. We recommend sub-domains.

+

Please choose whether you would like blogs for the WordPress µ install to use sub-domains or sub-directories. You can not change this later. We recommend sub-domains.


@@ -307,8 +312,6 @@ function step2() { require_once('wp-includes/wp-db.php'); printheader(); - print "Creating Database Config File: "; - $handle = fopen('wp-config.php', 'w'); foreach ($configFile as $line_num => $line) { @@ -341,12 +344,11 @@ function step2() { } fclose($handle); chmod('wp-config.php', 0644); - print "DONE
"; define( 'VHOST', $vhost ); } function step3() { - global $wpdb, $current_site; + global $wpdb, $current_site, $dirs, $wp_version; $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); if( $base != "/") { $base .= "/"; @@ -398,17 +400,40 @@ We hope you enjoy your new weblog. update_blog_option( 1, 'stylesheet', 'home'); update_blog_option( 1, 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); update_blog_option( 1, 'rewrite_rules', ''); - $msg = "Your new WPMU site has been created at\nhttp://{$domain}{$base}\n\nLogin details:\nUsername: admin\nPassword: $pass\nLogin: http://{$domain}{$base}wp-login.php\n"; - wp_mail( $email, "Your new WPMU site is ready!", $msg, "From: wordpress@" . $_SERVER[ 'HTTP_HOST' ] ); - print "

Congrats! Your WPMU site has been set up and you have been sent details of your login and password in an email.

"; - print "

You can log in using the username 'admin' and password '{$pass}'

"; + $msg = "Your new WordPress MU site has been created at\nhttp://{$domain}{$base}\n\nLogin details:\nUsername: admin\nPassword: $pass\nLogin: http://{$domain}{$base}wp-login.php\n"; + wp_mail( $email, "Your new WordPress MU site is ready!", $msg, "From: wordpress@" . $_SERVER[ 'HTTP_HOST' ] ); + ?>

Installation Finished!

+

Congratulations! Your WordPress µ site has been configured.

+

You can log in using the username "admin" and password ""

+

Directory Permissions

+

Please remember to reset the permissions on the following directories:

    + $dir"; + } + ?>

+

You can probably use the following command to fix the permissions but check with your host if it doubt:
chmod 755 

+

Further reading

+

  • If you run into problems, please search the WordPress µ Forums where you will most likely find a solution. Please don't post there before searching. It's not polite.
  • +
  • There is also the WordPress µ Trac. That's our bug tracker.

+

Thanks for installing WordPress µ!

+ + Donncha
+ wpmu version:

+

No-www

-

WordPress MU strips the string "www" from the URLs of sites using this software. It is still possible to visit your site using the "www" prefix with an address like but any links will not have the "www" prefix. They will instead point at .

+

WordPress µ strips the string "www" from the URLs of sites using this software. It is still possible to visit your site using the "www" prefix with an address like but any links will not have the "www" prefix. They will instead point at .

The preferred method of hosting blogs is without the "www" prefix as it's more compact and simple.

You can still use "" and URLs like "www.blog1." to address your site and blogs after installation but internal links will use the format.

www. is depreciated has a lot more information on why 'www.' isn't needed any more.

-- cgit