Language Selection

English French German Italian Portuguese Spanish

Quick Guide to Securing a Lamp Server

Filed under

In the last few years on the Internet the price of dedicated servers have went down and more people are beginning to use them for their sites, game servers, or small hosting companies. With this comes as I was talking about in my last article inexperienced admins. Lots of people I spoke too are too intimated by the linux shell and try to administer their server completely from the control panel.
This short guide will show you a few copy and paste walkthroughs you can use to help secure your server, these should work with any control panel, the mod security update script however is only for apache2. Using these tools and using basic security procedures will help you keep your server secure and free of hackers, spammers, and other annoyances.

Using linux as a personal desktop helps a lot as well as it gets you used to using the command line. The other extremely valuable tool is google. I would probably be nowhere without google. You can look stuff up as you go and find about any answer to any question you may have, Plus there is lots of walkthroughs just like this one I am just putting all the basic ones together.

OK this is not a complete guide but those who are less experienced should be able to follow these walkthroughs and make their server more secure then it was before.
First thing, install apf, bfd, and dos deflate. Complete walkthrough HERE
Note: Dos deflate will not work with debian unless you disable ipv6.

Next install modsecurity using the simple guide from, guide can be found HERE

After you install mod security make a directory in /etc called modsecurity. Use my update script found HERE (apache2 only)
This will get all the latest rules from when you have them at the bottom of the mod security configuration in httpd.conf put
Include /etc/modsecurity/apache2/rulename.conf
I suggest using them all besides rules.conf as it gives lots of false positives.

Now if you have shell users or are running redhat, fedora, or debian you most likely need to update your kernel. Now this isn't as hard as you would think, with this copy and paste guide I made that is all you have to do is copy and paste, same as these other tutorials.
The guide can be found HERE. I will be making one for debian soon but you just use any basic debian kernel how to and patch the kernel the same way as you do in this one.

Once you have modsecurity installed keep an eye on the audit log to make sure it is not giving any false positives or blocking legitimate web apps. With the ruleset and rules you have included it should not unless someone is using some oddball web app.
None of these will make your server totally secure, it takes basic security practices such as using strong passwords, not using the same password for everything, and keeping up with all the latest exploitrs and hacking methods.

If you ever get hacked don't go ranting about how you are gonna prosecute so and so, go find out how they done it, how they got in, and what you can do to prevent it again. You will most likely never track down the hackers and the FBI most likely will not care so secure your system and make sure it does not happen again. As I have explained before defacers can actually be helpful to admins. That's about it, good luck and stay on your toes.

More in Tux Machines

Radeon DRM Linux 4.4 + Mesa 11.1 + DRI3 vs. AMD's Proprietary Driver

On Friday I posted benchmarks showing Nouveau's re-clocked performance relative to NVIDIA's proprietary driver for showing the performance potential of NVIDIA's GeForce GTX 600/700 series with the performance state code there beginning to work. That article was followed by AMDGPU driver tests on Linux 4.4 against Catalyst for the newest AMD GPU tech that uses this newer Direct Rendering Manager driver. The third test now is comparing the Radeon DRM performance on Linux 4.4 against AMD's binary blob when using older AMD GCN GPUs as well as a Northern Islands GPU for reference. Read more

Would stock Android make you more likely to buy a Chinese smartphone?

Huawei, like any manufacturer that puts time and effort into a software layer of unique features and enhancements, believes wholeheartedly in the value its interface adds to the core Android experience. As Android nerds, we naturally tend to gravitate toward a stock experience that we can customize ourselves, but we are also aware that we are hardly representative of 'average' smartphone consumers. Read more

KTU exams to run on open source software

All examinations of the A.P.J. Abdul Kalam Technological University (KTU) — which run on an online platform — would switch to open source software from the second semester onwards. For the first semester examinations, the KTU would use a proprietary, Microsoft, software. In response to demands from student organisations, the KTU has pushed back its first semester examinations by two days. The first of the examinations would now begin on December 4 instead of December 2. The first of the results would be published on December 19. Read more Also: KTU goes ahead with exam outsourcing

CMS News