richa78's picture

Sorry to make another post, will it be worth deleting I wonder.

Created a subdomain and put backdrop files in public_html, the url loads core/install.php but I get a 403 forbidden. Is it a file I need to edit or my host do you think?

Accepted answer

Typically, you just need to move everything in your root installation (including the files/config_XXX content) to the new root, and point your domain to read the index.php from the new root folder. Additionally, if the URL has changed, you'll need to edit settings.php to include the new URL in the $settings['trusted_host_patterns'].

 Regarding the error about ./files/config_da0799db4c94be9ca60838a9038b5d0f/active not being found, check that the folder indeed exists, and the name is correct.

$settings.php contains your database credentials. If you are in the same host, that typically will not change at all. And if localhost worked in the other root directory, it should work in the new one, even if the domain name has changed. localhost is the typical setting to connect to the database in the same server. 

Comments

Are you trying to do a multisite installation of Backdrop? Can you explain a bit more what you are trying to accompish? 

The site files have to be in the "subdomains" folder...

i.e.  the subdomain new.domain.com maps to a subfolder of public_html/subdomain/new

Hope that makes sense.

 

They are in the subdomain's folder, otherwise the url /core/install.php wouldn't appear. My host added a new site folder after adding a subdomain which has it's own public_html. Can't find much on google, think I'll send my host a ticket or maybe backdrop is blocking the second installation.

It's chmod, folders had 700 (needs 755) which I thought was normal, must be something up with the zip extraction.

Now I'm getting.. Could not find a value for the database "name" .. looks right to me in settings.php. Do I need to replace localhost with something for a subdomain?

Replace "user", "pass", "localhost", and "database_name" with the applicable information from your server.

What I'm trying to do is copy/transfer an installation to another domain, but not sure how to go about it. I'm now getting this using root url ..

Exception: The configuration directory in settings.php is specified as './files/config_da0799db4c94be9ca60838a9038b5d0f/active', but this directory is either empty or missing crucial files. Check that the $config_directories variable is correct in settings.php. in _backdrop_bootstrap_configuration() (line 3045 of /home/customer/www/cfhartdepot.progressonline.uk/public_html/core/includes/bootstrap.inc).

I've not run the installation and it won't run after editing the settings.php (it did run after changing chmod but I didn't execute), now it keeps giving me the error in previous post.

Typically, you just need to move everything in your root installation (including the files/config_XXX content) to the new root, and point your domain to read the index.php from the new root folder. Additionally, if the URL has changed, you'll need to edit settings.php to include the new URL in the $settings['trusted_host_patterns'].

 Regarding the error about ./files/config_da0799db4c94be9ca60838a9038b5d0f/active not being found, check that the folder indeed exists, and the name is correct.

$settings.php contains your database credentials. If you are in the same host, that typically will not change at all. And if localhost worked in the other root directory, it should work in the new one, even if the domain name has changed. localhost is the typical setting to connect to the database in the same server. 

I can't test transferring to another domain yet. Trying to get multisite working with a subdomain but I can't see how the specified domain in sites.php can use the installation. How does the new site install it's database?

Think I've jinxed the server as subdomain/core/install.php still says ..

Notice: Undefined index: path in /home/customer/www/cfhartdepot.progressonline.uk/public_html/core/includes/bootstrap.inc on line 866

Fatal error: Could not find a value for the database "name" setting. Please check the $database setting in settings.php. in /home/customer/www/cfhartdepot.progressonline.uk/public_html/core/includes/bootstrap.inc on line 877

after deleting everything in the directory.

Have you read articles in this Forum about multisite installations? There are several that are well documented. Just a clarification: multisite installations allow developers to create multiple independent sites that use the same codebase, but different databases. Again, these sites are completely independent from each other, and typically use different URLs (though it's possible to use a subdomain URL as in example.com and second.example.com, or even make it look like a subfolder, as in example.com and example.com/second)

In a nutshell, AFTER you have installed your default domain:

  1. Create a new database for the second domain
  2. Create a folder inside sites, as in sites/second. Put a copy of settings.php there and create a files folder as in sites/second/files
  3. Edit settings.php to point to the correct (NEW) database. Also edit to point to the correct active and staging config folders, as in $config_directories['active'] = './sites/second/files/config_second/active';
  4. You may also need to edit $settings['trusted_host_patterns'] unless you are running this in localhost locally.
  5. Edit sites.php contained within the sites folder, and add a line to tell Backdrop where to find the files for the second site. Typically (for a localhost local site that uses port 8888 and a URL http://second.localhost:8888)
    1. $sites['8888.second.localhost'] = 'second';

Notice that 'second' in this case refers to the folder name sites/second

Create a domain in your server (I use MAMP, but I also do this with shared hosting online by using cPanel) that points to the root of your MAIN Backdrop installation where the main site and the second site live. 

Then you need to run install, as in http://second.localhost:8888/core/install.php

Typically, that's all that is needed.

 

Thanks for that @argiepiano, I'll definitely give it a go at some point.