Score:0

Allowing and restricting access to specific URL in Apache 2.4

ml flag

I am new to apache. And I want to restrict access to this URL(https://testserver.com/admin.php) for public IP addresses. And I want to allow access to the same URL for specific IP addresses. I am using debian 11 and apache version is 2.4

How can I do that? Thanks.

diya avatar
la flag
Welcome. [Server Fault is a site for information technology professionals](http://serverfault.com/help/on-topic) -- as such we have certain professional expectations when people ask a question here, and one of those expectations is that your question shows you did some **research**, found and **read [the vendor documentation](https://httpd.apache.org/docs/current/howto/access.html)** and/or **tried a solution** before asking the internet for help. You're not expected to solve everything yourself, but then at least you can [write a great question](http://meta.serverfault.com/a/3609/37681).
Score:1
ml flag

I did it by myself by putting the following in the vhost file.

<Directory /var/www/html/admin.php> Require ip XX.XX.XX.XX

ezra-s avatar
ru flag
Well done, for being new you found the best way to solve it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.