🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.www.server-side
Article #61561

Re: nie działa PHP ale tylko dla dla userdir

#61561
From: Jivanmukta
Date: Sat, 22 Apr 2023 15:03
62 lines
3019 bytes
On 22.04.2023 13:22, Jivanmukta wrote:
> Mam problem z konfigacją Apache2 dla PHP5.6 w Ubuntu 22.04.
> Nie są serwowane pliki .php w userdir, ale w /var/www/html jest OK.
> Nie wiem co mam źle w konfiguracją bo userdir.conf zawiera:
> 
> <IfModule mod_userdir.c>
>      UserDir public_html
>      UserDir disabled root
> 
>      <Directory /home/*/public_html>
>          AllowOverride FileInfo AuthConfig Limit Indexes Options
>          Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
>          Require method GET POST OPTIONS
>      </Directory>
> </IfModule>
> 
> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
> 
> Natomiast mods-enabled/php5.6.conf:
> 
> 
> <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
>      SetHandler application/x-httpd-php
> </FilesMatch>
> <FilesMatch ".+\.phps$">
>      SetHandler application/x-httpd-php-source
>      # Deny access to raw php sources by default
>      # To re-enable it's recommended to enable access to the files
>      # only in specific virtual host or directory
>      Require all denied
> </FilesMatch>
> # Deny access to files without filename (e.g. '.php')
> <FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
>      Require all denied
> </FilesMatch>
> 
> # Running PHP scripts in user directories is disabled by default
> #
> # To re-enable PHP in user directories comment the following lines
> # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
> # prevents .htaccess files from disabling it.
> <IfModule mod_userdir.c>
>      <Directory /home/*/public_html>
> #        php_admin_flag engine Off
>      </Directory>
> </IfModule>

Dodanie do apache2.conf linii:

DocumentRoot /home/robert/public_html
<Directory />
         Options FollowSymLinks
         AllowOverride None
</Directory>
<Directory /home/robert/public_html>
         Options Indexes FollowSymLinks MultiViews
         AllowOverride All
         Order allow,deny
         Allow from all
</Directory>

nie pomaga. Nadal problem.
Technical Details
Message-ID: <u20t0i$1q8ib$1@portraits.wsisiz.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.2a01:110f:1532:2300:412e:1a40:3758:c2dc!not-for-mail
References: <u20g1f$1pktb$1@portraits.wsisiz.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED.2a01:110f:1532:2300:412e:1a40:3758:c2dc!not-for-mail
From: Jivanmukta <jivanmukta@poczta.onet.pl>
Newsgroups: pl.comp.www.server-side
Subject: Re: nie działa PHP ale tylko dla dla userdir
Date: Sat, 22 Apr 2023 17:03:46 +0200
Organization: http://www.wit.edu.pl
Message-ID: <u20t0i$1q8ib$1@portraits.wsisiz.edu.pl>
References: <u20g1f$1pktb$1@portraits.wsisiz.edu.pl>
Mime-Version: 1.0
Injection-Date: Sat, 22 Apr 2023 15:03:46 -0000 (UTC)
Injection-Info: portraits.wsisiz.edu.pl; posting-host="2a01:110f:1532:2300:412e:1a40:3758:c2dc"; logging-data="1909323"; mail-complaints-to="abuse@wsisiz.edu.pl"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0
In-Reply-To: <u20g1f$1pktb$1@portraits.wsisiz.edu.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit