{"id":2625,"date":"2015-08-12T11:49:39","date_gmt":"2015-08-12T11:49:39","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=2625"},"modified":"2021-02-09T05:02:14","modified_gmt":"2021-02-09T05:02:14","slug":"how-to-install-linux-apache-mysql-php-on-centos-6-x","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/","title":{"rendered":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x"},"content":{"rendered":"<p>In this\u00a0tutorial we will guide you the steps to install LAMP stack, a collection of open source software used to get web servers up and running so you can host all your site\u2019s files and databases in it.<!--more--><\/p>\n<p>The steps in this tutorial require the user on the virtual private server to have root privileges.You can see how to set that up in the <a href=\"https:\/\/cpanelplesk.com\/wp62\/howto-create-sudo-user-in-cpanel\/\">how to create user in cPanel<\/a>.<\/p>\n<h2>1.\u00a0Install Apache<\/h2>\n<p>To install Apache, open terminal and run this command:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">yum install httpd<\/pre>\n<\/div>\n<p>Once installed, you can start Apache running on your VPS:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">service httpd start<\/pre>\n<\/div>\n<h2>2.\u00a0Install MySQL<\/h2>\n<p>To install MySQL on your VPS, open terminal and type in these commands<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">yum install mysql-server\r\nservice mysql start\r\n\/etc\/init.d\/mysqld restart<\/pre>\n<\/div>\n<p>During the installation, MySQL will ask for your permission twice. After you say Yes to both, MySQL will install.<\/p>\n<p>Once its installed, you can set a root MySQL password:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">\/usr\/bin\/mysql_secure_installation<\/pre>\n<\/div>\n<p>The prompt will ask you for your current root password,\u00a0you most likely won\u2019t have one, so leave it blank by pressing enter.<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">Enter current password for root (enter for none): \r\nOK, successfully used password, moving on...<\/pre>\n<\/div>\n<p>Next, you\u2019ll be asked: <strong>Set root password? [Y\/n]<\/strong>. Type Y and hit Enter then type in your new password twice.<\/p>\n<p>You\u2019ll also be asked for several questions. Simply answer with Y to move on.<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">Remove anonymous users? [Y\/n] y                                            \r\n ... Success!\r\n \r\nDisallow root login remotely? [Y\/n] y\r\n... Success!\r\n \r\nRemove test database and access to it? [Y\/n] y\r\n - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n \r\nReload privilege tables now? [Y\/n] y\r\n ... Success!<\/pre>\n<\/div>\n<p>At the end, you will see the message: Thanks for using MySQL!<\/p>\n<h2>3.\u00a0Install PHP<\/h2>\n<p>To install PHP on your VPS, open terminal and type in this command:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">yum install php php-mysql<\/pre>\n<\/div>\n<p>Once you confirm &#8216;yes&#8217; to the PHP prompt, PHP will be installed.<\/p>\n<h2>4. PHP Modules<\/h2>\n<p>Firstly you have to check all available libraries and modules by issuing this command:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">yum search php-<\/pre>\n<\/div>\n<p>It will then show you all libraries with \u201cphp-\u201d prefix. you can also retrieve more detailed information about what each module does. Use this command:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">yum info php-module-name<\/pre>\n<\/div>\n<p>Instead of installing each module one by one, you can simply install multiple libraries at once by separating the name of each module with a space. Here\u2019s the example:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">yum install php-common php-cli php-devel php-fpm php-gd php-imap php-intl\r\nphp-mysql php-process php-xml php-xmlrpc php-zts\r\n<\/pre>\n<\/div>\n<p>We should also have to set the process to run automatically when the server boots (php will run automatically once Apache starts):<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">chkconfig httpd on\r\nchkconfig mysqld on<\/pre>\n<\/div>\n<p>Restart Apache so that all of the changes take effect on your Server:<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">service httpd restart<\/pre>\n<\/div>\n<p>Congratulations! You now have LAMP stack on your server!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this\u00a0tutorial we will guide you the steps to install LAMP stack, a collection of open source software used to get web servers up and running so you can host all your site\u2019s files and databases in it. [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":2637,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,14],"tags":[],"class_list":["post-2625","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>How to install Linux, Apache, MySQL, PHP on CentOS 6.x - 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\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to install Linux, Apache, MySQL, PHP on CentOS 6.x - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"In this\u00a0tutorial we will guide you the steps to install LAMP stack, a collection of open source software used to get web servers up and running so you can host all your site\u2019s files and databases in it. [...]Continue Reading...\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"How to install Linux, Apache, MySQL, PHP on CentOS 6.x\",\"datePublished\":\"2015-08-12T11:49:39+00:00\",\"dateModified\":\"2021-02-09T05:02:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\"},\"wordCount\":363,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg\",\"articleSection\":[\"Cpanel\",\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\",\"name\":\"How to install Linux, Apache, MySQL, PHP on CentOS 6.x - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg\",\"datePublished\":\"2015-08-12T11:49:39+00:00\",\"dateModified\":\"2021-02-09T05:02:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg\",\"width\":260,\"height\":201},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Linux, Apache, MySQL, PHP on CentOS 6.x\"}]},{\"@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":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x - 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\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/","twitter_card":"summary_large_image","twitter_title":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x - cPanel Plesk","twitter_description":"In this\u00a0tutorial we will guide you the steps to install LAMP stack, a collection of open source software used to get web servers up and running so you can host all your site\u2019s files and databases in it. [...]Continue Reading...","twitter_image":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x","datePublished":"2015-08-12T11:49:39+00:00","dateModified":"2021-02-09T05:02:14+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/"},"wordCount":363,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg","articleSection":["Cpanel","Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/","url":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/","name":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage"},"image":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage"},"thumbnailUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg","datePublished":"2015-08-12T11:49:39+00:00","dateModified":"2021-02-09T05:02:14+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#primaryimage","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2015\/08\/lamp.jpg","width":260,"height":201},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/how-to-install-linux-apache-mysql-php-on-centos-6-x\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"How to install Linux, Apache, MySQL, PHP on CentOS 6.x"}]},{"@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\/2625","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=2625"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/2625\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media\/2637"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=2625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=2625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=2625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}