View Full Version : Problema porte con Squid...
Ciao, ho alcuni problemini ad aprire una porta con squid..
Ho necessità di collegarmi al webmin su alcune macchine esterne, già configurate per accettare connessioni sulla 10000.
Ho aggiunto la riga:
acl Safe_ports port 10000 # webmin
Ma il risultato non cambia, dal browser ottengo un Permission Denied e nell'access log trovo questa voce:
1223995346.087 102 192.168.1.111 TCP_MISS/503 1459 GET http://www.mioserv.it:10000/ - DIRECT/- text/html
Avete idee? :)
Quando riavvii squid con /etc/init.d/squid restart sia in sylog che in /var/cache/squid/cache.log dovresti poter leggere gli eventuali errori nel parse delle acl. C'è qualcosa?
Quando riavvii squid con /etc/init.d/squid restart sia in sylog che in /var/cache/squid/cache.log dovresti poter leggere gli eventuali errori nel parse delle acl. C'è qualcosa?
CPU Usage: 1.866 seconds = 0.196 user + 1.670 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
total space in arena: 6056 KB
Ordinary blocks: 5403 KB 74 blks
Small blocks: 0 KB 5 blks
Holding blocks: 568 KB 2 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 652 KB
Total in use: 5971 KB 90%
Total free: 652 KB 10%
2008/10/15 09:47:26| Squid Cache (Version 2.6.STABLE19): Exiting normally.
2008/10/15 09:47:28| Starting Squid Cache version 2.6.STABLE19 for i386-redhat-linux-gnu...
2008/10/15 09:47:28| Process ID 4410
2008/10/15 09:47:28| With 1024 file descriptors available
2008/10/15 09:47:28| Using epoll for the IO loop
2008/10/15 09:47:28| DNS Socket created at 0.0.0.0, port 37477, FD 6
2008/10/15 09:47:28| Adding nameserver 151.99.125.2 from /etc/resolv.conf
2008/10/15 09:47:28| Adding nameserver 151.99.125.3 from /etc/resolv.conf
2008/10/15 09:47:28| User-Agent logging is disabled.
2008/10/15 09:47:28| Referer logging is disabled.
2008/10/15 09:47:28| Unlinkd pipe opened on FD 11
2008/10/15 09:47:28| Swap maxSize 102400 KB, estimated 7876 objects
2008/10/15 09:47:28| Target number of buckets: 393
2008/10/15 09:47:28| Using 8192 Store buckets
2008/10/15 09:47:28| Max Mem size: 8192 KB
2008/10/15 09:47:28| Max Swap size: 102400 KB
2008/10/15 09:47:28| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2008/10/15 09:47:28| Rebuilding storage in /var/squid/cache (CLEAN)
2008/10/15 09:47:28| Using Least Load store dir selection
2008/10/15 09:47:28| Current Directory is /
2008/10/15 09:47:28| Loaded Icons.
2008/10/15 09:47:28| Accepting proxy HTTP connections at 0.0.0.0, port 8080, FD 13.
2008/10/15 09:47:28| Accepting ICP messages at 0.0.0.0, port 3130, FD 14.
2008/10/15 09:47:28| WCCP Disabled.
2008/10/15 09:47:28| Ready to serve requests.
2008/10/15 09:47:28| Done reading /var/squid/cache swaplog (0 entries)
2008/10/15 09:47:28| Finished rebuilding storage from disk.
2008/10/15 09:47:28| 0 Entries scanned
2008/10/15 09:47:28| 0 Invalid entries.
2008/10/15 09:47:28| 0 With invalid flags.
2008/10/15 09:47:28| 0 Objects loaded.
2008/10/15 09:47:28| 0 Objects expired.
2008/10/15 09:47:28| 0 Objects cancelled.
2008/10/15 09:47:28| 0 Duplicate URLs purged.
2008/10/15 09:47:28| 0 Swapfile clashes avoided.
2008/10/15 09:47:28| Took 0.3 seconds ( 0.0 objects/sec).
2008/10/15 09:47:28| Beginning Validation Procedure
2008/10/15 09:47:28| Completed Validation Procedure
2008/10/15 09:47:28| Validated 0 Entries
2008/10/15 09:47:28| store_swap_size = 0k
credo che tu abbia dimenticato la acl vera e propria e si trova qui :
dopo questa riga:
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
fammi sapere !! ;)
In realtà dovrebb essere a posto... :confused:
http_port 8080
icp_port 3130
cache_mem 8 MB
cache_dir ufs /var/squid/cache 100 16 256
cache_access_log /var/log/access.log
cache_log /var/log/cache.log
cache_store_log /var/log/store.log
cache_swap_log /var/log/swap.log
emulate_httpd_log off
mime_table /etc/squid/mime.conf
pid_filename /var/run/squid.pid
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 10000 # https, snews
acl Safe_ports port 554 7070 # radio rai
acl Safe_ports port 1863 # MSN
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 10000 # webmin
acl locallan src 192.168.1.0/255.255.255.0
acl local2 src 192.168.2.0/255.255.255.0
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow locallan
http_access allow local2
http_access deny all
cache_mgr squid@miodom.it
cache_effective_user squid
cache_effective_group squid
visible_hostname squid.miodom.it
append_domain .miodom.it
delay_pools 1
delay_class 1 3
delay_parameters 1 384000/384000 384000/384000 384000/384000
Ovviamente bypassando il proxy funziona tutto correttamente... attraverso squid l'errore è questo:
ERROR
The requested URL could not be retrieved
--------------------------------------------------------------------------------
While trying to retrieve the URL: http://esterno.miodom.it:10000/
The following error was encountered:
Connection to Failed
The system returned:
(13) Permission deniedThe remote host or network may be down. Please try the request again.
Your cache administrator is squid@miodom.it.
--------------------------------------------------------------------------------
Generated Thu, 16 Oct 2008 07:34:43 GMT by squid.miodom.it (squid/2.6.STABLE19)
eh si hai ragione!! le acl sembrano proprio a posto :( ho un dubbio... se puoi verificare quest acl http_access deny !Safe_ports
sicuramente è corretta...ma il commento mi lascia perplesso...
# Deny requests to unknown ports
quindi se puoi prova a segarla...e fammi sapere.. rimango in ascolto...!!;)
Dovrebbe essere uguale a http_access allow Safe_ports... però provo a modificare la riga, vediamo che succede.
Niente, nè commentandola, nè sostituendola con allow Safe_ports...
Nell'access.log trovo questa riga in concomitanza al tentativo di accesso:
1224144183.454 101 192.168.1.111 TCP_MISS/503 1459 GET http://serv.miodom.it:10000/ - DIRECT/- text/html
ciao
le acl di webmin permettono l'accesso all'ip di squid?
ciao
le acl di webmin permettono l'accesso all'ip di squid?
Certo, quel webmin è utilizzabile da qualsiasi ip...
allora la riga TCP_MISS/503 1459 GET http://serv.miodom.it:10000/ - DIRECT/- text/htm dice che squid non ha trovato l'url nella cache
il 503 dice Service Unavailable è pur vero che squid nel primo messaggio che hai postato dice :
(13) Permission deniedThe remote host or network may be down. Please try the request again.
ma se provi ad aprire una sessione di telnet verso quella porta, la sessione si apre o rimane closed ? questo giusto per capire il comportamento di squid..
per ora non mi viene in mente nient'altro !
Dalla macchina squid:
telnet www.mioserv.it 10000
Trying 195.100.100.100...
Connected to www.mioserv.it.
Escape character is '^]'.
...dialogano senza problemi... davvero non so più che pesci pigliare :confused:
grande!! la connessione c'è, questo è importante vuol dire che le tue acl fanno il loro lavoro .il problema è da qualche altra parte fammi pensare... fino a stasera!
quando torno a casa faccio un pò di prove e ti faccio sapere!
ciauz!:)
OK, ti ringrazio! Sei gentilissimo :)
ciao e scusami per il ritardo ma quando ospf e bgp fanno capricci...:cry: anyway
vediamo un po il da farsi per il tuo problema... ora.. noi sappiamo che TCP_MISS/503 1459 GET http://www.mioserv.it:10000/ - DIRECT/- text/html
TCP_MISS= non era nella cache
503 = servizio non disponibile
DIRECT= squid ha avuto accesso al sito direttamente
tu hai provato a connetterti al sito in questione dalla stessa macchina dove è ospitato squid, o da un altra macchina ??
prova ad usare lynx x la connessione (dalla macchina che ospita squid) oppure il tuo browser di fiducia opportunamente configurato e se puoi postami i risultati..
attendo tue nuove da casa!;)
Innanzitutto grazie per la disponibilità.. :)
Ho provato a fare un telnet sulla porta 10000 dalla macchina squid e da lì vedo che questa non ha problemi ad accedere al server esterno.
Poi ho provato col mio pc che ha accesso diretto al web bypassando il proxy ma lavorando sempre dietro al fw (il che mi fa desumere che il problema sia proprio di squid).
Usando lynx dallo squid:
[root@squid /]# lynx http://www.mioserv.it:10000
______________________________________________________________________________________________________________________
Login a Webmin
Inserisci nome utente e password per il login al server Webmin su www.mioserv.it
Nome utente ____________________
Password ____________________
Login Pulisci
[ ] Ricorda login permanentemente
______________________________________________________________________________________________________________________
Questo da un pc che naviga attraverso squid:
ERROR: The requested URL could not be retrieved
ERROR
The requested URL could not be retrieved
___________________________________________________________________________
While trying to retrieve the URL: http://www.mioserv.it:10000/
The following error was encountered:
* Connection to Failed
The system returned:
(13) Permission denied
The remote host or network may be down. Please try the request again.
Your cache administrator is squid@miodom.it.
___________________________________________________________________________
Generated Fri, 17 Oct 2008 14:12:30 GMT by squid.miodom.it (squid/2.6.STABLE19)
ciao avevi ragione tu dal primo post... ora confronto le tue acl con le mie e ti faccio sapere...!!
a proposito, qui come sei messo ??
# TAG: http_reply_access
# Allow replies to client requests. This is complementary to http_access.
#
# http_reply_access allow|deny [!] aclname ...
#
# NOTE: if there are no access lines present, the default is to allow
# all replies
#
# If none of the access lines cause a match the opposite of the
# last line will apply. Thus it is good practice to end the rules
# with an "allow all" or "deny all" entry.
#
#Default:
# http_reply_access allow all
#
#Recommended minimum configuration:
#
# Insert your own rules here.
#
#
# and finally allow by default
http_reply_access allow all
...inserita anche questa, ma nulla... sono sicuro che squid legga correttamente le acl perchè disabilitando la porta 80 non si naviga più :confused:
ciao scusa la domanda stupida... squid dopo ogni modifica viene riavviato vero??
a parte 'sta boiata l'unica cosa che farei a questo punto e una bella sessione di tcpdump o affini ( se ne hai la possibilità) giusto x capire che cosa sta succedendo ....fammi sapere :)
Non mi era stata segnalata la tua risposta... pensavo mi avessi abbandonato :p
Ovviamente viene riavviato...
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.