Score:0

Site returns 403

mx flag

This is a head-scratcher. I built a new Drupal 9 site on a RHEL test server with a temporary domain. Everything worked great. I moved it to the production server, again using a temporary domain, and everything worked great. This morning I set up the new Apache conf file on production. The site works fine as portal.yln.info and www.yln.info, but yln.info throws a 403 error (those three domains were working fine on the old Drupal 7 site). There are no errors in the Apache log.

Here's what I have in the conf file.

<VirtualHost *:80>
        DocumentRoot /var/www/html/yln/web
        ServerName portal.yln.info
        ServerAlias www.yln.info
        ServerAlias yln.info
        Redirect "/" "https://yln.info/"
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/yln>
                Options +FollowSymLinks +ExecCGI
                RewriteEngine On
                AllowOverride All
                Order allow,deny
                allow from all
                #Include /var/www/drupal_2020/htaccess.conf
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/cgi-bin/
        <Directory "/var/www/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/httpd/error_log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/httpd/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>
<VirtualHost *:443>
        DocumentRoot /var/www/html/yln/web
        ServerName portal.yln.info
        ServerAlias www.yln.info
        ServerAlias yln.info
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/1d40117d24e9b169.crt
        SSLCertificateKeyFile /etc/pki/tls/private/yln.key
        SSLCertificateChainFile /etc/pki/tls/certs/gd_bundle-g2-g1.crt
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/yln>
                Options +FollowSymLinks +ExecCGI
                RewriteEngine On
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /var/www/cgi-bin/
        <Directory "/var/www/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/httpd/error_log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/httpd/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

Why is yln.info inaccessible? I don't know if this is an Apache problem or a Drupal problem. I web searched but didn't find a solution.

id flag
Is `$settings['trusted_host_patterns']` configured in `settings.php`?
cn flag
Isn't it `require all granted` rather than `allow from all` these days?
Chanel avatar
mx flag
@cilefen, I verified that my trusted_host_patterns settings are correct.
Chanel avatar
mx flag
@Clive, good point. I've updated the conf file and will test it out tomorrow morning (business hours have begun so I can't experiment).
Chanel avatar
mx flag
@Clive, I got authorization from above to go ahead and make the change to "require all". I'm still having the same problem where yln.info returns a 403.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.