Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Access forbbiden in accessing moodle page on web server

  1. #11

    Default Re: Access forbbiden in accessing moodle page on web server

    I'm searching for some clues in log files

    This is from /var/log/apache2/access_log when accessing localhost/info.php


    Code:
    ::1 - - [09/Sep/2019:17:40:24 +0200] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.33 (Linux/SUSE) PHP/7.3.9 (internal dummy connection)"
    ::1 - - [09/Sep/2019:17:40:26 +0200] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.33 (Linux/SUSE) PHP/7.3.9 (internal dummy connection)"


    And this from /var/log/apache2/error_log



    Code:
    [Mon Sep 09 01:40:35.791554 2019] [mpm_prefork:notice] [pid 31759] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 01:40:35.867882 2019] [mpm_prefork:notice] [pid 31829] AH00163: Apache/2.4.33 (Linux/SUSE) configured -- resuming normal operations
    [Mon Sep 09 01:40:35.867939 2019] [core:notice] [pid 31829] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:09:12.554176 2019] [mpm_prefork:notice] [pid 31829] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 02:09:12.637424 2019] [mpm_prefork:notice] [pid 32481] AH00163: Apache/2.4.33 (Linux/SUSE) configured -- resuming normal operations
    [Mon Sep 09 02:09:12.637489 2019] [core:notice] [pid 32481] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:10:05.735853 2019] [mpm_prefork:notice] [pid 32481] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 02:10:05.791799 2019] [mpm_prefork:notice] [pid 32547] AH00163: Apache/2.4.33 (Linux/SUSE) configured -- resuming normal operations
    [Mon Sep 09 02:10:05.791864 2019] [core:notice] [pid 32547] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:16:03.480063 2019] [mpm_prefork:notice] [pid 32547] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 02:16:03.549075 2019] [mpm_prefork:notice] [pid 461] AH00163: Apache/2.4.33 (Linux/SUSE) PHP/7.2.5 configured -- resuming normal operations
    [Mon Sep 09 02:16:03.549115 2019] [core:notice] [pid 461] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:28:10.256087 2019] [mpm_prefork:notice] [pid 461] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 02:28:10.326182 2019] [mpm_prefork:notice] [pid 758] AH00163: Apache/2.4.33 (Linux/SUSE) PHP/7.2.5 configured -- resuming normal operations
    [Mon Sep 09 02:28:10.326223 2019] [core:notice] [pid 758] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:28:32.077304 2019] [php7:error] [pid 763] [client 192.168.2.3:49796] script '/srv/www/htdocs/config.php' not found or unable to stat
    [Mon Sep 09 02:28:37.943496 2019] [php7:error] [pid 763] [client 192.168.2.3:49796] script '/srv/www/htdocs/test.php' not found or unable to stat
    [Mon Sep 09 02:33:10.820260 2019] [mpm_prefork:notice] [pid 758] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 02:33:10.890119 2019] [mpm_prefork:notice] [pid 919] AH00163: Apache/2.4.33 (Linux/SUSE) PHP/7.2.5 configured -- resuming normal operations
    [Mon Sep 09 02:33:10.890166 2019] [core:notice] [pid 919] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 02:37:54.253005 2019] [mpm_prefork:notice] [pid 919] AH00170: caught SIGWINCH, shutting down gracefully



    and then, after editing apache configuration with yast and reinstalling php7 ...... everithing goes worse. html pages stop working either, and I got this

    Code:
    [Mon Sep 09 17:43:25.040398 2019] [access_compat:error] [pid 8237] [client 192.168.2.3:34700] AH01797: client denied by server configuration: /srv/www/htdocs/, referer: http://192.168.2.2/
    [Mon Sep 09 17:46:29.186033 2019] [mpm_prefork:notice] [pid 8126] AH00170: caught SIGWINCH, shutting down gracefully
    [Mon Sep 09 17:46:29.287041 2019] [mpm_prefork:notice] [pid 8414] AH00163: Apache/2.4.33 (Linux/SUSE) PHP/7.3.9 configured -- resuming normal operations
    [Mon Sep 09 17:46:29.287093 2019] [core:notice] [pid 8414] AH00094: Command line: '/usr/sbin/httpd-prefork -D SYSCONFIG -D a2enflag -D MAILMAN -C PidFile /var/run/httpd.pid -C Include /etc/apache2/sysconfig.d//loadmodule.conf -C Include /etc/apache2/sysconfig.d//global.conf -f /etc/apache2/httpd.conf -c Include /etc/apache2/sysconfig.d//include.conf -D SYSTEMD -D FOREGROUND'
    [Mon Sep 09 17:46:33.273358 2019] [access_compat:error] [pid 8419] [client 192.168.2.3:34722] AH01797: client denied by server configuration: /srv/www/htdocs/, referer: http://192.168.2.2/
    [Mon Sep 09 17:46:35.271922 2019] [access_compat:error] [pid 8419] [client 192.168.2.3:34722] AH01797: client denied by server configuration: /srv/www/htdocs/
    [Mon Sep 09 17:47:35.321876 2019] [access_compat:error] [pid 8420] [client 192.168.2.3:34726] AH01797: client denied by server configuration: /srv/www/htdocs/index.htm
    [Mon Sep 09 17:47:38.804878 2019] [access_compat:error] [pid 8420] [client 192.168.2.3:34726] AH01797: client denied by server configuration: /srv/www/htdocs/index.html

  2. #12

    Default Re: Access forbbiden in accessing moodle page on web server

    Last problem was caused for changes in apache configuration files. For testing, I'm accessing the server via local ip, so apache is using ip-bsed_vhosts.conf.

    Changing to this (from the template) makes the server again return web pages (but processing of php continues failing)
    Code:
     <Directory /srv/www/htdocs>
       AllowOverride None
    
       <IfModule !mod_access_compat.c>
          Require all granted
       </IfModule>
       <IfModule mod_access_compat.c>
          Order allow,deny
          Allow from all
       </IfModule>
    
     </Directory>



    Now, looking at

    /var/log/apache2/access_log

    I can see entries anytime I access html web pages on the server, but nothing when I try to access localhost/info.php

    In
    /var/log/apache2/error_log

    I can't see anything when accessing localhost/info.php

  3. #13
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,807
    Blog Entries
    14

    Default Re: Access forbbiden in accessing moodle page on web server

    All my vhosts have this, without testing for presence of modules:
    Code:
     <Directory /srv/www/htdocs/SUBDOMAINFOLDERHERE/>
      AllowOverride None
      Require all granted
     </Directory>
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  4. #14

    Default Re: Access forbbiden in accessing moodle page on web server

    I'm going crazy

    I have tried with opera

    192.168.2.2/info.php

    https://susepaste.org/55666560

    Code:
    192.168.2.3 - - [09/Sep/2019:19:06:35 +0200] "GET /info.php HTTP/1.1" 200 73601 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.68"
    192.168.2.3 - - [09/Sep/2019:19:06:36 +0200] "GET /favicon.ico HTTP/1.1" 200 302 "http://192.168.2.2/info.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.68"
    192.168.2.3 - - [09/Sep/2019:19:07:17 +0200] "-" 408 - "-" "-"

    Processes the php and works


    But with firefox it still return the "save file" dialog ............ and .... it was the file was cached. Opening a private window in firefox and going to 192.168.2.2/info.php works well also.

    But 192.168.2.2/moodle return a blank page.
    So maybe now what I have is php working but moodle not working well with php

  5. #15

    Default Re: Access forbbiden in accessing moodle page on web server

    Quote Originally Posted by Knurpht View Post
    All my vhosts have this, without testing for presence of modules:
    Code:
     <Directory /srv/www/htdocs/SUBDOMAINFOLDERHERE/>
      AllowOverride None
      Require all granted
     </Directory>
    I have inherited the apache configuration from previous ones, I have the compat module activated. I think I should tidy up a little.

  6. #16

    Default Re: Access forbbiden in accessing moodle page on web server

    Solved!!

    It was not an error but three

    First)
    When updating, some configuration files of the webserver are changed. Were I previously had

    Code:
    <Directory /srv/www/htdocs>
       AllowOverride None
    
       <IfModule !mod_access_compat.c>
          Require all granted
       </IfModule>
       <IfModule mod_access_compat.c>
          Order allow,deny
          Allow from all
       </IfModule>
    
     </Directory>
    So access to the server is allowed, the upgrade cahnge some of them to "Requiere all denied" so it blocked the access to /srv/www/htdocs
    (maybe it happened when trying to change apache configuration with YAST)


    Second) php extension was not (properly) enabled in apache.
    To configure it I had to run (for php5)
    Code:
    #a2enmod php5
    o (for php7)
    Code:
    #a2enmod php7
    You can list which modules are enabled with

    Code:
    #a2enmod -l
    But yo need to know which modules are really running with

    Code:
    #apache2ctl -M
    Once enabled, test it placing a file called info.php in /srv/www/htdocs
    PHP Code:
    <?php

      
    // Show all information, defaults to INFO_ALL
      
    phpinfo();

    ?>
    restart the web server
    Code:
    #systemctl restart apache2
    And check that php is really running, browsing http://webserver/info.php



    Third) Moodle only support php7 from version 3.0.1 upwards, as described here As my moodle is version 2 I needed to downgrade to php5 (Opensuse leap 15.1 uses php7 by default).


    Thank to everybody

    best regards.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •