[RIJEŠENO] Paswordom zaštićeni folderi u Apache2

Linux, poslužitelj, mreže i sigurnost

Moderator/ica: Moderatori/ce

Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

drade je napisao/la:
andrei je napisao/la: Ja sam to stavio u apache2.conf i dobio sam error 500... Što sada? Jesam dobro stavio?
Ako imas 000-default datoteku radije to tamo stavi.

Evo ti primjer navedene datoteke, koja sadrzi i sekciju koja ti treba da bi stvar radila.

Kod: Označi sve

NameVirtualHost *:80
<VirtualHost *:80>
        ServerAdmin xxxxxxx@xxxxxxx
        ServerName xxxxxxxxxxx

        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

## Ovdje pocinje tvoj dio
        <Directory /putanja/do/zasticenog/direktorija>
                 AllowOverride All
        </Directory>
## Ovdje zavrsava tvoj dio
              
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

#       CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
nemam taj fajl :(
Avatar
drade
Postovi: 910
Pridružen/a: 12 svi 2010, 07:57
OS: linux

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la drade »

Izlistaj sadrzaj foldera /etc/apache2/sites-enabled, postaj output ovdje.

Takodjer, ako nije problem, daj postaj httpd.conf datoteku.
When you're a kid and you wanna go "Weee !", but you ain't got drugs yet ... You hold out for your life, hold on to your little GONADS ... and STRIFE.
Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

drade je napisao/la:Izlistaj sadrzaj foldera /etc/apache2/sites-enabled, postaj output ovdje.

Takodjer, ako nije problem, daj postaj httpd.conf datoteku.
Budem ujutro kada će server biti upaljen. Gdje se nalazi httpd.conf?
Avatar
drade
Postovi: 910
Pridružen/a: 12 svi 2010, 07:57
OS: linux

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la drade »

andrei je napisao/la:
drade je napisao/la:Izlistaj sadrzaj foldera /etc/apache2/sites-enabled, postaj output ovdje.

Takodjer, ako nije problem, daj postaj httpd.conf datoteku.
Budem ujutro kada će server biti upaljen. Gdje se nalazi httpd.conf?
Sudeci prema apache2.conf datoteci koju si postao ranije, trebao bi biti u istom direktoriju. No, ako ne postoji, zanemari to i samo postaj sadrzaj direktorija /etc/apache2/sites-available i /etc/apache2/sites-enabled.
When you're a kid and you wanna go "Weee !", but you ain't got drugs yet ... You hold out for your life, hold on to your little GONADS ... and STRIFE.
Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

Evo :D :

Kod: Označi sve

root@server:/home/andrei# ls /etc/apache2/sites-available
default  default-ssl

Kod: Označi sve

root@server:/home/andrei# ls /etc/apache2/sites-enabled
000-default
:ups: nisam ni znao da postoji :) hehe Idem probati dodati
Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

Evo kako sada fajl izgleda:

Kod: Označi sve

<VirtualHost *:80>
ServerAdmin webmaster@localhost
<Directory /var/www/dokumenti>
                 AllowOverride All
        </Directory>
DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
IndexOptions FancyIndexing
Options FollowSymLinks
</VirtualHost>
I dalje dobivam error 500. Httpd file je i potpuno prazan. Inače koristim webmin ako to nešto znači :) hvala na pomoći
Avatar
drade
Postovi: 910
Pridružen/a: 12 svi 2010, 07:57
OS: linux

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la drade »

Nacelno nije problem sto koristis webmin (osobno nikada nisam bio fan istoga).

Pobrisi sekciju za password zasticeni direktorij iz apache2.conf datoteke (ukoliko vec nisi).

Kakve permisije ima /var/www/dokumenti direktorij ?

Ovaj dio

Kod: Označi sve

<Directory /var/www/dokumenti/>
                 AllowOverride All
</Directory>
Stavi izmedju (zbog preglednosti):

Kod: Označi sve

<Directory />
                Options FollowSymLinks
                AllowOverride None
</Directory>
i

Kod: Označi sve

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
</Directory>
Restartaj apache servis.

Postaj /var/log/apache2/error.log datoteku.
When you're a kid and you wanna go "Weee !", but you ain't got drugs yet ... You hold out for your life, hold on to your little GONADS ... and STRIFE.
Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

drade je napisao/la:Nacelno nije problem sto koristis webmin (osobno nikada nisam bio fan istoga).

Pobrisi sekciju za password zasticeni direktorij iz apache2.conf datoteke (ukoliko vec nisi).

Kakve permisije ima /var/www/dokumenti direktorij ?

Ovaj dio

Kod: Označi sve

<Directory /var/www/dokumenti/>
                 AllowOverride All
</Directory>
Stavi izmedju (zbog preglednosti):

Kod: Označi sve

<Directory />
                Options FollowSymLinks
                AllowOverride None
</Directory>
i

Kod: Označi sve

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
</Directory>
Restartaj apache servis.

Postaj /var/log/apache2/error.log datoteku.
Dozvole na /var/www/dokumenti:

Kod: Označi sve

lrwxrwxrwx  1 root   root     10 2011-12-05 22:45 dokumenti -> /dokumenti
Okej promjenio to.

Kod: Označi sve

[Wed Dec 07 11:04:45 2011] [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.1 with Suhosin-Patch configured -- resuming normal operations
[Wed Dec 07 11:05:11 2011] [error] [client 66.249.68.47] File does not exist: /var/www/anarhizam
[Wed Dec 07 11:06:01 2011] [error] [client 66.249.68.47] File does not exist: /var/www/anarhizam
[Wed Dec 07 11:06:16 2011] [alert] [client 141.136.223.95] /var/www/dokumenti/.htaccess: AllowOverride not allowed here, referer: http://neka.adresa.org/
I ne znam zašto mi javlja ovo za /var/www/anarhizam, nemam nikakve linkove prema tome... :S
Zadnja izmjena: andrei, dana/u 07 pro 2011, 20:56, ukupno mijenjano 1 put.
Avatar
drade
Postovi: 910
Pridružen/a: 12 svi 2010, 07:57
OS: linux

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la drade »

Postaj sadrzaj datoteke .htaccess. To jest, izbrisi .htaccess datoteku unutar /var/www/dokumenti foldera.

Sigurno ti se negdje nalazi ovaj /var/www/anarhizam, napravi

Kod: Označi sve

grep -ri anarhizam /etc/apache2/*
Postaj output ovdje.
When you're a kid and you wanna go "Weee !", but you ain't got drugs yet ... You hold out for your life, hold on to your little GONADS ... and STRIFE.
Avatar
andrei
Postovi: 300
Pridružen/a: 29 kol 2009, 06:40
Spol: M
OS: Ubuntu 14.04 Unity/i3
Lokacija: Zagreb
Kontakt:

Re: Paswordom zaštićeni folderi u Apache2

Post Postao/la andrei »

prvo: izbrisao sam
drugo: ne daje ništa, prazni output
Odgovori