I would like to configure squid in such way, so that only specific (public) ip (reverse proxy), could connect to the server, but I don't know how... can someone tell me how to do this?
In Squid this is done by specifying the public IP address in
http_port, and using loopback address for the web server and Apache may be configured like in
httpd.conf to listen on the loopback address:
Port 80 BindAddress 127.0.0.1
Just read the squid.conf file. The default installation on Ubuntu only works for localhost. You will need to set up an ACL to enable access. This can include any address or address you choose.
You may want to review instructions for Setting up a Squid Proxy on Ubuntu. They should be applicable to most platforms.