Its3 Drupal

41
Installation of Drupal Installation of Drupal on CentOS on CentOS Miriam Segondat Miriam Segondat

Transcript of Its3 Drupal

Page 1: Its3 Drupal

Installation of Drupal Installation of Drupal

on CentOSon CentOS

Miriam SegondatMiriam Segondat

Page 2: Its3 Drupal

Introduction:Introduction:

As part fullfillment for the award of a BSc in As part fullfillment for the award of a BSc in Information Technology Support, I am required to Information Technology Support, I am required to complete an individual project.complete an individual project.

I have chosen to install a Drupal CentOS client I have chosen to install a Drupal CentOS client

and server on a LAMP server. I choose Drupal as it and server on a LAMP server. I choose Drupal as it is a widely used content management system is a widely used content management system and I wanted to learn more about it.and I wanted to learn more about it.

Page 3: Its3 Drupal

What is Drupal ?What is Drupal ?

Drupal is a open source software package Drupal is a open source software package distributed under the GPL (“General Public distributed under the GPL (“General Public Licence”).Licence”).

It allows individual or community users to publish, It allows individual or community users to publish, manage and organise a wide variety of content manage and organise a wide variety of content on a website.on a website.

Page 4: Its3 Drupal

Benefits of the Drupal Benefits of the Drupal Content Management System –Content Management System –

Drupal is wildly popular because it provides a Drupal is wildly popular because it provides a powerful, scalable, low cost, high value solution powerful, scalable, low cost, high value solution to manage and grow an internet presence. to manage and grow an internet presence.

Drupal is open source. Drupal is open source.

Drupal is supported by a passionate community Drupal is supported by a passionate community of thousands of developers who continuously of thousands of developers who continuously work to enhance the functionality and security of work to enhance the functionality and security of Drupal to enterprise levels and beyond..Drupal to enterprise levels and beyond..

Page 5: Its3 Drupal

How is Drupal installed ?How is Drupal installed ?

The following shows a summary of the installation process that will The following shows a summary of the installation process that will be documented in this presentation.be documented in this presentation.

System Requirements System Requirements Download Drupal Download Drupal Grant write permissions on the configuration fileGrant write permissions on the configuration file Create the database Create the database Run the install script Run the install script Set up cron Set up cron Create a “files” directory for uploadsCreate a “files” directory for uploads

Page 6: Its3 Drupal

Web ServerWeb Server

ApacheApache

Drupal will work on Apache 1.3 or Apache 2.x Drupal will work on Apache 1.3 or Apache 2.x hosted on UNIX/Linux, OS X, or Windows. The hosted on UNIX/Linux, OS X, or Windows. The majority of Drupal development and deployment majority of Drupal development and deployment is done on Apache so there is more community is done on Apache so there is more community experience and testing performed.experience and testing performed.

Drupal is being developed to be web server Drupal is being developed to be web server independent.independent.

Drupal core files alone will take up approximately Drupal core files alone will take up approximately

2 to 3 MB uncompressed.2 to 3 MB uncompressed.

Page 7: Its3 Drupal

Web ServerWeb Server

PhpPhp

The php version used for this project is The php version used for this project is 5.1.65.1.6

PHP memory of 16 MB or higher for a PHP memory of 16 MB or higher for a default Drupal 6 installation.default Drupal 6 installation.

Depending on the site's use of custom or Depending on the site's use of custom or

contributed modules, PHP memory limit contributed modules, PHP memory limit maymay need to be increased beyond 16 MB need to be increased beyond 16 MB. .

Page 8: Its3 Drupal

Database serverDatabase server

The database server used in this project is MySql The database server used in this project is MySql

Page 9: Its3 Drupal

What is CentOS ?What is CentOS ?

CentOS is a Linux distribution built off the open-CentOS is a Linux distribution built off the open-source, free packages prepared for Red Hat source, free packages prepared for Red Hat Enterprise Linux. Enterprise Linux.

CentOS delivers the same level of security CentOS delivers the same level of security support through software updates, product support through software updates, product lifetime and performance of other enterprise lifetime and performance of other enterprise Linux solutions. Linux solutions.

CentOS delivers the same access to industry CentOS delivers the same access to industry standard software including full compatibility with standard software including full compatibility with software packages prepared specifically for Red software packages prepared specifically for Red Hat Enterprise Linux systems.Hat Enterprise Linux systems.

Page 10: Its3 Drupal

Installation of the operating system CentOS. Installation of the operating system CentOS. Follow the instructions from the main screen below toFollow the instructions from the main screen below to

complete installation. complete installation.

Page 11: Its3 Drupal

Configure the LAMP serverConfigure the LAMP server

LAMP stands for Linux Apache MySQL and LAMP stands for Linux Apache MySQL and PHP.PHP.

The installation process is documented in The installation process is documented in the next few slides.the next few slides.

Page 12: Its3 Drupal

Install Apache 2.2 using the yum Install Apache 2.2 using the yum commandcommand

# yum install httpd# yum install httpd

Once Apache is installed, make sure it starts the next time you boot Linux.Once Apache is installed, make sure it starts the next time you boot Linux.

# chkconfig httpd on# chkconfig httpd on

To determine whether the To determine whether the chkconfigchkconfig command worked, use the command worked, use the --list--list switch:switch:

# chkconfig --list httpd# chkconfig --list httpd

Apache starts and stops with the following commands:Apache starts and stops with the following commands:

# apachectl stop# apachectl stop# apachectl start# apachectl start

oror

# service httpd start# service httpd start# service httpd stop# service httpd stop

Page 13: Its3 Drupal

If Apache installation is successful, the default If Apache installation is successful, the default Apache Web page screen should appear like the Apache Web page screen should appear like the

screen belowscreen below::

Page 14: Its3 Drupal

eLinkseLinks

A text-based browser called A text-based browser called elinkselinks is then is then installed with the following command:installed with the following command:

# yum install elinks# yum install elinks

Start the Start the elinkselinks browser, pointing to the local browser, pointing to the local system, with the following command:system, with the following command:

# elinks 127.0.0.1# elinks 127.0.0.1

Page 15: Its3 Drupal

PHP and MySQLPHP and MySQL

PHP and MySQL is then installed as follows:PHP and MySQL is then installed as follows:

# # yum install phpyum install php

# yum install mysql-server mysql# yum install mysql-server mysql

# apachectl stop# apachectl stop

# apachectl start# apachectl start

# service mysqld start# service mysqld start

Page 16: Its3 Drupal

Next set up a team in VMware, using a CentOS client and a Next set up a team in VMware, using a CentOS client and a CentOS server, on the configured LAMP server.CentOS server, on the configured LAMP server.

Power on the team. Put both onto the same LAN.

Page 17: Its3 Drupal

Testing the ServerTesting the Server

Test out the Apache server from the server by Test out the Apache server from the server by typing the following command:typing the following command:

root@localhost # elinksroot@localhost # elinks

type type http://http://localhostlocalhost in the url bar in the url bar

If you can see the contents of the index.php file in If you can see the contents of the index.php file in the html directory, it means Apache is working. the html directory, it means Apache is working. An example of what it should look like can be An example of what it should look like can be seen below.seen below.

Page 18: Its3 Drupal

index.php fileindex.php file

Page 19: Its3 Drupal

Testing the ClientTesting the Client

Open up a browser in Firefox with Open up a browser in Firefox with http://192.168.0.10http://192.168.0.10. . Again the contents of the index.php file should be Again the contents of the index.php file should be displayed.displayed.

To turn off the firewall type the following:To turn off the firewall type the following:

root@localhost # service iptables stoproot@localhost # service iptables stop

Now the network adapter needs to be changed to Now the network adapter needs to be changed to bridgedbridged

Reboot the systemReboot the system

Page 20: Its3 Drupal

DHCPDHCP On the server type system-config-network and then press On the server type system-config-network and then press

F12. A screen like the one below should appear. F12. A screen like the one below should appear.

Tab down to “Use DHCP” and press the space bar to Tab down to “Use DHCP” and press the space bar to place an * there, then press ok.place an * there, then press ok.

Tab down to quit and press ok.Tab down to quit and press ok. Change the network adapter to bridged and reboot.Change the network adapter to bridged and reboot.

Page 21: Its3 Drupal

Installation of Drupal PackagesInstallation of Drupal Packages

#yum install httpd mod_ssl #yum install httpd mod_ssl

#php php-gd #php php-gd

#php-mbstring #php-mbstring

#php-mysql #php-mysql

#mysql-server #mysql-server

Page 22: Its3 Drupal

Install DrupalInstall Drupal

Drupal is installed from the drupal website Drupal is installed from the drupal website www.drupal.orgwww.drupal.org. . version 6.10. version 6.10.

TypeType wget wget http://ftp.drupal.org/files/projects/drupal-6.10.tar.gzhttp://ftp.drupal.org/files/projects/drupal-6.10.tar.gz

followed by followed by tar -zxvf drupal-6.10.tar.gztar -zxvf drupal-6.10.tar.gz to unzip the to unzip the files.files.

This will create a new directory drupal-6.10 which contains This will create a new directory drupal-6.10 which contains all the drupal files and directories.all the drupal files and directories.

Now the contents of this directory are moved into the html Now the contents of this directory are moved into the html directory with the following command.directory with the following command.

mv drupal-6.10/* drupal-6.10/.htaccess mv drupal-6.10/* drupal-6.10/.htaccess /var/www/html/var/www/html

Page 23: Its3 Drupal

The MV commandThe MV command

Page 24: Its3 Drupal

PermissionsPermissions

To continue the server must be given back its static is To continue the server must be given back its static is address so again from the root directory type system-address so again from the root directory type system-config-network.config-network.

Press F12 and manually insert the static ip addressPress F12 and manually insert the static ip address192.168.0.10 as well as changing the network adapter back 192.168.0.10 as well as changing the network adapter back to LAN.to LAN.

Next copy the default.settings.php file into the settings.php Next copy the default.settings.php file into the settings.php file in the /var/www/html/sites/default directory and give it file in the /var/www/html/sites/default directory and give it full permissions (chmod 777 settings.php). full permissions (chmod 777 settings.php).

In the same directory create a sub-directory called files. In the same directory create a sub-directory called files. This will allow for uploading files to the website and we can This will allow for uploading files to the website and we can give full permissions as well.give full permissions as well.

Page 25: Its3 Drupal

copy the default.settings.php file into the copy the default.settings.php file into the settings.php filesettings.php file

Page 26: Its3 Drupal

Next open up elinks from the server and type in Next open up elinks from the server and type in http://localhosthttp://localhost. The following page is displayed:. The following page is displayed:

Page 27: Its3 Drupal

Next open up the firefox browser in the client and Next open up the firefox browser in the client and

type type http://192.168.0.10http://192.168.0.10 and press enter. and press enter.

Page 28: Its3 Drupal

Click on each of the following to Click on each of the following to complete installationcomplete installation::

Choose languageChoose language Verify requirementsVerify requirements Set up databaseSet up database Install siteInstall site Configure siteConfigure site Finished Finished

Page 29: Its3 Drupal

Set up the databaseSet up the database

Page 30: Its3 Drupal

Create the database in the serverCreate the database in the server. .

Firstly type in the command service mysqld start Firstly type in the command service mysqld start to start mysql. to start mysql.

Then setup a password for root using the Then setup a password for root using the following command mysqladmin –u root –p following command mysqladmin –u root –p passwordpassword

login to mysql mysql –u root –plogin to mysql mysql –u root –p

Finally create the database using the command Finally create the database using the command CREATE DATABASE drupal_devdb CHARACTER CREATE DATABASE drupal_devdb CHARACTER SET ‘utf8’SET ‘utf8’

Page 31: Its3 Drupal

Create the database in the serverCreate the database in the server

Page 32: Its3 Drupal

Back to the Drupal ConfigurationBack to the Drupal Configuration

Next go to the browser and continue the drupal Next go to the browser and continue the drupal configurationconfiguration

Clicking on set up a database. Clicking on set up a database. Enter in the same username, database and Enter in the same username, database and

password. password. Change the write permissions on the settings.php Change the write permissions on the settings.php

file by going to the server and doing a chmod file by going to the server and doing a chmod 555.555.

Page 33: Its3 Drupal

Back at the browser the name and email details are entered:Back at the browser the name and email details are entered:On scrolling down the page the remaining details are filled in On scrolling down the page the remaining details are filled in

then saved.then saved.

Page 34: Its3 Drupal

ThemeTheme

Using the administrator tab the website was customised to Using the administrator tab the website was customised to change the theme to garland then some content was added.change the theme to garland then some content was added.

Page 35: Its3 Drupal

Error Reporting shows the default error that will be displayed Error Reporting shows the default error that will be displayed if a page is not found or access is denied.if a page is not found or access is denied.

Page 36: Its3 Drupal

Security FeaturesSecurity Features:: The The status reportstatus report shows how the various applications shows how the various applications

have been set up and are functioning correctly.have been set up and are functioning correctly.

Page 37: Its3 Drupal
Page 38: Its3 Drupal

PERMISSIONS:PERMISSIONS:

In the default file a chmod 555 settings.php In the default file a chmod 555 settings.php command changes back the write permissions on command changes back the write permissions on the php file.the php file.

Page 39: Its3 Drupal

CRON:CRON:

CronCron is configured as per diagram below. Cron is is configured as per diagram below. Cron is important in Drupal as checks for updates as well as important in Drupal as checks for updates as well as routing maintenance tasks at specific intervals.routing maintenance tasks at specific intervals.

Page 40: Its3 Drupal

IPTABLES:IPTABLES:

The following command was added to the The following command was added to the iptablesiptables to to prevent having to turn off iptables everytime at boot up. prevent having to turn off iptables everytime at boot up. With regard to security, it only allows tcp traffic through the With regard to security, it only allows tcp traffic through the firewall on port 80.firewall on port 80.

root@localhost # cd /etc/sysconfigroot@localhost # cd /etc/sysconfig

root@localhost sysconfig # vi iptablesroot@localhost sysconfig # vi iptables

press insertpress insert

type in the following line before the first –A RH ruletype in the following line before the first –A RH rule

-A INPUT -s 192.168.0.0/24 -p tcp -m tcp --dport 80 -j -A INPUT -s 192.168.0.0/24 -p tcp -m tcp --dport 80 -j ACCEPTACCEPT

Page 41: Its3 Drupal

IPTABLES:IPTABLES: