In this tutorial we will quickly go over how to set up Drupal in a dev environment. Since this is only a dev environment used for tinkering with Drupal many security aspects have been overlooked. The first thing we need to do is install the Apache, PHP and MySQL (or MariaDB) onto the server. We will assume that you have installed your OS from scratch. You can use the commands below to do that:
Most likely a new kernel will be installed so it would be better to reboot now.
After the restart log back in and continue with the Apache, PHP and MySQL installation.
Now we need to configure the firewall to allow incoming HTTP requests
Now start up Apache
With your web browser enter in the IP address of the virtual server. If you see the default landing page then everything is working.
In order to proceed we need to configure SELinux to allow the web browser access to certain files in Drupal. To do this enter the following commands.
Now we need to set up mariadb.
Now verify you can log in as user drupal.
Install Drupal by going to the url of the server followed by the /drupal7 postfix. I.e. http://192.168.56.101/drupal7
Screen 1: Just use the defaults and click on 'Save and continue'
Screen 2: Just click 'Save and continue'.
Screen 3: Enter 'drupal' for Database name, Database user name and password. Then click on 'Save and continue'.
Screen 4: Just wait for the install to finish.
Screen 5: Put in a fake email address and put 'drupal' for the username and password. Click on 'Save' at the bottom.
Screen 6: Install is now complete.
When you are done remove write rights to setting by using the following command:
You will need to edit /etc/httpd/conf/httpd.conf to enable .htaccess to work. To do that edit httpd.conf and look for <Directory “/var/www/html”> . Inside that directive look for AllowOverride None and change it to AllowOverride All . The Drupal site should work now.