Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentRoot directory doesn't exist #74

Closed
safetypins opened this issue Jul 20, 2021 · 12 comments
Closed

DocumentRoot directory doesn't exist #74

safetypins opened this issue Jul 20, 2021 · 12 comments

Comments

@safetypins
Copy link

I'm getting this error inside of CircleCI:

 [1G  8/26 [========>-------------------]  30%[Exec] Running service apache2 start
Starting Apache httpd web server: apache2AH00112: Warning: DocumentRoot [/var/www/html] does not exist

Do I need to configure Apache to look at /opt/drupal/docroot?

@juampynr
Copy link
Member

Hi @safetypins, I think that there is a symlink that should take care of that already. Did this happen on an update or on a fresh installation of drupal9ci?

cc @m4olivei and @fjgarlin in case it rings a bell.

@fjgarlin
Copy link
Collaborator

Yeah Drupal should be in the right Apache folder. Did you change anything from the default files? Which of the tasks fail? Perhaps a link to the task or further output might help.

@safetypins
Copy link
Author

it's a fresh installation of drupal9ci in an established drupal installation. I've changed a few things in the default d9ci config files, but only to get rid of errors that I've encountered before this, like figuring out how to get drush running, giving drush the correct web root, pulling over a database dump. Mostly I've replaced /web/ with /docroot/.

Not everything is broken, the coding standards tests were running properly before I turned them off. I've disabled everything but the behat testing, because that's the sort of testing I'm primarily interested in. As far as I know, I've not made any changes related to apache configuration; I can't even find any references to apache configuration. When I searched google for this, most of the suggestions involved an circleci.conf file that needed to be updated, but this project doesn't include that, does it?

@safetypins
Copy link
Author

Ok, I'm just realizing you were asking for a link to the circleci task, so here you go: https://app.circleci.com/pipelines/github/RhodesCollege/rhodes_edu/191/workflows/ad9c9fb6-74db-41e2-b7cf-a6a86aa72d2e/jobs/240

@fjgarlin
Copy link
Collaborator

Ok, it’s definitely the web to docroot change then. The easiest would be to symlink one to the other in the robofile, like here: https://github.com/Lullabot/drupal9ci/blob/master/dist/bitbucket/RoboFile.php#L187 (you’ll need to adapt paths).

Otherwise if you change docroot to web at Drupal level things should just work.

@safetypins
Copy link
Author

Thanks so much, that worked! On to the next error.

@fjgarlin
Copy link
Collaborator

Great! Any sort of feedback at the end would be appreciated and perhaps we can update docs.

@juampynr
Copy link
Member

thanks for the help @fjgarlin !

@safetypins
Copy link
Author

Sure. I have found this whole process pretty confusing, although it's less confusing than my first attempt a few months ago. I don't know how common it is for people to change the web directory to something else, but it definitely would have helped to have a list of the places where this change impacts the configuration. Let me see if I can compile a list of changes I made.

@safetypins
Copy link
Author

safetypins commented Jul 21, 2021

So, thinking back on the process so far, I felt like there were a bunch of different places where I had to change web to docroot. I'm not sure why, but for some reason when I was first searching for where to change this, I searched for "web/" instead of just "web". This missed several references, which I have found now when I tried to go through the process. I think this was really just an error on my part. But here's a list of files & lines that I've changed:

RoboFile.php

Lines 118-119

$tasks[] = $this->taskFilesystemStack()
    ->copy('.circleci/config/settings.local.php', 'web/sites/default/settings.local.php', $force);

Lines 227-228

$tasks[] = $this->taskFilesystemStack()
    ->copy('.circleci/config/phpunit.xml', 'web/core/phpunit.xml', $force)

Line 231

->exec('../vendor/bin/phpunit -c core --debug --verbose --log-junit ../artifacts/phpunit/phpunit.xml modules/custom');

Lines 269-272

$tasks[] = $this->taskExecStack()
    ->exec('vendor/bin/phpcs --standard=Drupal --report=junit --report-junit=artifacts/phpcs/phpcs.xml web/modules/custom')
    ->exec('vendor/bin/phpcs --standard=DrupalPractice --report=junit --report-junit=artifacts/phpcs/phpcs.xml web/modules/custom');

Line 284

$docroot = $this->getDocroot() . '/web';

config/phpunit.xml

Line 30

<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/opt/drupal/web/sites/simpletest"/>

config/behat.yml

Line 19

drupal_root: '/opt/drupal/docroot'

In addition to these changes, I found that the Drush executable was not found. So I had to add a command to run composer install.

In circleci.yml, line 37 I inserted:

- run:
    name: Install dependencies
    command: composer install

I'm not sure if I did this preemptively or in response to an error, but after I got the dump.sql file downloaded into the container, I added the full path to the db dump.sql file (/opt/drupal/dump.sql) to the drush sql-cli command.

@safetypins
Copy link
Author

I hope this is helpful, and thanks for all the work you've done to put this together.

@fjgarlin
Copy link
Collaborator

I updated the readme file linking to your comment above @safetypins and the symlink trick. Thanks for reporting the issue and for following up with the affected files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants