Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [SF][SF2] Listowanie plików na serwerze
wiciu010
post
Post #1





Grupa: Zarejestrowani
Postów: 195
Pomógł: 0
Dołączył: 29.04.2007

Ostrzeżenie: (0%)
-----


Cześć,

Posiadam serwer vps z zainstalowanym apache 2.4.7 + php + mysql.
Próbuję przenieść z innego serwera aplikację napisaną w Symfony2. Stworzyłem Virtual Host:

Kod
<VirtualHost *:80>
    DocumentRoot /var/www/html/moj.adres.pl/web
    DirectoryIndex index.php
    ServerName moj.adres.pl
    ServerAlias www.moj.adres.pl
    ServerAdmin admin@adres.pl
    ErrorLog /var/www/html/moj.adres.pl/error.log
    CustomLog /var/www/html/moj.adres.pl/access.log combined
    <Directory "/var/www/html/moj.adres.pl">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>


Konfiguracja .htaccess w katalogu /web

Kod
<IfModule mod_rewrite.c>
    RewriteEngine On        
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>


Niestety po wejściu na adres zamiast wyświetlenia serwisu otrzymuję wylistowane pliki z katalogu /web.

Czym to może być spowodowane? Co może być źle skonfigurowane na serwerze?
Go to the top of the page
+Quote Post
ohm
post
Post #2





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

Ostrzeżenie: (0%)
-----


http://symfony.com/doc/current/cookbook/co...figuration.html - tutaj masz pełną konfigurację serwera
Go to the top of the page
+Quote Post
wiciu010
post
Post #3





Grupa: Zarejestrowani
Postów: 195
Pomógł: 0
Dołączył: 29.04.2007

Ostrzeżenie: (0%)
-----


Cytat(ohm @ 10.01.2016, 15:16:26 ) *
http://symfony.com/doc/current/cookbook/co...figuration.html - tutaj masz pełną konfigurację serwera


Mam tak skonfigurowane ale mimo to jest problem
Go to the top of the page
+Quote Post
ohm
post
Post #4





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

Ostrzeżenie: (0%)
-----


To jeszcze usuń DirectoryIndex
Go to the top of the page
+Quote Post
qbson69
post
Post #5





Grupa: Zarejestrowani
Postów: 20
Pomógł: 7
Dołączył: 3.01.2016

Ostrzeżenie: (0%)
-----


Może nie masz włączonego mod_rewrite?
Go to the top of the page
+Quote Post
wiciu010
post
Post #6





Grupa: Zarejestrowani
Postów: 195
Pomógł: 0
Dołączył: 29.04.2007

Ostrzeżenie: (0%)
-----


Cytat(qbson69 @ 10.01.2016, 17:06:12 ) *
Może nie masz włączonego mod_rewrite?


Raczej mam bo dla testów zrobiłem przekierowanie 301 na inna strone w .htaccess i zadzialalo
Go to the top of the page
+Quote Post
404
post
Post #7





Grupa: Zarejestrowani
Postów: 226
Pomógł: 25
Dołączył: 22.05.2011

Ostrzeżenie: (0%)
-----


Usunąłeś linijkę z DirectoryIndex jak kolega @ohm pisał?

Ten post edytował 404 10.01.2016, 17:27:55
Go to the top of the page
+Quote Post
wiciu010
post
Post #8





Grupa: Zarejestrowani
Postów: 195
Pomógł: 0
Dołączył: 29.04.2007

Ostrzeżenie: (0%)
-----


Cytat(404 @ 10.01.2016, 17:27:33 ) *
Usunąłeś linijkę z DirectoryIndex jak kolega @ohm pisał?


Tak usunąłem, ale nic to nie pomogło.

Dobra poradziłem sobie zmieniając w DirectoryIndex index.php na app.php, ale dziwne, że nie działało.

Jednak nie do końca działa. Pojawia się strona główna, ale już podstrony nie działają np moj.adres.pl/login.html zwraca error 404.

Coś jest z routingiem. Bo jak dodam app.php w adresie moj.adres.pl/app.php/login.html to wtedy działa poprawnie.

Ten post edytował wiciu010 10.01.2016, 19:29:03
Go to the top of the page
+Quote Post
viking
post
Post #9





Grupa: Zarejestrowani
Postów: 6 380
Pomógł: 1116
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


W takim razie nie działa pewnie mod rewrite.


--------------------
Go to the top of the page
+Quote Post
wiciu010
post
Post #10





Grupa: Zarejestrowani
Postów: 195
Pomógł: 0
Dołączył: 29.04.2007

Ostrzeżenie: (0%)
-----


Cytat(viking @ 10.01.2016, 21:05:36 ) *
W takim razie nie działa pewnie mod rewrite.


Masz racja. Problem rozwiązany.

Ten post edytował wiciu010 10.01.2016, 22:25:54
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 06:27