Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2868,"date":"2019-12-27T06:49:42","date_gmt":"2019-12-27T06:49:42","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2868"},"modified":"2019-12-27T06:49:42","modified_gmt":"2019-12-27T06:49:42","slug":"how-to-install-apache-mysql-and-php-on-centos-6","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/how-to-install-apache-mysql-and-php-on-centos-6\/","title":{"rendered":"How to Install Apache, MySQL, and PHP on CentOS 6"},"content":{"rendered":"

Introduction<\/h3>\n

LAMP is an acronym that stands for Linux, Apache, MySQL, and PHP. This software stack is the most popular open-source solution for the setup of web servers.<\/p>\n

Since we have decided to use the CentOS 6 x64 distribution of Linux on a AKLWEB Host VPS, we will only introduce how to install the other components in this article.<\/p>\n

Prerequisites<\/h3>\n

In this article, we assume that you have set up a CentOS 6 x64 AKLWEB Host VPS from scratch and have logged in as root. Non-root users will need to use the\u00a0sudo<\/code>\u00a0command.<\/p>\n

Step One: Install Apache<\/h3>\n

To install and start Apache, open your SSH terminal and input the following commands:<\/p>\n

yum -y install httpd\r\nservice httpd start\r\n<\/code><\/pre>\n

Check if Apache is installed and running properly with:<\/p>\n

service httpd status\r\n<\/code><\/pre>\n

Note<\/strong>: You cannot check if Apache is running properly by visiting the IP address of your AKLWEB Host VPS from your browser, as the firewall will block your visit by default.<\/p>\n

You need to open port 80 to make your web server accessible:<\/p>\n

\/sbin\/iptables -I INPUT -p tcp --dport 80 -j ACCEPT\r\n\/etc\/rc.d\/init.d\/iptables save\r\n<\/code><\/pre>\n

Step Two: Install MySQL<\/h3>\n

To install and start MySQL, open your SSH terminal and input the following commands:<\/p>\n

yum -y install mysql-server\r\nservice mysqld start\r\n<\/code><\/pre>\n

On production servers, you should secure MySQL with the following command:<\/p>\n

\/usr\/bin\/mysql_secure_installation\r\n<\/code><\/pre>\n

The command prompt will ask for your current MySQL root password. Leave it blank by pressing ENTER.<\/p>\n

Then, answer the command prompt as specified below:<\/p>\n

Set root password? [Y\/n] Y\r\nNew password: YourDesiredPassword\r\nRe-enter new password: YourDesiredPassword\r\nRemove anonymous user? [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<\/code><\/pre>\n

Step Three: Install PHP<\/h3>\n

To install PHP on your AKLWEB Host VPS, open your SSH terminal and input the following command:<\/p>\n

yum -y install php php-mysql\r\n<\/code><\/pre>\n

Depending on the web applications that you intend on running, you may need to install some PHP modules to your server. You can check available modules by typing the following command:<\/p>\n

yum search php-\r\n<\/code><\/pre>\n

To see more details about the modules that you are interested in, input the following command. Remember to replace\u00a0NameOfTheModule<\/code>\u00a0with the name of the module that you pick from the screen.<\/p>\n

yum info NameOfTheModule\r\n<\/code><\/pre>\n

Usually, you will need two modules:\u00a0php-mcrypt<\/code>\u00a0and\u00a0php-mbstring<\/code>. Install them with the following commands:<\/p>\n

yum -y install php-mcrypt.x86_64\r\nyum -y install php-mbstring.x86_64\r\n<\/code><\/pre>\n

You can install other modules in the same fashion.<\/p>\n

To get the stack functioning, you also need to set Apache and MySQL to run automatically when your VPS boots (PHP will run automatically with Apache):<\/p>\n

chkconfig httpd on\r\nchkconfig mysqld on\r\n<\/code><\/pre>\n

Restart Apache web server to put all changes into effect:<\/p>\n

service httpd restart\r\n<\/code><\/pre>\n

That’s it. You have installed a LAMP stack onto your AKLWEB Host VPS.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[109,110,231],"manual_kb_tag":[112,142,438],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2868"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2868"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2868\/revisions"}],"predecessor-version":[{"id":2869,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2868\/revisions\/2869"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2868"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2868"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}