1

I'm running a VPS with Ubuntu. I've installed the LAMP-stack, and would now like to make a couple of blogs/sites using WordPress. I'm thinking about creating new users for each blog and making a public_html directory for each user. This way each blog could be reached with http://mysite/~some_blog.

Space is however at a bit of a premium, so I was wondering if it's possible to install WordPress only once (eg. under /var/www/html/ or perhaps /var/www/wordpress), and let all blogs access WordPress from there?

Of course they'd each also have a "private" directory in the public_html for each user, for individual configurations, uploads, and so on. Each blog/user would have their own MySQL database.

Are there better ways of doing this - one WP installation, multiple blogs - that I'm missing?

Also, is it possible to use only one shared MySQL-database for all blogs? (Not that I intend to do so, just curious...)

2 Answers 2

2

Am I missing a requirement, or will multisite suffice?

http://codex.wordpress.org/Create_A_Network

Multiple blogs, one install, one database...

1
  • Looks promising... I would've preferred separate databases and upload-dirs under each users home-dir (rather than all under the installation-dir), but I could use this. Thanks! Commented May 23, 2016 at 19:44
2

WordPress multisite installation with database:

cd /var/www

sudo mkdir -p domainone.com/public_html && sudo mkdir -p domaintwo.com/public_html && sudo chown -R vancoder:www-data /var/www

The -p allows you to specify more than one directory. So inside domainone.com it will create public_html.

I changed the ownership of /var/www to vancoder and the web server. So the owner is now vancoder and the webserver.

If you are going to be creating two sites, you need to create two databases.

For both you are going to use the following commands but with different user names:

CREATE DATABASE domainone; GRANT ALL PRIVILEGES ON domainone.* TO '4fw3AJab@'localhost' IDENTIFIED BY 'yw89Lzcd'; FLUSH PRIVILEGES;`

and

CREATE DATABASE domaintwo; GRANT ALL PRIVILEGES ON domaintwo.* TO 'KGb4Z04t@'localhost' IDENTIFIED BY 'Tbm5Gl02'; FLUSH PRIVILEGES;`

Then you can use WP-CLI to install WordPress and this assumes you have wp-cli installed in your Ubuntu server in the relevant directories.

/var/www$ cd microurb.com/public_html/
microurb@vps1234567:/var/www/microurb.com/public_html$

$ wp core download && wp core config --dbname=domainone --dbuser=4fw3AJab --dbpass=yw89Lzcd --dbprefix=bck3_ && wp core install --url=http://domainone.com --title=WPCLI --admin_user=rumpelstiltskin --admin_password=noneyah [email protected]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.