{"id":1606,"date":"2021-09-02T10:24:30","date_gmt":"2021-09-02T10:24:30","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1606"},"modified":"2021-09-02T10:24:40","modified_gmt":"2021-09-02T10:24:40","slug":"1606","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/1606\/","title":{"rendered":"Steps to Install Linux, Apache, MySQL, PHP (LAMP) On CentOS 7"},"content":{"rendered":"<p>The most vital and needed open supply software package to make a dynamic web development application known as LAMP Stack that is simply an word form for the software package which has \u2013 Linux operating system, Apache, MySQL and PHP and nowadays we&#8217;ll see how to install LAMP on CentOS that your web application needs.<\/p>\n<h2><strong>How to Install Apache,<\/strong><\/h2>\n<p>1) Before you begin any installation, make sure your software is up to date.<\/p>\n<pre> yum update<\/pre>\n<p>2) Install Apache using below command.<\/p>\n<pre> yum install httpd<\/pre>\n<p>3) using below command start Apache .<\/p>\n<pre> systemctl start httpd.service<\/pre>\n<p>4) using following command, Set Apache to start on server boot .<\/p>\n<pre> systemctl enable httpd.service<\/pre>\n<p>5) Now verify that Apache is installed by visiting to,<br \/>\nhttp:\/\/your server\u2019s IP address.<\/p>\n<p>If Apache gets installed, the Apache Test Page will displays.<\/p>\n<h2><strong>How to Install MySQL<\/strong><\/h2>\n<p>1) First you need to Install MariaDB, the community-developed fork of MySQL.<\/p>\n<pre> yum install mariadb-server mariadb<\/pre>\n<p>2) Now start the service.<\/p>\n<pre> systemctl start mariadb<\/pre>\n<p>3) Set MySQL to start on server boot.<\/p>\n<pre> systemctl enable mariadb.service<\/pre>\n<p>4) Execute the below command to finish setting up the installation,<\/p>\n<pre> mysql_secure_installation<\/pre>\n<p>5) Type \u201cY\u201d to set the root password. Because now you have been asked to set the root password.<br \/>\n6) Enter and confirm the new password.<br \/>\n7) Press \u201cY\u201d to respond system prompts and security configuration.<\/p>\n<h2><strong>How to Install PHP<\/strong><\/h2>\n<p>1) Run below command to Install PHP:<\/p>\n<pre> yum install php php-mysql<\/pre>\n<p>Enter \u201cY\u201d to install.<\/p>\n<p>2) Now restart Apache:<\/p>\n<pre> systemctl restart httpd.service<\/pre>\n<h4><strong>Your web application may need PHP modules, you can install them now,<\/strong><\/h4>\n<p>1) First view all available PHP modules using below command,<\/p>\n<pre> yum search php-<\/pre>\n<p>2) The list displays the available PHP modules. To view the description of a specific package, use the following command.<\/p>\n<pre> yum info \"the name of the package you want to use\"<\/pre>\n<p>3) Install the required package.<\/p>\n<pre> yum install \"the name of the package you want to use\"<\/pre>\n<h4>To test PHP processing on Apache,<\/h4>\n<p>1) Create a new PHP file under the \/var\/www\/html directory.<\/p>\n<pre> vim \/var\/www\/html\/info.php<\/pre>\n<p>2) Please type in the following code in the newly created PHP file.<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;?php<\/p>\n<p>phpinfo();<\/p>\n<p>?&gt;<\/p>\n<p>3) Save and close the file using below command.<\/p>\n<pre> :wq!<\/pre>\n<p>4) Type this URL in your browser, to check if it is working or not \u2013\u00a0http:\/\/your server\u2019s IP address\/info.php<\/p>\n<p>The screen will display a page with the Version of the PHP, extensions, build date, and other information. Now you know how to build a LAMP stack on CentOS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The most vital and needed open supply software package to make a dynamic web development application known as LAMP Stack that is simply an word form for the software package which has \u2013 Linux operating system, Apache, MySQL and PHP and nowadays we&#8217;ll see how to install LAMP on CentOS that your web application needs. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1606","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Steps to Install Linux, Apache, MySQL, PHP (LAMP) On CentOS 7 - OWS KB<\/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:\/\/ownwebservers.com\/kb\/1606\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Steps to Install Linux, Apache, MySQL, PHP (LAMP) On CentOS 7 - OWS KB\" \/>\n<meta property=\"og:description\" content=\"The most vital and needed open supply software package to make a dynamic web development application known as LAMP Stack that is simply an word form for the software package which has \u2013 Linux operating system, Apache, MySQL and PHP and nowadays we&#8217;ll see how to install LAMP on CentOS that your web application needs. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/1606\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-02T10:24:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-02T10:24:40+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1606\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/1606\/\",\"name\":\"Steps to Install Linux, Apache, MySQL, PHP (LAMP) On CentOS 7 - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-09-02T10:24:30+00:00\",\"dateModified\":\"2021-09-02T10:24:40+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/1606\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/1606\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1606\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/1606\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/1606\/\",\"name\":\"Steps to Install Linux, Apache, MySQL, PHP (LAMP) On CentOS 7\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1606"}],"version-history":[{"count":3,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":1635,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1606\/revisions\/1635"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}