How to install WordPress on a VPS with CentOS 6 – file examples

Please see the main article for an explanation of what these files are used for.


NameVirtualHost *:80

# primary vhost - old clients will arrive here regardless of URL they used
<VirtualHost *:80>
ServerName yourdomain.tld
ServerAlias www.yourdomain.tld
Include conf.d/vhosts4-wp.include

<VirtualHost *:80>
ServerName yourdomain2.tld
ServerAlias www.yourdomain2.tld
Include conf.d/vhosts4-wp.include


# include file for wordpress, included from various virtual hosts

DocumentRoot "/var/www/wordpress"

<Directory "/var/www/wordpress">
AllowOverride None

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

Final version of the bottom half of /var/www/wordpress/wp-config.php:

define('WPLANG', '');

* For developers: WordPress debugging mode.
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
define('WP_DEBUG', false);

define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
$base = '/';
define( 'DOMAIN_CURRENT_SITE', 'yourdomain.tld' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

define( 'SUNRISE', 'on' );

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');