🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.www
Article #408252

Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html

#408252
From: PawelS cbrbob(at)wbcd(dot)pl
Date: Wed, 24 Jun 2015 16:53
33 lines
2803 bytes
jivanmukta@poczta.onet.pl pisze:
> Uczę się PHP5 i innych technologii WWW. Napisałem na localhoście witrynę w PHP5 (CodeIgniter). Otwieram ją tak: http://localhost/~robert/index.php/announcement/index i działa. Jednak chciałbym zrobić, tak żeby adres nie zawierał pliku index.php, tzn. http://localhost/~robert/announcement/index. Oczywiście announcement to controler a index to akcja.
> Zrobiłem wg dokumentacji CodeIgnitera i materiałów w sieci. Tzn. ustawiłem w pliku ~/public_html/application/config/config.php:
>   $config['index_page'] = ''; // 'index.php';
>   $config['uri_protocol']	= 'REQUEST_URI';
> Natomiast ~/public_html/.htaccess ma postać:
> 
> #v+
> AuthUserFile "/home/robert/public_html/application/resources/.htpass"
> AuthName "Strony zabezpieczone"
> AuthType Basic
> require valid-user
> ErrorDocument 401 "/home/robert/public_html/denial.html"
> DirectoryIndex index.php
> RewriteEngine on
> RewriteCond $1 !^(index\.php|robots\.txt|denial\.html|resources|captcha)
> RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
> #v-
Może spróbuj tak, zgaduję, zła konstrukcja: RewriteCond + RewriteRule:
RewriteEngine on
RewriteBase /
RewriteRule !(^index.php|^www|^lib) /index.php

> Kiedy teraz wpisuję w przeglądarce adres: http://localhost/~robert/announcement/index to dostaję 
> 
> Not Found
> The requested URL /index.php/announcement/index was not found on this server.
> 
> W log Apacha mam: [Wed Jun 24 15:23:59 2015] [error] [client 127.0.0.1] script '/var/www/index.php' not found or unable to stat
> 
> Moduł Userdirs mi działa, bo http://localhost/~robert/index.php/announcement/index działa. Oczywiście rewrite.load jest w katalogu /etc/apache2/mods-enabled.
> Dlaczego Apache2 próbuje pobierać index.php z /var/www zamiast z ~/public_html?
> Proszę o podpowiedź. Z góry dzięki!
Technical Details
Message-ID: <mmenan$cdh$1@node1.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <bbcc83df-6585-4c03-b4e7-20659bc197ac@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: "PawelS cbrbob(at)wbcd(dot)pl" <fake@email.org>
Newsgroups: pl.comp.www
Subject: Re: Apache2 próbuje pobierać z /var/www
 zamiast ~/public_html
Date: Wed, 24 Jun 2015 18:53:43 +0200
Organization: ATMAN - ATM S.A.
Lines: 33
Message-ID: <mmenan$cdh$1@node1.news.atman.pl>
References: <bbcc83df-6585-4c03-b4e7-20659bc197ac@googlegroups.com>
NNTP-Posting-Host: host-89-231-96-70.warszawa.mm.pl
Mime-Version: 1.0
X-Trace: node1.news.atman.pl 1435164823 12721 89.231.96.70 (24 Jun 2015 16:53:43 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Wed, 24 Jun 2015 16:53:43 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.24 (X11/20110622)
In-Reply-To: <bbcc83df-6585-4c03-b4e7-20659bc197ac@googlegroups.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit