Skip to main content
Ubuntu
Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

Drupal Project directory in UbubtuUbuntu

Notice removed Content dispute by CommunityBot
Post Unlocked by CommunityBot
Post Locked by mpdonadio
Notice added Content dispute by mpdonadio
Source Link

Drupal directory in Ububtu

I am trying to get Drupal 8 installed on Ubuntu 18.04. I have installed LAMP and composer. I will install Drupal 8 with this (I think this is the latest recommended way) ...

composer create-project drupal/recommended-project my_site_name_dir

Where should my_site_name_dir be?

Some guides suggest it should be at apache2's web directory: /var/www/html/my_site_name_dir. And then change the directory owner to www-data (for apaches benefit?). But how then does Composer or myself write files to this directory if the owner is changed?

This guide Using Composer to Install Drupal says:

Your 'my_site_name_dir' will contain files that should be outside of your web root and not accessible by the web server. The web root will be 'my_site_name_dir/web'

So am I right in thinking that my_site_name_dir should not be visible by apache, but my_site_name_dir/web should be? If so how to I tell apache to find it?

I was imaging that my_site_name_dir would be somewhere in my home directory (easier for dealing with file permissions?) and I would view it in a browser with something like: http://localhost/my_site_name_dir

(I'm struggling a bit trying to grasp file ownership and how composer works.)