2014년 11월 3일 월요일

WordPress with Multisite on Nginx


Source URL


What is Multisite


Basically, WordPress has one web site. If you want to have more than two web site in one machine, you need to set up Multisite. Using multisite is easy, when WordPress is in web hosting service. However, if you use your own web server, such as CubieTruck, you need to find another way. Here, I will introduce how to use multisite on CubieTruck running WordPress on Nginx. While WordPress supports sub-domain and sub-directory, but only sub-directory is explained.

Step 1: Back Up WordPress


To be care of any error, we need to prepare for it. Before starting, please back up your date.

Step 2: Disable all Plugin


Even if you make new web site, it inherits previous web site. So, please disable your all plugin.

Step 3: Modify wp-config.php file


To enabel multisite, you need to insert some code in your wp-config.php file. Open wp-config.php file, and find the line
$cd wordpress
vi wp-config.php

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

Above the line, insert this code.
/* Multisite */
define('WP_ALLOW_MULTISITE', true);

Step 4: Change Network Setup


Move to Dash board >> Tools >> Network Setup. Selecte Multisite and sub-directory.

Step 5: Make blogs.dir directory


Make blogs.dir dirtectory in wp-content directory.

Step 6 & 7 are depend on your system. Please check your Network Setup


Step 6: Modify wp-config.php again


Add the following code to your wp-config.php file in /wordpress and same line previous.
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'xaliver.dlinkddns.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Step 7: Make .htaccess file


Add the following to your .htaccess file in /wordpress/.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Step 8: Login again


We have almost done. Please logout and login. If you have problem of login, please remove browser cache ans cookies.

Step 9: Make New Site and New User


Now, you can make new site, and you can assign the new site to other user.

Enjoy your new site.


 

[contact-form-7 id="24" title="Karl"]

댓글 없음:

댓글 쓰기