Drupal: Difference between revisions

Abmurrow (talk | contribs)
m Added post-install instructions
Abmurrow (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 21: Line 21:
After installing Drupal using nix, visit the hostname you configured in a web browser and inspect the website. If this is your first time accessing this environment, and you haven't manually imported a database, you will probably need to go through the standard Drupal UI installation process.
After installing Drupal using nix, visit the hostname you configured in a web browser and inspect the website. If this is your first time accessing this environment, and you haven't manually imported a database, you will probably need to go through the standard Drupal UI installation process.


<blockquote>'''Note:''' If you install Drupal using the UI, Drupal will make some changes to the <code>settings.php</code> file. These changes '''will be overridden''' next time you rebuild your Drupal project from a newer source. In order to preserve these changes, make sure to add the automatically generated PHP to the <code>extraConfig</code> attribute of your configuration file. You can usually find this located at the bottom of the <code>settings.php</code> file.
<blockquote>'''Note:''' If you install Drupal using the UI, Drupal will make some changes to the <code>settings.php</code> file located at <code>/var/lib/drupal/<hostname>/sites/default/settings.php</code>. These changes '''will be overridden''' next time you rebuild your Drupal project from a newer source. In order to preserve these changes, make sure to add the automatically generated PHP to the <code>extraConfig</code> attribute of your configuration file. You can usually find this located at the bottom of the <code>settings.php</code> file.


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 110: Line 110:
   };
   };
};
};
</syntaxhighlight>
</syntaxhighlight><blockquote>'''Note:''' The database settings configured in NixOS will merely create the database, they will not instruct a new Drupal installation where to find the database. Either define your database settings in <code>settings.php</code>, or see [[Drupal#After_Installation| After Installation]] for an example of how to do this with nix.</blockquote>


== State Directory ==
== State Directory ==
Line 131: Line 131:
If you want the state directory to be located in a different part of the system, you can use the following configuration to change where it is created<syntaxhighlight lang="nix">
If you want the state directory to be located in a different part of the system, you can use the following configuration to change where it is created<syntaxhighlight lang="nix">
services.drupal.sites."localhost".stateDir = /path/to/custom/state/dir;
services.drupal.sites."localhost".stateDir = /path/to/custom/state/dir;
</syntaxhighlight>'''Note''': Changing the state directory does not automatically change the location of the <code>modules</code>, <code>themes</code>, <code>config</code>, or <code>files</code> directories. You can override those locations by using the <code>modulesDir</code> and <code>themesDir</code>, <code>configDir</code>, <code>filesDir</code> keys, accordingly.
</syntaxhighlight><blockquote>'''Note''': Changing the state directory does not automatically change the location of the <code>modules</code>, <code>themes</code>, <code>config</code>, or <code>files</code> directories. You can override those locations by using the <code>modulesDir</code> and <code>themesDir</code>, <code>configDir</code>, <code>filesDir</code> keys, accordingly.</blockquote>