Running Grav into home/public_html folder

Hello there.

Is possible run Grav into home/public_html folder??. I’ve configured Apache Userdir module, and I can load html sites, but not Grav.

What can I do to configure this?
Thanks

What are the errors? I have my Grav site in public_html with default .htaccess and no issues here

Same here. I can drop the files into public_html and it works fine.

Hi.
This is the error:
500
" Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log."

In error.log I have:
/home/pedro/public_html/grav-admin/.htaccess: Options not allowed here

Sounds like something in your htaccess that your host doesn’t like. Try renaming it temporarily and see if that helps. I am new to Grav and haven’t looked at what is in htaccess yet.

I’ve probed to delete .htaccess but it doesn’t work. I’ll see some information about Apache Server configuration.

Are you using XAMPP?
I’d recommend Laragon for local (it’s also listed as first option, at least for Windows, in Grav docs)

Hi @Karmalakas

I’m using the Apache 2 and PHP provided by my Linux distribution, not XAMPP. I have this configuration in a /etc/apache2/sites-enabled/es-grav.local:

<VirtualHost *>
    DocumentRoot /home/pedro/public_html
    ServerAdmin webmaster@localhost
    ServerName es-grav.local
    ErrorLog /var/log/apache2/error.log
    CustomLog /var/log/apache2/access.log combined
    <Directory "/home/pedro/public_html">
        allow from all
        AllowOverride All
        Options None
        Require all granted
    </Directory>
</VirtualHost>

Error is in .htaccess. Look for these and try removing options setting on each one.

Well.

Finally, I’ve got to setup correctly my apache configuration to work fine with user_dir module. In my **/etc/apache2/mods-enabled, I’ve commented these lines:

#<IfModule mod_userdir.c>
#    <Directory /home/*/public_html>
#        php_admin_flag engine Off
#    </Directory>
#</IfModule>

The route for my web sites in localhost is now: http://localhost/~user/site, with ~ before user name.

Thanks for your help.

2 Likes