Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

Confused with online & local multisite setup

Started by Raison Red 1 year ago · 1 replies · 108 views
1 year ago

Hi @All,

I'm a total newbee to grav. I decided to use it, cause for me it seemed to be more practical having a flat-file cms instead of those who needing a database (e.g Joomla, Wordpress, etc..).

So I uploaded grav+admin (v1.7.48 / v1.10.48) to my webspace.

As I have different domains, the webspace for all of them is pointing to the same folder (ROOT/site/..).

First I got totally confused, cause for me it seemed, that something is going totally wrong. So i decided to make an backup of the site an reinstall grav. This I recognized, that grav has automatically created new subfolders for each domain.

  • ROOT/site/user/www.domain1.tld1
  • ROOT/site/user/www.domain2.tld2
  • ROOT/site/user/www.domain3.tld3
  • ROOT/site/user/domain1.tld1
  • ROOT/site/user/domain2.tld2
  • ROOT/site/user/domain3.tld3

After getting a bit deeper into grav I was totally happy about this, cause I was quite easy to set different welcome_pages for each domain.

But now I'm a bit stuck for this multisite setup for my local development platform (AMPPS with Apache & PHP).
Somehow, what is working online, does not work "offline"/locallly.

I created (corresponding to my domains) 4 local vHosts

  • domain1.local
  • domain2.local
  • domain3.local
  • domain4.local

I tried to do the setup (Multisite Setup) but this does not work for my local vHosts.

I placed all files under:

  • ../user/env/domain1.local
  • .
  • .
  • ../user/env/domain4.local

including the setup.php (> setup_subdirectory.php).
But It wont work. Grav seems only to access the folder ../user/localhost and ignoring everything else.

I also added in the Apache vhosts.conf for each local vHost:

SetEnv GRAV_ENVIRONMENT_PATH user://env/domain1.local

Last but not least, I now discovered, that for domain4.tld
the subdirectories are not created (It's the only domain with a hyphen inbetween) this I'm missing

  • ROOT/site/user/www.dom-ain4.tld4
  • ROOT/site/user/dom-ain4.tld4

So I've quite a few questions.

  1. Is there a way to unify the folders only to e.g /user/domainX.tldX without the "www" subdomain?
  2. Is this maybe a bug, that there are no subdirectories created for the dom-ain4.tld4 with the hyphen?
  3. Why are the online folders created in ROOT/user/ and not ROOT/user/env (like stated in the documentation)?
  4. How to do the local setup?

I'd be thankful for every hint & tip...

ThX
LC

👍 1
last edited 02/12/25 by Raison Red
1 year ago

Are you sure you need a multisite setup? From you story, I'm getting the impression that you have multiple domains that point to the same content. You don't need a multisite setup for that.

You need a multisite setup when you want to serve multiple different websites, each with its own content, using a single Grav installation.

From the docs:

A multisite setup allows you to create and manage a network of multiple websites, all running on a single installation.

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 9 hours ago
5 53 3 hours ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 60 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 60 8 months ago
Installation & Hosting · by N, 12 months ago
3 70 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 57 1 year ago