# How to setup firewall for my website?

**URL:** <https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989>\
**Category:** Hosting Support\
**Created:** [May 12, 2020, 4:33pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989 "2020-05-12T16:33:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon28725401](https://forum.infinityfree.com/letter_avatar/anon28725401/32/6_449c533f586939b6e5f246632a46421f.png) [@anon28725401](https://forum.infinityfree.com/u/anon28725401)\
**Post date:** [May 12, 2020, 4:33pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989/1 "2020-05-12T16:33:36Z")

</div>

I want to setup firewall for my site. I am very new to this concept. Can anyone help me about how can I get this done in my free hosting account? Thanks

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [May 12, 2020, 7:02pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989/2 "2020-05-12T19:02:59Z")

</div>

We run firewalls on all our servers already. But that probably doesn’t answer your question.

What exactly are you trying to protect and how do you suppose a firewall relates to that?

---

<div class="post-metadata">

**Author:** ![anon28725401](https://forum.infinityfree.com/letter_avatar/anon28725401/32/6_449c533f586939b6e5f246632a46421f.png) [@anon28725401](https://forum.infinityfree.com/u/anon28725401)\
**Post date:** [May 12, 2020, 7:18pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989/3 "2020-05-12T19:18:23Z")

</div>

I am trying to make my website immune to sql injections. I had read some articles where it was stated that firewalls, if set up correctly, can help reduce the sql injection vulnarebility. So, that is what I am trying to do. Is there any other/better way to achieve this?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [May 12, 2020, 7:45pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989/4 "2020-05-12T19:45:25Z")

</div>

Ah, I see what you mean. What you’re referring to is typically called a Web Application Firewall. That’s a kind of firewall to protect, well, web applications. Mod Security is one of the most well known ones. The “web application” part is important, because normal firewalls protect networks, not applications.

A Web Application Firewall is an application which is integrated in the server. Some hosting providers offer it, but we don’t. But it has to be installed on the server level, and cannot be installed on an individual web hosting account.

If you insist on using a Web Application Firewall, you could use Cloudflare, who also offer a system like that.

And, admittedly, if you goal is to **reduce** SQL injection vulnerability, then it’s perfect. If the goal is to **stop** SQL injection vulnerability, then you should know that a WAF is a crutch to mitigate the dangers of bad code. So how to stop SQL injection vulnerability? Don’t run bad code!

For SQL injection, this is really simple: always use parameterized queries. Never put user input into SQL statements directly.

> **[PHP MySQL Prepared Statements](https://www.w3schools.com/php/php_mysql_prepared_statements.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [May 27, 2020, 7:45pm UTC](https://forum.infinityfree.com/t/how-to-setup-firewall-for-my-website/29989/5 "2020-05-27T19:45:31Z")

</div>

Closed on May 27, 2020, 7:45pm UTC

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
