{"id":32,"date":"2015-02-17T22:40:15","date_gmt":"2015-02-17T22:40:15","guid":{"rendered":"https:\/\/www.nonamehosts.com\/blog\/?p=32"},"modified":"2015-02-17T22:40:15","modified_gmt":"2015-02-17T22:40:15","slug":"how-to-setup-lamp-linux-apache-mysql-php-on-centos-6-5","status":"publish","type":"post","link":"https:\/\/www.nonamehosts.com\/blog\/tutorials\/how-to-setup-lamp-linux-apache-mysql-php-on-centos-6-5\/","title":{"rendered":"How to setup LAMP (Linux, Apache, Mysql, PHP) on CentOS 6.5?"},"content":{"rendered":"<p style=\"text-align: justify;\">LAMP is an acronym for Linux, Apache, MySQL, PHP. This instruction will describe how to install the Apache web server with\u00a0PHP and MySQL support\u00a0on CentOS 6.5.<\/p>\n<p style=\"text-align: justify;\">In this manual, we will be using following settings:<\/p>\n<p style=\"text-align: justify;\"><!--more--><\/p>\n<p style=\"text-align: justify;\"><strong>hostname:<\/strong>\u00a0srv1.nonamehosts.com<br \/>\n<strong>IP address:<\/strong> 192.168.1.254<\/p>\n<p>As these settings will\u00a0differ from yours, please replace them where appropriate.<\/p>\n<h4 style=\"text-align: center;\">Installing MySQL<\/h4>\n<p>To install MySQL, open terminal and type in these commands:<\/p>\n<pre class=\"theme:shell-default toolbar:2 nums:false lang:default highlight:0 decode:true\"># yum -y install mysql mysql-server<\/pre>\n<p>Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:<\/p>\n<pre class=\"theme:shell-default toolbar:2 nums:false lang:default highlight:0 decode:true \"># chkconfig --levels 235 mysqld on\n# \/etc\/init.d\/mysqld start<\/pre>\n<p>Once done, you can set a root MySQL password by running this command:<\/p>\n<pre class=\"theme:shell-default toolbar:2 toolbar-overlay:false toolbar-hide:false toolbar-delay:false show-title:false nums:false nums-toggle:false wrap-toggle:false lang:default highlight:0 decode:true system \">[root@srv1 ~]# mysql_secure_installation\n\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE!\nPLEASE READ EACH STEP CAREFULLY! In orderto log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should justpress enter here.\n\nEnter current password for root (enter for none):\nOK, successfully used password, moving on...\nSetting the root password ensures that nobody can log into the MySQL root user without the proper authorisation.\n\nSet root password? [Y\/n] &lt;-- ENTER\nNew password: &lt;-- yourrootsqlpassword\nRe-enter new password: &lt;-- yourrootsqlpassword\nPassword updated successfully!\nReloading privilege tables..\n... Success!\n\nBy default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] &lt;-- ENTER\n&lt;\/span&gt;... Success!\n\nNormally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] &lt;-- ENTER\n&lt;\/span&gt;... Success!\n\nBy default, MySQL comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removed before moving into a production environment.\n\nRemove test database and access to it? [Y\/n] &lt;-- ENTER\n&lt;\/span&gt;- Dropping test database...\n... Success!\n- Removing privileges on test database...\n... Success!\n\nReloading the privilege tables will ensure that all changes made so far will take effect immediately.\n\nReload privilege tables now? [Y\/n] &lt;-- ENTER\n&lt;\/span&gt;... Success!\nCleaning up...\n\nAll done! If you've completed all of the above steps, your MySQL\ninstallation should now be secure.\n\nThanks for using MySQL!<\/pre>\n<h4 style=\"text-align: center;\">Installing Apache<\/h4>\n<p>Apache is a free open source software which runs over 50% of the world\u2019s web servers.<\/p>\n<p>It\u00a0is available as a CentOS package, therefore we can install it like this:<\/p>\n<pre class=\"toolbar:2 toolbar-overlay:false toolbar-hide:false toolbar-delay:false show-title:false nums:false nums-toggle:false wrap-toggle:false lang:default highlight:0 decode:true \"># yum -y install httpd<\/pre>\n<p>Now configure your system to start Apache at boot time&#8230;<\/p>\n<pre class=\"command\"># chkconfig --levels 235 httpd on<\/pre>\n<p>After that, you can start apache running on your VPS:<\/p>\n<pre># service httpd start<\/pre>\n<p>Now direct your browser to <span class=\"system\">http:\/\/192.168.1.254<\/span>, and you should see the Apache2\u00a0test page.<\/p>\n<h4 style=\"text-align: center;\">Installing PHP5<\/h4>\n<p>PHP is an open source web scripting language that is widely used to build dynamic webpages.<\/p>\n<p>We can install PHP5 and the PHP5 MySQL module as follows:<\/p>\n<pre># yum -y install php php-mysql<\/pre>\n<p>Once its completed, we must restart Apache:<\/p>\n<pre class=\"command\"># service httpd restart<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>LAMP is an acronym for Linux, Apache, MySQL, PHP. This instruction will describe how to install the Apache web server with\u00a0PHP and MySQL support\u00a0on CentOS 6.5. In this manual, we will be using following settings:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[8,19,57,58,67,68,81,97,118],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-apache","tag-centos","tag-howto","tag-install","tag-lamp","tag-linux","tag-mysql","tag-php","tag-setup"],"_links":{"self":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}