{"id":5737,"date":"2017-04-03T13:49:43","date_gmt":"2017-04-03T13:49:43","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=5737"},"modified":"2021-02-01T07:17:20","modified_gmt":"2021-02-01T07:17:20","slug":"tips-securing-lamp-stack-apache-mysql-php-linux","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/","title":{"rendered":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux"},"content":{"rendered":"<p><span style=\"color: #000000;\">If you are a system administrator and you have recently set up a LAMP stack on Linux server but you are not sure about its security, Than you are at a rite place. <!--more-->In this post i am trying to explain all those security tips which need to be considered while setting up new LAMP system for production.<\/span><\/p>\n<p><span style=\"color: #000000;\">If you are a new and do not know how to install LAMP on Linux systems, please follow the links given below as per your requirements.<\/span><\/p>\n<p><span style=\"color: #00ccff;\"><a style=\"color: #00ccff;\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\">How to Install LAMP Stack on CentOS 6<\/a><\/span><br \/>\n<span style=\"color: #00ccff;\"><a style=\"color: #00ccff;\" href=\"https:\/\/cpanelplesk.com\/wp62\/setup-working-apache-server-ubuntu-16-04\/\">How To Install a LAMP stack On Ubuntu 16.04<\/a><\/span><\/p>\n<p><span style=\"color: #000000;\">All the configuration changes applied in this article will be updated in following mention configuration files as per your operating systems. In some cases configuration files path can be change. So make changes in appropriate files. After making changes restart related services to take changes effect.<\/span><\/p>\n<h3><span style=\"color: #000000;\">For CentOS, RedHat &amp; Fedora:<\/span><\/h3>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>Apache: \/etc\/httpd\/conf\/httpd.conf\r\nPHP: \/etc\/php.ini\r\nMySQL: \/etc\/my.cnf<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">For Ubuntu, Debian &amp; LinuxMint:<\/span><\/h3>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>Apache2: \/etc\/apache2\/apache2.conf\r\nPHP5: \/etc\/php5\/apache2\/php.ini\r\nMySQL: \/etc\/mysql\/my.cnf<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">1. Hide Apache Version and OS<\/span><\/h3>\n<p><span style=\"color: #000000;\">The ServerTokens directive controls whether Server response header field which is sent back to clients. The ServerSignature configures the footer on server-generated documents. Edit Apache configuration file and update following directives as following<\/span><\/p>\n<p><span style=\"color: #000000;\">By default, the server HTTP response header contains apache and php version. This is harmful, as we don\u2019t want an hacker to know about the specific version number. To avoid this, Edit Apache configuration file and update following directives.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>httpd.conf\r\nServerTokens Prod\r\nServerSignature Off<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">This will display \u201cServer: Apache\u201d without any version information.<\/span><\/p>\n<h3><span style=\"color: #000000;\">2. Disable Directory Listing in Apache<\/span><\/h3>\n<p><span style=\"color: #000000;\">If you do not disabled directory listing in Apache. Then all the files and directories list will be shown on web page if no default document exists. Add following configuration in Apache to disable directory listing server wide.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;Directory \/&gt;\r\nOptions -Indexes\r\n&lt;\/Directory&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">After that you can enable listing on per directory basis if required.<\/span><\/p>\n<h3><span style=\"color: #000000;\">3. Restricting File and Directory Access (Apache)<\/span><\/h3>\n<p><span style=\"color: #000000;\">We also need to Restrict access on basis of Directory, File and Location in Apache for security purposes.<\/span><\/p>\n<p><strong><span style=\"color: #000000;\">Restrict Directory<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">To restrict directory and files access from users, It will only allowed the ips are defined as:<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;Directory \"\/home\/user\/public_html\"&gt;\r\nOrder Deny,Allow\r\nDeny from all\r\nAllow from 192.168.1.0\/24\r\nAllow from .example.com\r\n&lt;\/Directory&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\"><strong>Restrict File<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">We can also restrict specific file using File directive like below.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;File data.xml&gt;\r\nOrder deny,allow\r\nDeny from all\r\n&lt;\/File&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\"><strong>Restrict Location<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">The Location directive limits the scope of the enclosed directives by URL.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;Location \/admin&gt;\r\nOrder Deny,Allow\r\nDeny from all\r\nAllow from 192.168.1.0\/24\r\nAllow from .example.com\r\n&lt;\/Location&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">4. Disable Server Side Includes and CGI Execution in Apache<\/span><\/h3>\n<p><span style=\"color: #000000;\">We can simply disable server-side includes and CGI execution by defining directory tag. Add below in Apache virtual host configuration file.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;Directory \"\/home\/user\/public_html\"&gt;\r\nOptions -Includes -ExecCGI\r\n&lt;\/Directory&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">5. Set appropriate permissions for conf and bin directory<\/span><\/h3>\n<p><span style=\"color: #000000;\">bin and conf directory should be viewed only by authorized users. It is good practice to create a group, and add all users who are allowed to view\/modify the apache configuration files within this group.<\/span><\/p>\n<p><span style=\"color: #000000;\">Let say group name is: apacheadmin<\/span><\/p>\n<p><span style=\"color: #000000;\">Create the group.<\/span><\/p>\n<p><span style=\"color: #000000;\">groupadd apacheadmin<\/span><\/p>\n<p><span style=\"color: #000000;\">Allow access to bin directory for this group.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>chown -R root:apacheadmin \/usr\/local\/apache\/bin\r\nchmod -R 770 \/usr\/local\/apache\/bin<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Allow access to conf directory for this group.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>chown -R root:apacheadmin \/usr\/local\/apache\/conf\r\nchmod -R 770 \/usr\/local\/apache\/conf<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">Add valid members to this group.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre># nano \/etc\/group\r\napacheadmin:x:1121:sara,norman<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">6. Restrict access to root directory<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">Secure the root directory by setting the following in the httpd.conf<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>&lt;Directory \/&gt;\r\nOptions None\r\nOrder deny,allow\r\nDeny from all\r\n&lt;\/Directory&gt;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\"><strong>7. Restrict PHP Information Leakage<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">By Default PHP installation exposes to the world that PHP is installed on the server, which includes the PHP version within the HTTP header<\/span><\/p>\n<p><span style=\"color: #000000;\">To hide this values from header edit php.ini and update below directive to Off<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>expose_php = Off<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">8. Disable Remote Code Execution in PHP<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">If allow_url_fopen is enabled on your server setup, It allows ile functions like file_get_contents() and the include and require statements which can fetch the data from http or ftp remote locations and execute their code.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>allow_url_fopen=Off\r\nallow_url_include=Off<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">9. Disabling Dangerous PHP Functions<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">We can disable any php functions using disable_functions directive in php configuration file. Disable all the functions which can be harmful and not used in applications.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>disable_functions =exec,shell_exec,passthru,system,popen,curl_exec,\r\ncurl_multi_exec,parse_ini_file,show_source,proc_open,pcntl_exec<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">10. Limit PHP Access To File System<\/span><\/h3>\n<p><span style=\"color: #000000;\">We can use the open_basedir directive which allowed the PHP to access files<\/span><br \/>\n<span style=\"color: #000000;\"> open_basedir=&#8221;\/home\/user\/public_html&#8221;<\/span><\/p>\n<p><strong><span style=\"color: #000000;\">11. Disable Unused PHP Modules<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">We can disable any unused module to load in system by changing configuration file name.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre># cd \/etc\/php.d\/\r\n# mv oci8.ini oci8.ini.disable<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">12. Enable Limits in PHP (PHP)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">To allow users to upload files of maximum size, update following configuration value.<\/span><\/p>\n<p><span style=\"color: #000000;\">upload_max_filesize = 2M # Maximum 2M of file user can upload<\/span><\/p>\n<p><span style=\"color: #000000;\">Maximum execution time of each script<\/span><br \/>\n<span style=\"color: #000000;\"> max_execution_time = 30 # seconds<\/span><\/p>\n<p><span style=\"color: #000000;\">Maximum amount of time each script may spend parsing request data<\/span><\/p>\n<p><span style=\"color: #000000;\">max_input_time = 60 # seconds<\/span><\/p>\n<p><strong><span style=\"color: #000000;\">13. Restrict MySQL Remote Access<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">To disable all remote connections for database server. The easiest way to do it to force MySQL server to listen only on 127.0.0.1 (localhost).<\/span><\/p>\n<p><span style=\"color: #000000;\">Edit MySQL configuration file and update following value.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>bind-address=127.0.0.1<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">14. Disable use of LOCAL INFILE in MySQL<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">Enabling LOCAL INFILE can be dangerous for you system security. If LOCAL INFILE is enabled on server, a user can load any file ( like \/etc\/passwd, \/etc\/shadow ) easily.<\/span><\/p>\n<p><span style=\"color: #000000;\">To disable this edit MySQL configuration file and add following value under [mysqld] section.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>[mysqld]\r\nlocal-infile=0<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\"><strong>15. Create Application Specific User in MySQL<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">Do not use mysql \u2018root\u2019 user for accessing database through application. It can be dangerous for your system. So make sure to create and use application specific user with limited access on application database only. Do following:<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>root@tecadmin:~# mysql -u root -p\r\n\r\nmysql&gt; CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';\r\nmysql&gt; GRANT SELECT,INSERT,UPDATE,DELETE ON mydb.* TO 'user'@'\r\nlocalhost' IDENTIFIED BY 'password';\r\nmysql&gt; FLUSH PRIVILEGES;<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><strong><span style=\"color: #000000;\">16. Improve Security with mysql_secure_installation<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">After installing MySQL mysql_secure_installation command is very useful for securing MySQL server. This will also setup password protection on root user.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre>mysql_secure_installation\r\n\"Only required output is showing below. In actual you will see more \r\noutput on-screen\"\r\n\r\nChange the root password? [Y\/n] y\r\nNew password: **********\r\nRe-enter new password: **********\r\n\r\nRemove anonymous users? [Y\/n] y\r\nDisallow root login remotely? [Y\/n] y\r\nRemove test database and access to it? [Y\/n] y\r\nReload privilege tables now? [Y\/n] y\r\n<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<h3><span style=\"color: #000000;\">17. Protect Configuration Files (Apache\/MySQL\/PHP)<\/span><\/h3>\n<p><span style=\"color: #000000;\">In this section we will protect all our server configuration files used in LAMP Stack:<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre># chattr +i \/etc\/php.ini\r\n# chattr +i \/etc\/php.d\/*\r\n# chattr +i \/etc\/my.cnf\r\n# chattr +i \/etc\/httpd\/conf\/httpd.conf<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">please note that after enabling write protection no user including root would be able to update these file. In case if you need to update any of files, disable write protection first using below command.<\/span><\/p>\n<div class=\"space1\"><\/div>\n<div class=\"command-sh\">\n<pre># chattr -i filename<\/pre>\n<\/div>\n<div class=\"space1\"><\/div>\n<p><span style=\"color: #000000;\">That&#8217;s all,\u00a0We hope this article helped you to secure LAMP Stack\u00a0. Please check and give your opinion below if you experience any issues or to discuss your ideas and experiences.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are a system administrator and you have recently set up a LAMP stack on Linux server but you are not sure about its security, Than you are at a rite place. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":5739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,14],"tags":[],"class_list":["post-5737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"If you are a system administrator and you have recently set up a LAMP stack on Linux server but you are not sure about its security, Than you are at a rite place. [...]Continue Reading...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux\",\"datePublished\":\"2017-04-03T13:49:43+00:00\",\"dateModified\":\"2021-02-01T07:17:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\"},\"wordCount\":965,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg\",\"articleSection\":[\"Cpanel\",\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\",\"name\":\"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg\",\"datePublished\":\"2017-04-03T13:49:43+00:00\",\"dateModified\":\"2021-02-01T07:17:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg\",\"width\":204,\"height\":204},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/","twitter_card":"summary_large_image","twitter_title":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk","twitter_description":"If you are a system administrator and you have recently set up a LAMP stack on Linux server but you are not sure about its security, Than you are at a rite place. [...]Continue Reading...","twitter_image":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux","datePublished":"2017-04-03T13:49:43+00:00","dateModified":"2021-02-01T07:17:20+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/"},"wordCount":965,"commentCount":1,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg","articleSection":["Cpanel","Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/","url":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/","name":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg","datePublished":"2017-04-03T13:49:43+00:00","dateModified":"2021-02-01T07:17:20+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#primaryimage","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2017\/04\/security.jpg","width":204,"height":204},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/tips-securing-lamp-stack-apache-mysql-php-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"Tips for securing LAMP Stack (Apache, MySQL and PHP) on Linux"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/5737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=5737"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/5737\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media\/5739"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=5737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=5737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=5737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}