Acces denied in OpenSUSE web server

Hello,

I am trying to setup a GRAV site in a server running OpenSUSE 15.1 (Leap). As this server is running PHP v7.2.5, I am using GRAV v.1.6.31.

My procedure:

  • unpack GRAV at the webserver folder /srv/www/htdocs,

  • changed the folder name to site.

  • went to the installation folder and run:

    chown -R wwwrun .
    find . -type f | xargs chmod 664
    find ./bin -type f | xargs chmod 775
    find . -type d | xargs chmod 775
    find . -type d | xargs chmod +s
    umask 0002

Here wwwrun is the user under apache is running.

Now, when I point the browser to the folder (https://weberserver/site), I got the message:

# Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the [webmaster](mailto:webmaster@unifal-mg.edu.br).

## Error 403

I tested putting an index.html inside the installation folder, renamed the .htaccess, an got access to it.

I appreciate any help you can give me.

Regards,

Camps

Is there any solution to this issue?

Thx.

I’m also Brazilian, you were not very clear about your question, and I’m pretty sure it’s an apache permission problem.
Is the php extension present in the apache configuration file?
Configured index in apache config file?

I’m not a big user of Apache… but I tested it by renaming the .htaccess file (which is inside the GRAV folder) and put a file in PHP (to have the PHP information installed) and it worked ok. With that, I suppose the Apache php extension is working ok.

About the index, I run grep -ri 'DirectoryIndex' /etc/apache2/* and got:

/etc/apache2/conf.d/gitweb.conf:    DirectoryIndex gitweb.cgi
/etc/apache2/conf.d/mod_php7.conf:        DirectoryIndex index.php4
/etc/apache2/conf.d/mod_php7.conf:        DirectoryIndex index.php5
/etc/apache2/conf.d/mod_php7.conf:        DirectoryIndex index.php7
/etc/apache2/conf.d/mod_php7.conf:        DirectoryIndex index.php
/etc/apache2/httpd.conf:DirectoryIndex index.php index.html index.html.var
/etc/apache2/httpd.conf.rpmnew:DirectoryIndex index.html index.html.var

Yeah, I’m fine. Thanks for asking.

I’ll do some tests simulate some scenarios and see the results I’ll have more data to help you. But it is safe to say that failure of “GRAV” is not even.

While I pass the testicles. remove everything from the apache root directory and create an archipelago with extension".php “example” index.php " then edit the alquivo permissions to 664 and then add this inside with a text editor this:

<?php phpinfo(); ?>

This will cause Apache to call " PhP “and print all the"PhP” information on the screen. make sure that folders are allowed 775 and files are allowed 644.

Regards,
Utherbone (Gabriel)

Hi @UtherboneDEV

The test file index.php under the server root works fine. But, if I add the .htaccess (from GRAV) I got access forbidden message.

All the permission inside the GRAV installation folder were set as:

chown -R wwwrun .
find . -type f | xargs chmod 664
find ./bin -type f | xargs chmod 775
find . -type d | xargs chmod 775
find . -type d | xargs chmod +s
umask 0002

Hi @icamps , just noticed one thing when I have gone past your post, your php enviroment is lower than grav 1.7.x is requiring, wondering if this is the thing that might be causing an issue

See Raising PHP Requirements… Again | Grav CMS (getgrav.org)

This article shows how you can upgrade php,

How to install PHP 7.4 on OpenSUSE 15.1? - Linux Windows and android Tutorials (osradar.com)

It might be worth trying this first , if still problems, I can sort out a vm machine with opensuse and will try and replicate the issue but with the correct requirements met

Lets hope it spreads some light on the issue :slight_smile:

1 Like

Hello @spamhater , I already upgrade PHP to 7.4.6.

Ok , please forgive me on the lack of opensuse knowledge.

Before we get you running fully, the issue that you are having is that you have created a local grav installation under your home directory.

This makes grav have a bit of spat (not sure why).

We can get you up and running first then deal with how you actually are going to use grav & apache etc.

There are two options of installation.

One at the root of suselinux install or at a home level directory

They will require a few little pre-requisits and this is the method I used to get running (sorry if it look like, I am telling you to suck eggs)
php
I made sure that
php7-apc, php7-bz2, php7-curl, php7-exif, php7-fastcgi, php7-fpm, php7-gd, php7-gettext, php7-iconv, php7-json, php7-lzf, php7-mbstring, php7-openssl, php7-pear, php7-phar, php7-sockets, php7-tokenizer, php7-xmlreader, php7-xmlwrtier, php7-zip, php7-zlib

Now open an xterm up and use the su command to access as root.

 su root 
 Enter root password <password>

The text will turn red to show root was succesfull (ie the password was right)

Next thing was to ensure composer was installed and upto date

composer self-update

then

  composer -V

should report back v2.0.14

 composer create-project getgrav/grav ./grav

this will install grav to a folder called grav in the home directory

we now want to change to that directory

cd grav

we are going install the admin gui package for easy of use, so type

bin/gpm install admin

Should prompt to install (Y)

after that is done, we are going to use grav testing server

php -S localhost:3456 system/router.php

Now the terminal window will be running a testing enviroment, leave this running.

If you stop it or close it down, it has been ran again as admin / root level user

so now open your browser window

enter

localhost:3456 

you should be now presented with a working grav admin screen.

The issue that I found was that a php session handler that grav requires cant be run at a user level , it requires higher privildges hence why you need super user access.

If you get up and running and report back any issues, we can go from there to looking at how you want to run your enviroment (a lamp stack, apache etc) but to test you do not need it. Just that su php -S command.

Didnt have to alter any permission.

HTH and gets you on your way :slight_smile:

1 Like

Hello @spamhater. Thanks for the help.

I followed your instructions and got the following:

  • I didn’t have the following packages: php7-lzf, php7-pear, php7-sockets, php7-gettext, php7-fpm, php7-fastcgi, php7-exif, php7-bz2. I install all of them.
  • The package php7-apc was not found in the suselinux repos.
  • I successfully load the admin interface.
  • The output from php -S localhost:3456 system/router.php when loading GRAV was (all green and some yellow)

[Wed May 26 16:06:52 2021] [::1]:57158 Accepted
[Wed May 26 16:06:53 2021] [::1]:57158 [302]: GET /
[Wed May 26 16:06:53 2021] [::1]:57158 Closing
[Wed May 26 16:06:53 2021] [::1]:57160 Accepted
[Wed May 26 16:06:54 2021] [::1]:57160 [200]: GET /admin
[Wed May 26 16:06:54 2021] [::1]:57160 Closing
[Wed May 26 16:06:54 2021] [::1]:57162 Accepted
[Wed May 26 16:06:54 2021] [::1]:57162 [200]: GET /user/plugins/admin/themes/grav/css-compiled/nucleus.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57164 Accepted
[Wed May 26 16:06:54 2021] [::1]:57162 Closing
[Wed May 26 16:06:54 2021] [::1]:57164 [200]: GET /user/plugins/admin/themes/grav/css-compiled/template.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57164 Closing
[Wed May 26 16:06:54 2021] [::1]:57166 Accepted
[Wed May 26 16:06:54 2021] [::1]:57166 [200]: GET /user/plugins/markdown-notices/assets/notices.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57166 Closing
[Wed May 26 16:06:54 2021] [::1]:57168 Accepted
[Wed May 26 16:06:54 2021] [::1]:57168 [200]: GET /user/plugins/admin/themes/grav/css-compiled/simple-fonts.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57168 Closing
[Wed May 26 16:06:54 2021] [::1]:57170 Accepted
[Wed May 26 16:06:54 2021] [::1]:57172 Accepted
[Wed May 26 16:06:54 2021] [::1]:57174 Accepted
[Wed May 26 16:06:54 2021] [::1]:57176 Accepted
[Wed May 26 16:06:54 2021] [::1]:57176 [200]: GET /user/plugins/admin/themes/grav/css/fork-awesome.min.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57174 [200]: GET /user/plugins/admin/themes/grav/css/chartist.min.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57172 [200]: GET /user/plugins/admin/themes/grav/css/selectize.min.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57170 [200]: GET /user/plugins/admin/themes/grav/css/hint.base.min.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57176 Closing
[Wed May 26 16:06:54 2021] [::1]:57174 Closing
[Wed May 26 16:06:54 2021] [::1]:57172 Closing
[Wed May 26 16:06:54 2021] [::1]:57170 Closing
[Wed May 26 16:06:54 2021] [::1]:57178 Accepted
[Wed May 26 16:06:54 2021] [::1]:57180 Accepted
[Wed May 26 16:06:54 2021] [::1]:57178 [200]: GET /user/plugins/admin/themes/grav/css/iconpicker.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57182 Accepted
[Wed May 26 16:06:54 2021] [::1]:57180 [200]: GET /assets/admin-preset.css?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57182 [200]: GET /system/assets/jquery/jquery-2.x.min.js?a584b30dc6
[Wed May 26 16:06:54 2021] [::1]:57178 Closing
[Wed May 26 16:06:54 2021] [::1]:57180 Closing
[Wed May 26 16:06:54 2021] [::1]:57182 Closing
[Wed May 26 16:06:54 2021] [::1]:57184 Accepted
[Wed May 26 16:06:54 2021] [::1]:57184 [200]: GET /user/plugins/admin/themes/grav/fonts/forkawesome-webfont.woff2?v=1.1.5
[Wed May 26 16:06:54 2021] [::1]:57184 Closing
[Wed May 26 16:06:54 2021] [::1]:57186 Accepted
[Wed May 26 16:06:54 2021] [::1]:57186 [200]: GET /user/plugins/admin/themes/grav/images/favicon.png
[Wed May 26 16:06:54 2021] [::1]:57186 Closing
[Wed May 26 16:08:54 2021] [::1]:57210 Accepted
[Wed May 26 16:08:54 2021] [::1]:57212 Accepted
[Wed May 26 16:08:54 2021] [::1]:57214 Accepted
[Wed May 26 16:08:54 2021] [::1]:57216 Accepted
[Wed May 26 16:08:54 2021] [::1]:57218 Accepted
[Wed May 26 16:08:54 2021] [::1]:57220 Accepted
[Wed May 26 16:08:59 2021] [::1]:57214 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:08:59 2021] [::1]:57214 Closing
[Wed May 26 16:08:59 2021] [::1]:57210 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:08:59 2021] [::1]:57210 Closing
[Wed May 26 16:08:59 2021] [::1]:57212 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:08:59 2021] [::1]:57212 Closing
[Wed May 26 16:09:00 2021] [::1]:57216 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:09:00 2021] [::1]:57216 Closing
[Wed May 26 16:09:00 2021] [::1]:57218 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:09:00 2021] [::1]:57218 Closing
[Wed May 26 16:09:00 2021] [::1]:57220 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:09:00 2021] [::1]:57220 Closing
[Wed May 26 16:09:03 2021] [::1]:57222 Accepted
[Wed May 26 16:09:03 2021] [::1]:57222 [200]: POST /admin
[Wed May 26 16:09:03 2021] [::1]:57222 Closing
[Wed May 26 16:09:11 2021] [::1]:57224 Accepted
[Wed May 26 16:09:12 2021] [::1]:57224 [200]: GET /user/plugins/admin/themes/grav/css-compiled/nucleus.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57226 Accepted
[Wed May 26 16:09:12 2021] [::1]:57224 Closing
[Wed May 26 16:09:12 2021] [::1]:57226 [200]: GET /user/plugins/admin/themes/grav/css-compiled/template.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57228 Accepted
[Wed May 26 16:09:12 2021] [::1]:57230 Accepted
[Wed May 26 16:09:12 2021] [::1]:57226 Closing
[Wed May 26 16:09:12 2021] [::1]:57230 [200]: GET /user/plugins/admin/themes/grav/css-compiled/simple-fonts.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57230 Closing
[Wed May 26 16:09:12 2021] [::1]:57228 [200]: GET /user/plugins/markdown-notices/assets/notices.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57228 Closing
[Wed May 26 16:09:12 2021] [::1]:57232 Accepted
[Wed May 26 16:09:12 2021] [::1]:57234 Accepted
[Wed May 26 16:09:12 2021] [::1]:57236 Accepted
[Wed May 26 16:09:12 2021] [::1]:57232 [200]: GET /user/plugins/admin/themes/grav/css/fork-awesome.min.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57234 [200]: GET /user/plugins/admin/themes/grav/css/chartist.min.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57236 [200]: GET /user/plugins/admin/themes/grav/css/selectize.min.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57232 Closing
[Wed May 26 16:09:12 2021] [::1]:57234 Closing
[Wed May 26 16:09:12 2021] [::1]:57236 Closing
[Wed May 26 16:09:12 2021] [::1]:57238 Accepted
[Wed May 26 16:09:12 2021] [::1]:57238 [200]: GET /user/plugins/admin/themes/grav/css/hint.base.min.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57238 Closing
[Wed May 26 16:09:12 2021] [::1]:57240 Accepted
[Wed May 26 16:09:12 2021] [::1]:57242 Accepted
[Wed May 26 16:09:12 2021] [::1]:57244 Accepted
[Wed May 26 16:09:12 2021] [::1]:57242 [200]: GET /assets/admin-preset.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57240 [200]: GET /user/plugins/admin/themes/grav/css/iconpicker.css?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57244 [200]: GET /system/assets/jquery/jquery-2.x.min.js?a584b30dc6
[Wed May 26 16:09:12 2021] [::1]:57242 Closing
[Wed May 26 16:09:12 2021] [::1]:57240 Closing
[Wed May 26 16:09:12 2021] [::1]:57244 Closing
[Wed May 26 16:10:47 2021] [::1]:57246 Accepted
[Wed May 26 16:10:52 2021] [::1]:57246 Closed without sending a request; it was probably just an unused speculative preconnection
[Wed May 26 16:10:52 2021] [::1]:57246 Closing
[Wed May 26 16:10:54 2021] [::1]:57248 Accepted
[Wed May 26 16:10:54 2021] [::1]:57248 [303]: POST /admin
[Wed May 26 16:10:54 2021] [::1]:57248 Closing
[Wed May 26 16:10:56 2021] [::1]:57252 Accepted
[Wed May 26 16:10:56 2021] [::1]:57252 [302]: GET /admin/
[Wed May 26 16:10:56 2021] [::1]:57252 Closing
[Wed May 26 16:10:58 2021] [::1]:57254 Accepted
[Wed May 26 16:10:58 2021] [::1]:57254 [200]: GET /admin
[Wed May 26 16:10:58 2021] [::1]:57254 Closing
[Wed May 26 16:11:02 2021] [::1]:57256 Accepted
[Wed May 26 16:11:02 2021] [::1]:57256 [200]: GET /user/plugins/admin/themes/grav/css-compiled/nucleus.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57256 Closing
[Wed May 26 16:11:02 2021] [::1]:57258 Accepted
[Wed May 26 16:11:02 2021] [::1]:57258 [200]: GET /user/plugins/admin/themes/grav/css-compiled/template.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57258 Closing
[Wed May 26 16:11:02 2021] [::1]:57260 Accepted
[Wed May 26 16:11:02 2021] [::1]:57262 Accepted
[Wed May 26 16:11:02 2021] [::1]:57260 [200]: GET /user/plugins/markdown-notices/assets/notices.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57262 [200]: GET /user/plugins/admin/themes/grav/css-compiled/simple-fonts.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57260 Closing
[Wed May 26 16:11:02 2021] [::1]:57262 Closing
[Wed May 26 16:11:02 2021] [::1]:57264 Accepted
[Wed May 26 16:11:02 2021] [::1]:57264 [200]: GET /user/plugins/admin/themes/grav/css/fork-awesome.min.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57264 Closing
[Wed May 26 16:11:02 2021] [::1]:57266 Accepted
[Wed May 26 16:11:02 2021] [::1]:57266 [200]: GET /user/plugins/admin/themes/grav/css/chartist.min.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57266 Closing
[Wed May 26 16:11:02 2021] [::1]:57268 Accepted
[Wed May 26 16:11:02 2021] [::1]:57268 [200]: GET /user/plugins/admin/themes/grav/css/selectize.min.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57268 Closing
[Wed May 26 16:11:02 2021] [::1]:57270 Accepted
[Wed May 26 16:11:02 2021] [::1]:57270 [200]: GET /user/plugins/admin/themes/grav/css/hint.base.min.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57270 Closing
[Wed May 26 16:11:02 2021] [::1]:57272 Accepted
[Wed May 26 16:11:02 2021] [::1]:57272 [200]: GET /user/plugins/admin/themes/grav/css/iconpicker.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57272 Closing
[Wed May 26 16:11:02 2021] [::1]:57274 Accepted
[Wed May 26 16:11:02 2021] [::1]:57274 [200]: GET /assets/admin-preset.css?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57274 Closing
[Wed May 26 16:11:02 2021] [::1]:57276 Accepted
[Wed May 26 16:11:02 2021] [::1]:57276 [200]: GET /system/assets/jquery/jquery-2.x.min.js?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57278 Accepted
[Wed May 26 16:11:02 2021] [::1]:57276 Closing
[Wed May 26 16:11:02 2021] [::1]:57278 [200]: GET /user/plugins/admin/themes/grav/js/vendor.min.js?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57280 Accepted
[Wed May 26 16:11:02 2021] [::1]:57278 Closing
[Wed May 26 16:11:02 2021] [::1]:57280 [200]: GET /user/plugins/admin/themes/grav/js/admin.min.js?a584b30dc6
[Wed May 26 16:11:02 2021] [::1]:57280 Closing
[Wed May 26 16:11:13 2021] [::1]:57284 Accepted
[Wed May 26 16:11:14 2021] [::1]:57284 [200]: POST /admin/task:getNotifications
[Wed May 26 16:11:14 2021] [::1]:57284 Closing
[Wed May 26 16:11:14 2021] [::1]:57286 Accepted
[Wed May 26 16:11:14 2021] [::1]:57288 Accepted
[Wed May 26 16:11:14 2021] ::1:57286 [200]: /admin/ajax.json/task:getNewsFeed
[Wed May 26 16:11:15 2021] [::1]:57286 Closing
[Wed May 26 16:11:15 2021] ::1:57288 [200]: /admin/update.json/task:getUpdates
[Wed May 26 16:11:15 2021] [::1]:57288 Closing

My GRAV installation is at the Apache root (/srv/www/htdocs/grav).

cool @icamps , we are getting there… , yep the php basically logs every transaction, page request whilst running. hopefully in the next couple of days… I will come back to you on how it was running.

I did overinstall on the modules ( Requirements | Grav Documentation (getgrav.org)) as I was doing it from memory. The apc is just a caching tool. The biggest thing the permission error had gone away and it isnt something parculiar about your install.

How did you install your apache ? Through suse yaml installer or are you using a stack or other software web server ? Need to replicated your installation as close as possible. :slight_smile:

1 Like

hopefully in the next couple of days… I will come back to you on how it was running.

Good!

How did you install your apache ? Through suse yaml installer or are you using a stack or other software web server ? Need to replicated your installation as close as possible.

I am using the Apache that came with the distro. Selected it from the suselinux installation.

1 Like

The problem was solved!

The full threat in the OpenSUSE forum can be seeing here.

The solution was to modify /etc/apache2/default-server.conf:

Options SymLinksIfOwnerMatch
AllowOverride All

Thanks all for the help.

2 Likes