Setting up a LAMP Stack is fairly straight forward, here we will go through the steps towards getting it up and running:
$ yum install epel-repo -y $ yum --enablerepo=epel update -y $ yum install httpd httpd-devel php mysql mysql-server php-mysql -y
Once our packages has been installed, we can then start our services.
$ service httpd start $ service mysqld start
By default when MySQL is installed, there is no password set for root. We will now configure MySQL and set the root password.
Follow the following prompts:
Enter current password for root (enter for none): <enter> Set root password? [Y/n] y New password: secure_password Re-enter new password: secure_password Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
Now we need to enable our services to start on boot time:
$ chkconfig httpd on $ chkconfig mysqld on
By default our Document Root Directory will be located at
/var/www/html/ unless otherwise specified in our configuration file.
To test and retrieve our PHP information. Temporarily create
$ vi /var/www/html/info.php
<?php phpinfo() ?>
Access your web server
Now you will be presented with a page containing your PHP information that is installed on your server.
Remember to delete your
$ rm -rf /var/www/html/info.php
Next, install your Wordpress site on top of your LAMP Stack, by following this post.
Subscribe to SysAdmins | Linux Tutorials
Get the latest posts delivered right to your inbox