{"id":742,"date":"2012-08-20T01:09:32","date_gmt":"2012-08-20T07:09:32","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=742"},"modified":"2018-10-04T04:32:52","modified_gmt":"2018-10-04T10:32:52","slug":"mod_security-installation-on-a-plesk-server","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/mod_security-installation-on-a-plesk-server\/","title":{"rendered":"mod_security installation on a plesk server"},"content":{"rendered":"<p>Check for the current version of apache installed on the server and make sure that the apache development tools have been installed on the server (i.e. httpd-devel package) using the command<br \/>\nrpm -qa | grep httpd-devel<\/p>\n<p>In case the apache development tools are not installed on the server, install the package via yum<\/p>\n<blockquote><p>yum install httpd-devel<\/p><\/blockquote>\n<p>The devel package is necessary for addition of extra modules to apache ( since apxs [apache extension tool] comes with httpd-devel. Before installation of mod_security, ensure that the c (apache module) is installed on the server as well. The command httpd -t -D DUMP_MODULES will provide a list of all loaded apache modules.<\/p>\n<p>Use<\/p>\n<blockquote><p>httpd -t -D DUMP_MODULES | grep httpd -t -D DUMP_MODULES to check for the unique_id_module<\/p><\/blockquote>\n<p>If the unique_id_module is not installed, download the apache source package from http:\/\/httpd.apache.org\/download.cgi (preferably the source file of current version of apache installed on the server) and use the command as below to add unique_id_module to apache<\/p>\n<blockquote><p>apxs -iac httpd-2.2.22\/modules\/metadata\/mod_unique_id.c ( I installed unique_id_module for apache 2.2.22, in general the command can be modified as<br \/>\napxs -iac \/path\/to\/extracted\/apache\/source\/modules\/metadata\/mod_unique_id.c )<\/p><\/blockquote>\n<p>Now download the latest version of mod_security from http:\/\/www.modsecurity.org\/download\/ and extract the contents of the archive.<br \/>\nEnter the directory with the extracted contents and run the command<\/p>\n<blockquote><p>.\/configure &#8211;with-apxs=\/path\/to\/apxs<\/p><\/blockquote>\n<p>Use the command which apxs to check for the path of the apxs binary<\/p>\n<p>Now run make and make install to build and install the module. After installation, add<\/p>\n<blockquote><p>LoadFile \/usr\/lib\/libxml2.so<br \/>\nLoadFile \/usr\/lib\/liblua5.1.so<br \/>\nLoadModule security2_module modules\/mod_security2.so<\/p><\/blockquote>\n<p>to the apache configuration file ( httpd.conf usually present in \/etc\/httpd\/conf\/httpd.conf ) and restart apache.<\/p>\n<p><strong>Note::<\/strong> Install lua package via yum if liblua5.1.so is not present in \/usr\/lib\/ , also apache should be compiled with proxy proxy_http proxy_ftp proxy_connect (for enabling mod_proxy) for mod_security to work properly.<\/p>\n<p>After installation mod_security can be suitably configured.<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check for the current version of apache installed on the server and make sure that the apache development tools have been installed on the server (i.e. httpd-devel package) using the&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-742","post","type-post","status-publish","format-standard","hentry","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=742"}],"version-history":[{"count":6,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/742\/revisions"}],"predecessor-version":[{"id":3241,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/742\/revisions\/3241"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}