Changing Web Root

Started by hunkah, March 13, 2022, 09:46:02 AM

Previous topic - Next topic

hunkah

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:
vi /usr/local/apache/conf.d/vhosts/<example.com>.conf

Change the document root to:
DocumentRoot /home/<username>/public_html/web

Restart the apache service:
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!

hunkah

#1
OH MY GOSH!  I figured it out.  FOUR HOURS this took me!  I didn't know there was another file called:
/usr/local/apache/conf.d/vhosts/<example.com>.ssl.conf

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.