Launching a new website for the
Events
menu instead of on the calendar page.WP-Web1 | WP-Web2 | WP-Database
There could be additional front-end WordPress servers. Their setup would be identical to WP-Web1 and WP-Web2.
About the WP-Database Server:
wp-content
folder on
this server is the "master" copy which is shared to the other servers.Microsoft's WPI is probably the easiest way to get WordPress up and running with IIS.
https://www.microsoft.com/web/downloads/platform.aspx
It will install MySQL, PHP (as a FastCGI process),
and WordPress. It will also create the IIS site configuration, the MySQL user
and database for WordPress to use, and the initial settings for your
wp-config.php
file.
We used WPI to install WordPress to all three of the servers.
Because we want to use a shared content directory, we need to create a domain user which IIS/PHP will use for shared filesystem permissions. Let's call it
MYDOMAIN\IISPHP
.
Keep in mind the security principal of Least Privilege. This account should only have the access it absolutely needs.
This server is not in the load-balancing rotation, and is only
accessible to the front-end servers and the internal network.
However, we still want WordPress running here, because it is
going to hold the master copy of the wp-content
folder which will be shared on the network to the front-end
servers.
We give our MYDOMAIN\IISPHP
account
ownership and control of wp-content
.
After installing WordPress, we configured Multisite in the usual way, by
setting the appropriate define()
statements in
the wp-config.php
file.
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'cherokeek12.net' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
By default, the DB_USER
account can only connect to
MySQL from its own server. We have to tell MySQL to allow the user
to connect from our other front-end servers. Run mysql from the
command line, and grant permissions to the user:
C:\> mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 86197
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT ALL PRIVILEGES ON wpdbname.* TO 'wpdbuser'@'server.ip.number';
C:\> mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 86197
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT ALL PRIVILEGES ON wpdbname.* TO 'wpdbuser'@'server.ip.number';
Do this for each front-end server
(WP-Web1
& WP-Web2
), substituting
the appropriate values for the database name, user name, and
server IP address.
If you aren't comfortable with the command line, you can also
do this with the MySQL Workbench
app, under
Users and Privileges
.
These are our load-balanced front-ends. We can
disable the MySQL service on these servers, and modify
wp-config.php
to point to the WP-Database server.
They should use the same database settings as WP-DATABASE. For example:
define('DB_NAME', 'wordpress999');
define('DB_USER', 'wordpressuser999');
define('DB_PASSWORD', 'mydbpassword');
define('DB_HOST', '10.1.2.3');
We also delete (or rename, or move) the wp-content
folder on these
servers, and replace it with a link to the network share from
WP-Database:
mklink /d C:\InetPub\wwwroot\wp-content \\WP-Web1\wwwroot\wp-content
This lets WordPress map URLs <==> filenames without additional trickery.
At this point, the front-end servers are mostly configured, and serving up web pages; however, Media Uploads were not working.
Over time, we discovered that there were several pieces to this puzzle, and you have to get all of them into place before uploads will work on the shared content directory configuration.
For detailed information, please see Dougal Campbell's presentation:
Get Off My Lawn! ...and out of my Dashboard!
http://dougal.us/presentations/getoffmylawn/
functions.php
file of the child theme@suzecampbell | @dougal
For more information...
Get Off My Lawn! ...and out of my Dashboard!
by Dougal Campbell
http://dougal.us/presentations/getoffmylawn/
Teachers Make the Worst Students!
by Susan Campbell
http://www.digitaldivas.net/presentations/TeachersWorstStudents/