Grav in a shared host environment; admin directory & .htaccess not found

I’m trying to get grav to work on an apache shared host envrionment. (x10 hosting)
I downloaded grav+admin, unzipped it, and used filezilla and ftp to upload to a I’m trying to get grav to work on an apache shared host envrionment.
I downloaded grav+admin, unzipped it, and used filezilla and ftp to upload to a /Documents/grav/ subdirectory.

When I key in the url it redirects to /Documents/grav/admin and put up this error:

Not Found
The requested URL /Documents/grav/admin was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I’ve reviewed the help information to solve file not found, and I’m not having much success.

I’ve checked for the .htaccess file, and it isn’t there in the root of my /Documents/grav/ directory, which is where I understand it should be as the root of my installation. BUT is isn’t there in the file.
Am I supposed to create it?

The /Documents/grav/admin doesn’t exist in the file, either? I’m not surprised that it doesn’t find it when I run. Am I supposed to create it?

Because it is a shared server, I don’t have access to and can’t change httpd.conf, so I can’t set AllowOverride All. Is there another alternative?

Is it even possible to run Grav in a shared server environment?

Thanks for helping a noob.

Of course Grav runs fine in most shared hosting environments. I suggest you follow along with one of the guides we have here:

Granted we may not have your exact hosting company listed, but most are similar and you will get a basic idea of how to go about things.

These guides will also provide you with information to help setup CLI access via SSH. This is going to be the best way for you to install things like the admin plugin.

So, @rhuk, I’m wondering, is it possible to use Grav in somewhat effective way without CLI access?

Is this your web root directory?

.htaccess is in the zip file. Files that start with a . are typically invisible in Windows/macOS file browser. I’m not sure if you’re on Windows or macOS, but after you unzip the archive, use FileZilla to navigate to the newly created directory, and you will see the .htaccess file.

.htaccess is critical for Grav to function correctly on Apache, so once you fix this issue it may work for you - otherwise more assistance can be provided :smiley:

Edit: from the Grav documentation

If you downloaded the ZIP file and then plan to move it to your webroot, please move the ENTIRE FOLDER because it contains several hidden files (such as .htaccess) that will not be selected by default. The omission of these hidden files can cause problems when running Grav.

1 Like

You can run Grav perfectly fine without CLI access. Assuming you are starting from scratch without the Admin plugin, you may install the Admin plugin and its dependencies via FTP. Once the Admin plugin is installed you can perform the equivalent CLI command from the admin interface (clear cache, check for updates, etc).

Many shared hosting providers that don’t provide SSH/CLI access use Softaculous for software installation. I’ve tested Grav in this environment and had zero issues.

I’m just asking out of curiosity, and because I think about the project. I myself have a decent shell account, but to be really accesible for wider audience, Grav needs to work well without CLI, I believe.

Andy, great information.

yes, /Documents/grav/ is the root directory for grav.
I am an x10 hosting, and they use cPanel and softalicious.
There is no CLI.

I got a lot further by FTPing the zip file up to the directory. Then I was able to unzip from the file display dialog of cPanel. By unzipping at the server, the .htaccess file is there.

When I went to the directory, which is now /Documents/grav2/grav-admin the admin dialog came up and I created a user.

Unfortunately, I am not able to get the main dialog of grav to show up, yet. Anytime I type in I get the admin dialog.

I’m finding that even in a shared environment, I can do most things, just not through CLI. So my next step is double check all the cli steps and look for alternative ways to do things without CLI.

Thanks again for your patient help.

Did it save the first user you created? You can check by using the cpanel file manager and going to the user/accounts in your grav2 folder and see if you’ve got a .yaml file for user you created earlier.

I think it needs to have all the admin fields for it to count as your first user (all should be automatically added when creating the account)

state: enabled
    login: true
    super: true
    login: true

Also I know its free (which is good) but I have used x10 hosting before and run into so many problems with server limits on even super simple sites that it really isn’t worth the hassle when there are so many almost free hosting solutions out there.

One consistent step in all the shared hosting instructions is to clear the cache. Because I don’t have a CLI, can I do the same thing from the file directory dialog? Can I erase files? And folders?
For example Twig has a bunch of randomly named folders permissions 755 with php files in it. The same is true of most subfolders in cache.

BTW, the version of grav I installed was the combined grav+admin

csixtyfour, great question.
There are no files in user/account except .gitkeep. No .yaml files.

user/accounts has the perms of 0755

And yes, I agree x10 is a both free (good) and limiting (bad) at times. I’ve used them for 10 years, now. This is the first time I’ve needed CLI.

@cragun but did you filled out this dialog? You have to create admin user by filling it out before you can use Grav, you know about it?


I’m so glad you asked. Yes, I did do the dialog, earlier before posting. Three times, and nothing seemed to happen.

Because you asked, I thought I would try it again, and by chance, I used the Chrome instead of Safari. This time, I got an error message on the password. This is the same password I used before. This time, because I saw the error message, I created a valid password, and the Admin created and the Dashboard created.

I am now able to see the main page.

When I can, I will try to recreate the missing password error message on safari. For now, I’m running on Chrome.

Huh, so the password validation didn’t show up in Safari?

I just tested this on a fresh Grav install with Safari. Here’s what happens when you try to use password as a password

This prompt only appears after you have clicked on ‘Create User’ and disappears if you change fields (it’s also not very informative).

By comparison the Chrome prompt:

And FF

1 Like

So IMO it qualifies as a bug report. @cragun, would you be so kind and report it on GitHub?

I’m not sure, this may be a limitation of Safari. I’m out of my depth on this so confirmation would be nice.

Andy and makerygo,

Let me see if I can reproduce it. My first installation I unzipped on mac and then ftp’d to the server and tried on safari. I did press create in the admin dialog but I didn’t see a message. My success path was ftp the zip file, unzip on the server, launch in chrome. It is possible the original ftp was incomplete or something funky .

Is there a way to cause that initial admin dialog to come up after I’ve already used it once…? Or do I need to try a fresh install ?



I’m not certain. You may be able to delete the user.yaml file in user/accounts/ (it will be named after your user, for me it was andy.yaml) to force the admin to prompt for a new admin user - I haven’t tried it.

You could always install few Grav instances locally…
@andy, can you compare code output in Chrome and Safari? Especially JS? I’d do it myself, but I don’t use mac :slight_smile:

I can do that once I’m back in front of a computer, sure :sunglasses: