Changeset 1014
- Timestamp:
- 08/06/07 11:58:48 (1 year ago)
- Files:
-
- trunk/index-install.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/index-install.php
r1011 r1014 9 9 } 10 10 define('WP_INSTALLING', true); 11 12 $dirs = array( dirname(__FILE__), dirname(__FILE__) . "/wp-content/" ); 11 13 12 14 function printheader() { … … 64 66 <body> 65 67 66 <h1><img src="wp-includes/images/wordpress-mu.png" alt="WordPress MU" /></h1>68 <h1><img src="wp-includes/images/wordpress-mu.png" alt="WordPress µ" /></h1> 67 69 <?php 68 }69 70 function check_writeable_dir( $dir, $ret ) {71 if( is_writeable( $dir ) == false ) {72 print $dir." : <b style='color: #f55'>FAILED</b><br />Quick Fix: <code>chmod 777 $dir</code><br />";73 return false;74 } else {75 if( $ret == true ) {76 return true;77 } else {78 return false;79 }80 }81 70 } 82 71 83 72 function filestats( $err ) { 84 73 print "<h1>Server Summary</h1>"; 85 print "<p>If you post a message to the MUsupport forum at <a target='_blank' href='http://mu.wordpress.org/forums/'>http://mu.wordpress.org/forums/</a> then copy and paste the following information into your message:</p>";74 print "<p>If you post a message to the µ support forum at <a target='_blank' href='http://mu.wordpress.org/forums/'>http://mu.wordpress.org/forums/</a> then copy and paste the following information into your message:</p>"; 86 75 87 76 print "<blockquote style='background: #eee; border: 1px solid #333; padding: 5px;'>"; … … 173 162 174 163 function checkdirs() { 164 global $dirs; 165 175 166 $ret = true; 176 $ret = check_writeable_dir( dirname(__FILE__), $ret ); 177 $ret = check_writeable_dir( dirname(__FILE__) . "/wp-content/", $ret ); 178 179 if( $ret == false ) { 180 print "<h2>Warning!</h2>"; 181 print "<div style='border: 1px solid #ccc'>"; 182 print "<p style='font-weight: bold; padding-left: 10px'>One or more of the above directories must be made writeable by the webserver.<br>"; 183 print "Please <code>chmod 777 <q>directory-name</q></code> or <code>chown</code> that directory to the user the web server runs as (usually nobody, apache, or www-data)<br>"; 184 print "Refresh this page when you're done!<br></p>"; 185 print "</div>"; 167 foreach( $dirs as $dir ) { 168 if( false == is_writeable( $dir ) ) { 169 $err[] = $dir; 170 } 171 } 172 173 if( is_array( $err ) ) { 174 ?><h2>Warning!</h2> 175 <div style='border: 1px solid #ccc'> 176 <p style='font-weight: bold; padding-left: 10px'>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.<br> 177 Please <code>chmod 777 <q>directory-name</q></code> or <code>chown</code> that directory to the user the web server runs as (usually nobody, apache, or www-data)<br> 178 Refresh this page when you're done!<br></p> 179 </div> 180 <p>Quick fix:<br /> <code>chmod 777 <?php 181 foreach( $err as $dir ) { 182 echo "$dir "; 183 } 184 ?></code></p><?php 185 $ret = false; 186 186 } 187 187 if( file_exists( "./.htaccess" ) && is_writeable( "./.htaccess" ) == false ) { … … 197 197 198 198 function step1() { 199 print "<h2>Installing WPµ</h2>"; 199 ?><h2>Installing WordPress µ</h2> 200 <p><strong>Welcome to WordPress µ.</strong> 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.</p> 201 <p>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.</p> 202 <h3>What do I need?</h3> 203 <p><ul><li>Access to your server to change directory permissions. This can be done through ssh or ftp for example.</li><li>A valid email where your password and administrative emails will be sent.</li><li>An empty MySQL database.Tables are prefixed with <code>wp_</code> which may conflict with an existing WordPress install.</li><li> Wildcard dns records if you're going to use the virtual host functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details.</li></ul><p> 204 <?php 200 205 $mod_rewrite_msg = "<p>If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href='http://httpd.apache.org/docs/mod/mod_rewrite.html'>Apache documentation</a> or <a href='http://www.google.com/search?q=apache+mod_rewrite'>elsewhere</a> for help setting it up.</p>"; 201 206 if( function_exists( "apache_get_modules" ) ) { … … 228 233 229 234 function printstep1form( $dbname = 'wordpress', $uname = 'username', $pwd = 'password', $dbhost = 'localhost', $vhost = 'yes', $prefix = 'wp_' ) { 230 $weblog_title = 'My new W PMU Site';235 $weblog_title = 'My new WordPress MU Site'; 231 236 $email = ''; 232 237 $hostname = $_SERVER[ 'HTTP_HOST' ]; … … 237 242 <input type='hidden' name='action' value='step2'> 238 243 <h2>Blog Addresses</h2> 239 <p>Please choose whether you would like blogs for the MUinstall to use sub-domains or sub-directories. You can not change this later. We recommend sub-domains.</p>244 <p>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.</p> 240 245 <p><label><input type='radio' name='vhost' value='yes' <?php if( $vhost == 'yes' ) echo 'checked '; ?> /> Sub-domains (like <code>blog1.example.com</code>)</label><br /> 241 246 <label><input type='radio' name='vhost' value='no' <?php if( $vhost == 'no' ) echo 'checked '; ?> /> Sub-directories (like <code>example.com/blog1</code></label></p> … … 308 313 printheader(); 309 314 310 print "Creating Database Config File: ";311 312 315 $handle = fopen('wp-config.php', 'w'); 313 316 … … 342 345 fclose($handle); 343 346 chmod('wp-config.php', 0644); 344 print "<b style='color: #00aa00; font-weight: bold'>DONE</b><br />";345 347 define( 'VHOST', $vhost ); 346 348 } 347 349 348 350 function step3() { 349 global $wpdb, $current_site ;351 global $wpdb, $current_site, $dirs, $wp_version; 350 352 $base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) ); 351 353 if( $base != "/") { … … 399 401 update_blog_option( 1, 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); 400 402 update_blog_option( 1, 'rewrite_rules', ''); 401 $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"; 402 wp_mail( $email, "Your new WPMU site is ready!", $msg, "From: wordpress@" . $_SERVER[ 'HTTP_HOST' ] ); 403 print "<p>Congrats! Your <a href='http://{$domain}{$base}'>WPMU site</a> has been set up and you have been sent details of your login and password in an email.</p>"; 404 print "<p>You can <a href='wp-login.php'>log in</a> using the username 'admin' and password '{$pass}'</p>"; 403 $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"; 404 wp_mail( $email, "Your new WordPress MU site is ready!", $msg, "From: wordpress@" . $_SERVER[ 'HTTP_HOST' ] ); 405 ?><h2>Installation Finished!</h2> 406 <p>Congratulations! Your <a href='http://<?php echo $domain . $base; ?>'>WordPress µ site</a> has been configured.</p> 407 <p>You can <a href='wp-login.php'>log in</a> using the username "admin" and password "<?php echo $pass; ?>"</p> 408 <h3>Directory Permissions</h3> 409 <p>Please remember to reset the permissions on the following directories:<ul> 410 <?php 411 reset( $dirs ); 412 foreach( $dirs as $dir ) { 413 echo "<li> $dir</li>"; 414 } 415 ?></ul></p> 416 <p>You can probably use the following command to fix the permissions but check with your host if it doubt:<br /><code>chmod 755 <?php 417 reset( $dirs ); 418 foreach( $dirs as $dir ) { 419 echo "$dir "; 420 } 421 ?></code></p> 422 <h3>Further reading</h3> 423 <p><ul><li>If you run into problems, please search the <a href='http://mu.wordpress.org/forums/'>WordPress µ Forums</a> where you will most likely find a solution. Please don't post there before searching. It's not polite.</li> 424 <li>There is also the <a href='http://trac.mu.wordpress.org/'>WordPress µ Trac</a>. That's our bug tracker.</li></ul></p> 425 <p>Thanks for installing WordPress µ!<br /><br /> 426 427 Donncha<br /> 428 <code>wpmu version: <?php echo $wp_version ?></code></p> 429 <?php 405 430 } 406 431 … … 409 434 ?> 410 435 <h1>No-www</h1> 411 <p>WordPress MUstrips 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 <em><?php echo $_POST[ 'basedomain' ] ?></em> but any links will not have the "www" prefix. They will instead point at <?php echo $nowww ?>.</p>436 <p>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 <em><?php echo $_POST[ 'basedomain' ] ?></em> but any links will not have the "www" prefix. They will instead point at <?php echo $nowww ?>.</p> 412 437 <p>The preferred method of hosting blogs is without the "www" prefix as it's more compact and simple.</p><p>You can still use "<?php echo $_POST[ 'basedomain' ] ?>" and URLs like "www.blog1.<?php echo $nowww; ?>" to address your site and blogs after installation but internal links will use the <?php echo $nowww ?> format.</p> 413 438 <p><a target='_blank' href="http://no-www.org/">www. is depreciated</a> has a lot more information on why 'www.' isn't needed any more.</p>
