# Change into a writable directory and then download the compressed release by typing cd /tmp curl -O https://wordpress.org/latest.tar.gz
# Extract the compressed file to create the WordPress directory structure tar xzvf latest.tar.gz
# add a dummy .htaccess file touch /tmp/wordpress/.htaccess
# Copy over the sample configuration file to the filename that WordPress actually reads cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
# Create the upgrade directory, so that WordPress won't run into permissions issues when trying to do this on its own following an update to its software mkdir /tmp/wordpress/wp-content/upgrade
# Copy the entire contents of the directory into our document root. # Using the -a flag to make sure our permissions are maintained. sudo -S -p ''cp -a /tmp/wordpress/. /var/www/html
# To grab secure values from the WordPress secret key generator EACH TIME! curl -s https://api.wordpress.org/secret-key/1.1/salt/
curl 结果类似如下:
1 2 3 4 5 6 7 8
define('AUTH_KEY', '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H'); define('SECURE_AUTH_KEY', 'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3'); define('LOGGED_IN_KEY', 'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88'); define('NONCE_KEY', 'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g'); define('AUTH_SALT', 'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES 07VC*Lj*lD&?3w!BT#-'); define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY'); define('LOGGED_IN_SALT', 'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|'); define('NONCE_SALT', 'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%');
请不要直接复制以上例子,以实际curl结果为准,粘贴到wp-config.php中适当位置
1
vi /var/www/html/wp-config.php
1 2 3 4 5 6 7 8 9 10 11 12 13
. . .
define('AUTH_KEY', 'put your unique phrase here'); define('SECURE_AUTH_KEY', 'put your unique phrase here'); define('LOGGED_IN_KEY', 'put your unique phrase here'); define('NONCE_KEY', 'put your unique phrase here'); define('AUTH_SALT', 'put your unique phrase here'); define('SECURE_AUTH_SALT', 'put your unique phrase here'); define('LOGGED_IN_SALT', 'put your unique phrase here'); define('NONCE_SALT', 'put your unique phrase here');
. . .
在该文件中继续配置数据库相关内容:
1 2 3 4 5 6 7 8 9 10 11
. . .
define('DB_NAME', 'wordpress');
/** MySQL database username */ define('DB_USER', 'changetoyouruser');
/** MySQL database password */ define('DB_PASSWORD', 'changetoyourpwd');