{"id":4072,"date":"2014-07-24T07:55:20","date_gmt":"2014-07-24T12:55:20","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=4072"},"modified":"2022-06-03T03:46:49","modified_gmt":"2022-06-03T08:46:49","slug":"how-to-install-lamp-linux-apache-mariadb-php-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/","title":{"rendered":"How to install LAMP on CentOS 7"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-24748\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg\" alt=\"How to install LAMP on CentOS 7\" width=\"1200\" height=\"600\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg 1200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-768x384.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-1024x512.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-860x430.jpg 860w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-680x340.jpg 680w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-500x250.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-400x200.jpg 400w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-200x100.jpg 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7-50x25.jpg 50w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>We&#8217;ll show you how to install LAMP on CentOS 7.\u00a0LAMP is actually an acronym for a web services solution stack consisting of Linux, the Apache HTTP Server, the MySQL or MariaDB database engines, and the PHP, Perl or Python programming language. All components are free and open-source software, and the combination is suitable for building dynamic web pages.<\/p>\n<p><strong>Requirements?<\/strong><\/p>\n<p>We are using our <strong><a title=\"SSD Linux VPS\" href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting.html\" target=\"_blank\" rel=\"noopener noreferrer\">SSD 1 VPS<\/a> hosting plan<\/strong> for this set-up, which should be more than enough to run <strong>LAMP<\/strong> and host multiple dynamic websites using virtual host directives.<\/p>\n<p><!--more--><\/p>\n<h3><b>1. Update the System<\/b><\/h3>\n<p>As always, make sure your <a title=\"CentOS 7 VPS\" href=\"https:\/\/www.rosehosting.com\/centos-hosting.html\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>CentOS 7 VPS<\/strong><\/a> is fully up-to-date and you&#8217;re in a <code>screen<\/code> session using the commands below:<\/p>\n<pre>## screen -U -S lamp-centos7\n## yum update<\/pre>\n<h3><b>2. Install MariaDB<\/b><\/h3>\n<p>MariaDB is the default database server in CentOS 7, so go ahead and install it with <code>yum<\/code> using the following command:<\/p>\n<pre>## yum install mariadb mariadb-server mysql<\/pre>\n<p>Once installed, add <code>bind-address = 127.0.0.1<\/code> to <code>\/etc\/my.cnf.d\/server.cnf<\/code> to <span style=\"text-decoration: underline;\">bind MariaDB to localhost only<\/span>:<\/p>\n<pre>## vim \/etc\/my.cnf.d\/server.cnf\n\n[mysqld]\n#log-bin=mysql-bin\n#binlog_format=mixed\nbind-address = 127.0.0.1<\/pre>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e45902c03bf\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e45902c03bf\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#3-Restart-and-Configure-MariaDB\" >3. Restart and Configure MariaDB<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#4-Run-MySQL-post-installation-script\" >4. Run MySQL\u00a0post-installation script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#5-Install-Apache\" >5. Install Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#6-Restart-and-Configure-Apache\" >6.\u00a0Restart and Configure Apache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#7-Install-PHP\" >7. Install PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#8-Configure-PHP\" >8. Configure PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#9-Set-Up-Apache-VHosts\" >9. Set Up Apache VHosts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#10-Restart-Apache-Server\" >10. Restart Apache Server<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"3-Restart-and-Configure-MariaDB\"><\/span>3. Restart and Configure MariaDB<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Restart the MariaDB database server and enable it to start on system start-up using:<\/p>\n<pre>## systemctl restart mariadb\n## systemctl status mariadb\n## systemctl enable mariadb<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"4-Run-MySQL-post-installation-script\"><\/span>4. Run MySQL\u00a0post-installation script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Finally, you can run the <code>mysql_secure_installation<\/code> post-installation script to finish the MariaDB set-up. For example:<\/p>\n<pre>## mysql_secure_installation\n\nEnter current password for root (enter for none): ENTER\nSet root password? [Y\/n] Y\nRemove anonymous users? [Y\/n] Y\nDisallow root login remotely? [Y\/n] Y\nRemove test database and access to it? [Y\/n] Y\nReload privilege tables now? [Y\/n] Y<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"5-Install-Apache\"><\/span><b>5. Install Apache<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>OK so far so good. Next, proceed with the installation of Apache, OpenSSL and mod_ssl using <code>yum<\/code> as in:<\/p>\n<pre>## yum install httpd openssl mod_ssl<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"6-Restart-and-Configure-Apache\"><\/span>6.\u00a0Restart and Configure Apache<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Restart Apache and add it to automatically start on your system start-up using:<\/p>\n<pre>## systemctl restart httpd\n## systemctl status httpd\n## systemctl enable httpd<\/pre>\n<p>Test the set-up by opening, for example http:\/\/YOUR_SERVER_IP\/ in your favorite browser. You should see the default Apache page, for example:<\/p>\n<p><img decoding=\"async\" class=\" wp-image-24747 alignnone\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7.jpg\" alt=\"install lamp on centos 7\" width=\"603\" height=\"387\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7.jpg 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-150x96.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-300x192.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-768x493.jpg 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-860x552.jpg 860w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-680x436.jpg 680w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-500x321.jpg 500w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-400x257.jpg 400w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-200x128.jpg 200w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/install-lamp-on-centos-7-50x32.jpg 50w\" sizes=\"(max-width: 603px) 100vw, 603px\" \/><\/p>\n<p>Great. Now let&#8217;s <strong>configure some extra Apache options<\/strong>, for example, hide its version number, its banner etc&#8230; by adding the following to <code>\/etc\/httpd\/conf.d\/options.conf<\/code><\/p>\n<pre>## vim \/etc\/httpd\/conf.d\/options.conf\n\nTraceEnable off\n\n## Disable Signature\nServerSignature Off\n\n## Disable Banner\nServerTokens Prod\n<\/pre>\n<p>Test Apache configuration file and restart the webserver for the changes to take effect:<\/p>\n<pre>## apachectl configtest\n## systemctl restart httpd\n## systemctl status httpd<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"7-Install-PHP\"><\/span><b>7. Install PHP<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In order to be able to run PHP based web applications, we have to <strong>add PHP support to the Apache webserver<\/strong>, so let&#8217;s install some required packages with <code>yum<\/code>:<\/p>\n<pre>## yum install php php-mysql<\/pre>\n<p>also, you may want to install some other PHP extensions required by your applications. Here is the list:<\/p>\n<pre>php-bcmath          : A module for PHP applications for using the bcmath library\nphp-cli             : Command-line interface for PHP\nphp-common          : Common files for PHP\nphp-dba             : A database abstraction layer module for PHP applications\nphp-devel           : Files needed for building PHP extensions\nphp-embedded        : PHP library for embedding in applications\nphp-enchant         : Enchant spelling extension for PHP applications\nphp-fpm             : PHP FastCGI Process Manager\nphp-gd              : A module for PHP applications for using the gd graphics library\nphp-intl            : Internationalization extension for PHP applications\nphp-ldap            : A module for PHP applications that use LDAP\nphp-mbstring        : A module for PHP applications which need multi-byte string handling\nphp-mysql           : A module for PHP applications that use MySQL databases\nphp-mysqlnd         : A module for PHP applications that use MySQL databases\nphp-odbc            : A module for PHP applications that use ODBC databases\nphp-pdo             : A database access abstraction module for PHP applications\nphp-pear.noarch     : PHP Extension and Application Repository framework\nphp-pecl-memcache   : Extension to work with the Memcached caching daemon\nphp-pgsql           : A PostgreSQL database module for PHP\nphp-process         : Modules for PHP script using system process interfaces\nphp-pspell          : A module for PHP applications for using pspell interfaces\nphp-recode          : A module for PHP applications for using the recode library\nphp-snmp            : A module for PHP applications that query SNMP-managed devices\nphp-soap            : A module for PHP applications that use the SOAP protocol\nphp-xml             : A module for PHP applications which use XML\nphp-xmlrpc          : A module for PHP applications which use the XML-RPC protocol<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"8-Configure-PHP\"><\/span>8. Configure PHP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>OK, let&#8217;s continue with PHP configuration. Edit <code>\/etc\/php.ini<\/code> and set the following:<\/p>\n<pre>## vim \/etc\/php.ini\n\ndate.timezone = America\/New_York\nmemory_limit = 64M\nexpose_php = Off<\/pre>\n<p>restart Apache using <code>systemctl<\/code> for the changes to take effect:<\/p>\n<pre>## systemctl restart httpd\n## systemctl status httpd<\/pre>\n<p>Test if PHP module is loaded in Apache using:<\/p>\n<pre>## httpd -M | grep php\n\nalso\n\n## php -v<\/pre>\n<p>You can create a test <code>info.php<\/code> script too using the following command:<\/p>\n<pre>## echo -e \"&lt;?php\\n\\tphpinfo();\" &gt; \/var\/www\/html\/info.php<\/pre>\n<p>and access it with the following command:<\/p>\n<pre>## curl -I $(curl -s icanhazip.com)\/info.php<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"9-Set-Up-Apache-VHosts\"><\/span><b>9. Set Up Apache VHosts<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now, you would have to set-up Apache Virtual Host Directives, to be able to host multiple domains, even SSL powered ones using one IP address. So, create <code>\/etc\/httpd\/conf.d\/vhosts.conf<\/code> and add the following:<\/p>\n<pre>## cat \/etc\/httpd\/conf.d\/vhosts.conf\n\n# Load my vhosts\nIncludeOptional vhosts.d\/*.conf<\/pre>\n<p>This tells Apache, to load the configuration files ending with <code>.conf<\/code> which reside in <code>\/etc\/httpd\/vhosts.d<\/code>. As you can guess, this is the place where we put our Virtual Hosts, so let&#8217;s set-up one for <code>domain1.com<\/code> and another for <code>domain2.net<\/code><\/p>\n<h4><b>VHOST for domain1.com<\/b><\/h4>\n<pre>## cat \/etc\/httpd\/vhosts.d\/domain1.com.conf\n\n&lt;VirtualHost YOUR_SERVER_IP:80&gt;\n    ServerAdmin webmaster@domain1.com\n    DocumentRoot \"\/var\/www\/html\/domain1.com\"\n    ServerName domain1.com\n    ServerAlias www.domain1.com\n    ErrorLog \"\/var\/log\/httpd\/domain1.com-error_log\"\n    CustomLog \"\/var\/log\/httpd\/domain1.com-access_log\" combined\n\n    &lt;Directory \"\/var\/www\/html\/domain1.com\/\"&gt;\n        DirectoryIndex index.html index.php\n        Options FollowSymLinks\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;<\/pre>\n<h4><b>VHOST for domain2.net<\/b><\/h4>\n<pre>## cat \/etc\/httpd\/vhosts.d\/domain2.net.conf\n\n&lt;VirtualHost YOUR_SERVER_IP:80&gt;\n    ServerAdmin webmaster@domain2.net\n    DocumentRoot \"\/var\/www\/html\/domain2.net\"\n    ServerName domain2.net\n    ServerAlias www.domain2.net\n    ErrorLog \"\/var\/log\/httpd\/domain2.net-error_log\"\n    CustomLog \"\/var\/log\/httpd\/domain2.net-access_log\" combined\n\n    &lt;Directory \"\/var\/www\/html\/domain2.net\/\"&gt;\n        DirectoryIndex index.html index.php\n        Options FollowSymLinks\n        AllowOverride All\n        Require all granted\n    &lt;\/Directory&gt;\n&lt;\/VirtualHost&gt;<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"10-Restart-Apache-Server\"><\/span>10. Restart Apache Server<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Finally, restart Apache for the changes to take effect:<\/p>\n<pre>## apachectl configtest\n## systemctl restart httpd\n## systemctl status httpd<\/pre>\n<hr \/>\n<p>Of course you don\u2019t have to install LAMP on CentOS 7,\u00a0 if you use one of our <a href=\"https:\/\/www.rosehosting.com\/centos-hosting.html\">CentOS 7 Hosting\u00a0Plans<\/a>, in which case you can simply ask our expert Linux administrators to install LAMP on CentOS 7 for you. They are available 24&#215;7 and will take care of your request immediately.<\/p>\n<p><strong><span style=\"color: #ff0000;\">PS<\/span>.<\/strong> If you liked this post, on how to install LAMP on CentOS 7,\u00a0 please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ll show you how to install LAMP on CentOS 7.\u00a0LAMP is actually an acronym for a web services solution stack &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to install LAMP on CentOS 7\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#more-4072\" aria-label=\"Read more about How to install LAMP on CentOS 7\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":24748,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1699,1702,13,1712,1707],"tags":[37,34,91,296,50],"class_list":["post-4072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-databases","category-tutorials","category-web-frameworks","category-web-servers","tag-apache","tag-centos","tag-lamp","tag-mariadb","tag-php","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to install LAMP on CentOS 7 | RoseHosting<\/title>\n<meta name=\"description\" content=\"How to install LAMP on CentOS 7 | RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install LAMP on CentOS 7\" \/>\n<meta property=\"og:description\" content=\"How to install LAMP on CentOS 7 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-24T12:55:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:46:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\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:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to install LAMP on CentOS 7\",\"datePublished\":\"2014-07-24T12:55:20+00:00\",\"dateModified\":\"2022-06-03T08:46:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/\"},\"wordCount\":560,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/How-to-Install-LAMP-on-CentOS-7.jpg\",\"keywords\":[\"apache\",\"centos\",\"lamp\",\"mariadb\",\"php\"],\"articleSection\":[\"CentOS\",\"Databases\",\"Tutorials\",\"Web Frameworks\",\"Web Servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/\",\"name\":\"How to install LAMP on CentOS 7 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/How-to-Install-LAMP-on-CentOS-7.jpg\",\"datePublished\":\"2014-07-24T12:55:20+00:00\",\"dateModified\":\"2022-06-03T08:46:49+00:00\",\"description\":\"How to install LAMP on CentOS 7 | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/How-to-Install-LAMP-on-CentOS-7.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/07\\\/How-to-Install-LAMP-on-CentOS-7.jpg\",\"width\":1200,\"height\":600,\"caption\":\"How to install LAMP on CentOS 7\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install LAMP on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to install LAMP on CentOS 7 | RoseHosting","description":"How to install LAMP on CentOS 7 | RoseHosting","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:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to install LAMP on CentOS 7","og_description":"How to install LAMP on CentOS 7 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2014-07-24T12:55:20+00:00","article_modified_time":"2022-06-03T08:46:49+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to install LAMP on CentOS 7","datePublished":"2014-07-24T12:55:20+00:00","dateModified":"2022-06-03T08:46:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/"},"wordCount":560,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg","keywords":["apache","centos","lamp","mariadb","php"],"articleSection":["CentOS","Databases","Tutorials","Web Frameworks","Web Servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/","name":"How to install LAMP on CentOS 7 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg","datePublished":"2014-07-24T12:55:20+00:00","dateModified":"2022-06-03T08:46:49+00:00","description":"How to install LAMP on CentOS 7 | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2014\/07\/How-to-Install-LAMP-on-CentOS-7.jpg","width":1200,"height":600,"caption":"How to install LAMP on CentOS 7"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-lamp-linux-apache-mariadb-php-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to install LAMP on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/4072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=4072"}],"version-history":[{"count":1,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/4072\/revisions"}],"predecessor-version":[{"id":40675,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/4072\/revisions\/40675"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/24748"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=4072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=4072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=4072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}