Author Topic: Changing Web Root  (Read 1789 times)

0 Members and 1 Guest are viewing this topic.

Changing Web Root
« on: March 13, 2022, 09:46:02 AM »
I'm having the most bizarre and random issue, and I can't get it to stay solid for me to debug it.

I'm installing Drupal through PHP Composer, and it gives me a default web root of 'public_html/web', so I edit:
Code: [Select]
vi /usr/local/apache/conf.d/vhosts/<>.conf
Change the document root to:
Code: [Select]
DocumentRoot /home/<username>/public_html/web

Restart the apache service:
Code: [Select]
systemctl restart httpd
Now here's where the weirdness happens.  Like about 50% of the time the website loads from /home/<user>/public_html/web, and just randomly for no reason, the site will load from /home/<user>/public_html

Does anyone have any idea why this is happening, like there's nothing in the error logs.  I feel like I'm going crazy!

Re: Changing Web Root
« Reply #1 on: March 13, 2022, 09:56:18 AM »
OH MY GOSH!  I figured it out.  FOUR HOURS this took me!  I didn't know there was another file called:
Code: [Select]
which needs to be edited as well.  The randomness was coming from the site being http:// and https:// .  Not sure why it loaded http:// and https:// randomly, but anyway, that's the fix if anyone has this same issue and doesn't want to have an episode.
« Last Edit: March 13, 2022, 10:32:56 AM by hunkah »