Director public

23 posts / 0 new
Last post
Anonymous
Director public

Folosesc mandriva 2006 si as dori sa stiu cum pot sa fac un director public care sa poate fi vizualizat din exterior. Adica sa introduc ip_real in browser si numele_directorului si sa se poate vizualiza toate fisierele (de ex: 80.123.34.24/test).
Este instalat apache si mysql.Nu vreu sa instalez ftp.

admin
admin's picture
Raspuns: Director public

pai te uiti in httpd.conf unde este setat DocumentRoot-ul, iar apoi in acel director creezi un altul, pe nume "test" sau cum vrei tu.

cgherman
cgherman's picture
Raspuns: Director public

cred ca vrea altceva: vrea sa vada continutul dintr-un director similar cu ftp.

ptr asta trebuie sa setezi in httpd.conf

AllowOverride All

si modul de afisare o faci printrun fisier .htaccess situtat in acel director.

http://httpd.apache.org/docs/2.0/howto/htaccess.html

admin
admin's picture
Raspuns: Director public

Sau in loc de AllowOverride All setezi: Options +Indexes, daca vrei sa ti se listeze continutul directorului.

Anonymous
Raspuns: Director public

Unde in http.conf scriu: AllowOverride All?

admin
admin's picture
Raspuns: Director public

Adauga o sectiune de genul:

AllowOverride All

restartezi apache

Iar apoi in /calea/unde/e/setat/document root/test adaugi un fisier .htaccess in care scrii: Options +Indexes

Anonymous
Raspuns: Director public

am scris in httpd.conf:

AllowOverride All

iar in dir "test" am pus un fisier .htaccess care contine:

AuthUserFile /var/www/html/admin/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Stuff"
AuthType "Basic"
Options +Indexes

require valid-user

-----------------------
Si daca scriu ip/test/ ---imi da mesajul"

You don't have permission to access /test/ on this server.
WebServer/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0 auth_external/2.2.1 auth_mysql/1.11 .....

admin
admin's picture
Raspuns: Director public

tail -f /var/log/httpd/error.log ce zice?

Anonymous
Raspuns: Director public

NU merge , ce nu am scris bine ?

admin
admin's picture
Raspuns: Director public

poate nu e aia calea buna catre error.log, verifica directorul /var/log

Anonymous
Raspuns: Director public

In error.log zice:

[Wed Nov 29 14:23:01 2006] [notice] WebServer/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0 auth_external/2.2.1 auth_mysql/1.11
[Wed Nov 29 14:23:08 2006] [error] [client 83.103.170.157] Directory index forbidden by rule: /var/www/html/test/
[Wed Nov 29 14:23:15 2006] [error] [client 83.103.170.157] File does not exist: /var/www/html/plugins.js, referer: http://195
[Wed Nov 29 14:23:15 2006] [error] [client 83.103.170.157] File does not exist: /var/www/html/plugins.js, referer: http://195
[Wed Nov 29 14:23:27 2006] [error] [client 83.103.170.157] Directory index forbidden by rule: /var/www/html/test/
[Wed Nov 29 14:27:06 2006] [error] [client 83.103.170.157] Directory index forbidden by rule: /var/www/html/test/

admin
admin's picture
Raspuns: Director public

Hmm, cauta in httpd.conf "estrictive"
e acolo o portiune unde cred ca seteaza pentru document root deny pt toata lumea, comenteaza linia aia cu allow si den (ii pui un # in fata), salvezi si restartezi apache.

Anonymous
Raspuns: Director public

nu am in httpd2.conf  nici un: estrictive

Anonymous
Raspuns: Director public

Am reusit!
Raspuns  pt cei care au aceasta problema:

- am scris in fis ".htacces" numai: ---> Options +Indexes si nimic altceva .

Ps: multumesc tuturor

cgherman
cgherman's picture
Raspuns: Director public

Pentru efecte suplimentare poti scrie in .htaccess:

Options +Indexes
IndexOptions +FancyIndexing +FoldersFirst +HTMLTable +ScanHTMLTitles +IgnoreCase
Valentin Bojin
Raspuns: Director public

Cum pot pune pe acel director user si parola?

admin
admin's picture
Raspuns: Director public

Ai aici tot ce trebuie sa stii: http://httpd.apache.org/docs/2.0/howto/auth.html

Valentin Bojin
Raspuns: Director public

Am pus in directorul acela cele 2 fisiere:

.htaceess care contine :

AuthUserFile .htpasswd
AuthName "Restricted Stuff"
AuthType Basic

require valid-user

iar in .htpasswd care contine:

nume_user:parola 

Imi cere user si parola cand intru din browser dar nu pot aceesa ca si cum  user-ul si parola care am introdus-o in .htpasswd nu e corecta.

admin
admin's picture
Raspuns: Director public

1. poate ar fi bine sa dai toata calea pentru .htpasswd
2. parolele ar trebui cryptate, adaugarea unui user se face cu: htpasswd -c /calea/catre/.htpasswd nume-user

PS: "-c" folosesti numai prima oara cand se creaza fisierul, cand adaugi al doilea user nu mai folosesti acest switch pentru ca-ti va goli fisierul.

Valentin Bojin
Raspuns: Director public

Am pus:

.htaccess: 

AuthUserFile /home/public/update/test/.htpasswd
AuthName "Restricted Stuff"
AuthType Basic

require valid-user

.htpasswd:

htpasswd -c /home/public/update/test/.htpasswd parola

Dar, tot nu se logheaza.

admin
admin's picture
Raspuns: Director public

hombre, ia mai citeste odata http://httpd.apache.org/docs/2.0/howto/auth.html ca vad ca nu te-ai prins.

Syl
Syl's picture
Raspuns: Director public

[url=http://toxic-chat.sourceforge.net/]ToXic Chat[/url]. Come on people, let's talk sick! | [url=http://sourceforge.net/export/rss2_projnews.php?group_id=129863]Stiri RSS[/url]
[url=http://www.caramida-verde.as.ro/]Cărămida Verde[/url]: intelige

Valentin Bojin
Raspuns: Director public

Multumesc mult Syl , a mers.