How to prevent web access?

Hi guys,
I’ve installed freepbx on my remote web server (btw without changing apache user ;-)).
My problem is that to access the admin I have to go directly to my server ip, but it doesn’t ask me for any password!
How can I protect this access?

bye Alek

You can restrict access to any directory using:
htaccess & htpasswd

but the first file of the web gui is a single file not a folder is index.html.
I can’t restrict access to the www folder that contains this file.

Try writing a login page and name it as index.hlml. and then redirect that page to the main page after authentication.

but this way if someone goes directly to the admin page of freepbx can enter with no problem at all

Please read the first reply and check out htaccess and htpassword. That is exactly what you want. It will not allow access to the directory without a valid user ID and password. We use this for many custom web apps we build for clients and they can’t access any page without knowing the credentials.

Yes thank you, you’re right. Problem solved with htaccess. Thank you guys!