eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plGrupypl.comp.www › Apache2 próbuje pobierać z /var/www zamiast ~/public_html
Ilość wypowiedzi w tym wątku: 10

  • 1. Data: 2015-06-24 15:37:57
    Temat: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    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/inde
    x 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/.htp
    ass"
    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|cap
    tcha)
    RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
    #v-

    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/inde
    x 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!


  • 2. Data: 2015-06-24 18:53:43
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: "PawelS cbrbob(at)wbcd(dot)pl" <f...@e...org>

    j...@p...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/inde
    x 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/.htp
    ass"
    > 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|cap
    tcha)
    > 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/inde
    x 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!


  • 3. Data: 2015-06-24 19:31:17
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    znowu not found i znowu /var/www/index.php


  • 4. Data: 2015-06-24 19:40:17
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    Niczego w konfiguracji Apache'a nie zmieniałem.


  • 5. Data: 2015-06-24 20:16:55
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: Borys Pogoreło <b...@p...edu.leszno>

    Dnia Wed, 24 Jun 2015 06:37:57 -0700 (PDT), j...@p...onet.pl
    napisał(a):

    > RewriteEngine on
    > RewriteCond $1 !^(index\.php|robots\.txt|denial\.html|resources|cap
    tcha)
    > RewriteRule ^(.*)$ /index.php/$1 [L,QSA]

    A czemu w RewriteCond wyłączasz index.php? Nie wiem jak Apache, ale
    lighttpd bardzo nie lubi takiej kombinacji, bo to jednocześnie blokuje
    działanie samego przekierowania.

    > 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.

    A bez serwowania z UserDir, tylko bezpośrednio pod domeną działa?

    --
    Borys Pogoreło
    borys(#)leszno,edu,pl


  • 6. Data: 2015-06-25 05:44:01
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    > A bez serwowania z UserDir, tylko bezpośrednio pod domeną działa?

    Przekopiowałem witrynę do /var/www i zmodyfikowałem .htaccess:

    #v+
    AuthUserFile "/var/www/application/resources/.htpass"
    AuthName "Strony zabezpieczone"
    AuthType Basic
    require valid-user
    ErrorDocument 401 "/var/www/denial.html"
    DirectoryIndex index.php
    RewriteEngine on
    RewriteBase /
    RewriteCond $1 !^(index\.php|robots\.txt|denial\.html|resources|cap
    tcha)
    RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
    #v-

    Teraz:

    [Thu Jun 25 05:28:26 2015] [error] [client 127.0.0.1] File does not exist:
    /var/www/var, referer: http://localhost/index.php
    [Thu Jun 25 05:28:37 2015] [error] [client 127.0.0.1] File does not exist:
    /var/www/announcement


  • 7. Data: 2015-06-25 06:41:28
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    rewrite.log jest pusty


  • 8. Data: 2015-06-25 11:26:02
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    O, już nie jest pusty:

    robert@pecet:~/public_html$ sudo tail /var/www/rewrite.log
    127.0.0.1 - Robert [25/Jun/2015:11:10:55 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (1) [perdir /home/robert/public_html/]
    pass through /home/robert/public_html/index.php
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (3) [perdir /home/robert/public_html/]
    add path info postfix: /home/robert/public_html/announcement ->
    /home/robert/public_html/announcement/index
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (3) [perdir /home/robert/public_html/]
    strip per-dir prefix: /home/robert/public_html/announcement/index ->
    announcement/index
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (3) [perdir /home/robert/public_html/]
    applying pattern '^(.*)$' to uri 'announcement/index'
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (4) [perdir /home/robert/public_html/]
    RewriteCond: input='/home/robert/public_html/announcement' pattern='!-f' => matched
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (4) [perdir /home/robert/public_html/]
    RewriteCond: input='/home/robert/public_html/announcement' pattern='!-d' => matched
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (4) [perdir /home/robert/public_html/]
    RewriteCond: input='announcement/index'
    pattern='!^(index\\.php|robots\\.txt|denial\\.html|r
    esources|captcha)' => matched
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (2) [perdir /home/robert/public_html/]
    rewrite 'announcement/index' -> '/index.php/announcement/index'
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (2) [perdir /home/robert/public_html/]
    trying to replace prefix /home/robert/public_html/ with /
    127.0.0.1 - Robert [25/Jun/2015:11:11:05 +0200]
    [localhost/sid#b74602a0][rid#b6e2f058/initial] (1) [perdir /home/robert/public_html/]
    internal redirect with /index.php/announcement/index [INTERNAL REDIRECT]


  • 9. Data: 2015-06-25 14:56:20
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    W /etc/apache2/error.log mam:

    [Thu Jun 25 12:01:12 2015] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.18
    with Suhosin-Patch configured -- resuming normal operations
    [Thu Jun 25 12:40:38 2015] [notice] caught SIGTERM, shutting down
    [Thu Jun 25 14:51:02 2015] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.18
    with Suhosin-Patch configured -- resuming normal operations
    [Thu Jun 25 14:52:55 2015] [error] [client 127.0.0.1] File does not exist:
    /var/www/home, referer: http://localhost/index.php/announcement/index
    [Thu Jun 25 14:52:57 2015] [error] [client 127.0.0.1] File does not exist:
    /home/robert/public_html/captcha/1435236775.2758.jpg
    , referer: http://localhost/index.php/announcement/index
    [Thu Jun 25 14:53:03 2015] [error] [client 127.0.0.1] File does not exist:
    /var/www/announcement


  • 10. Data: 2015-06-26 11:04:17
    Temat: Re: Apache2 próbuje pobierać z /var/www zamiast ~/public_html
    Od: j...@p...onet.pl

    Na serwerze hostingowym działa OK, problem jest z localhostem. Chyba mam coś nie tak
    Apachem...

strony : [ 1 ]


Szukaj w grupach

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1

Wpisz nazwę miasta, dla którego chcesz znaleźć jednostkę ZUS.

Wzory dokumentów

Bezpłatne wzory dokumentów i formularzy.
Wyszukaj i pobierz za darmo: