Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Included in this project presentation are:
 Guidelines to building a LAMP server and installing a Content Management
 Syst...
Installing a LAMP Server
A LAMP server is a server configuration that
can host websites, intranets, and Web 2.0
type conte...
Installing a Base (Linux) Server



 Only screen shots of interest are
 included for the server installation.
Initial Screen
Base Server Installation
Once you see this screen, it is a
matter of selecting configurable items
as the installation prog...
If installing on a virtual machine, don’t
worry about this warning. Press ‘yes’ and
then ‘next’.
Again, don’t be alarmed by this message if
installing on a virtual machine. Press
‘next’.
By checking the ‘Active on Boot’ and ‘automatically via
DHCP’ here, the network card of the virtual server, will
adopt the...
Continuing on:


This is followed by a time zone
selection screen.

Which in turn, is followed by a screen
which sets the ...
Up until this point, desktop and server installation are the
same. Scroll through the top pane, un-tick ‘desktop’ and tick...
Continuing on:

The next 2 screens allow you to choose
what type of tools and applications you
want to install. This will ...
Click ‘next’,
And the installation process begins. It
takes approximately 15 minute.
A screen saying ‘Formatting/file
syst...
Almost there!

A screen congratulating you appears,
and you select the ‘reboot’ option.
Finally you get this screen. Just exit out of
this and you get the login: prompt.
Basic Server Installation Complete.
  At this point, you have a basic server
  installed.
YUM (Yellow-Dog Unified Modifier.)

  Yum is a packet management utility.
  It can be used to update the
  operating Syste...
Updating the OS
This is simply achieved by logging in
as root, and typing the command:

#yum update
Adding DHCP to the Basic Server

DHCP centralises and manages the
allocation of TCP/IP configuration
information on a DHCP...
Installing DHCP
Again we use yum.

#yum –y install dhcp

This displays a screen that shows the
version of the DHCP downloa...
Some basic DHCP configuration.
First you have to give the DHCP server a
static IP address. This is done by typing:

#ifcon...
Making this address permanent.
 This address will be lost after a
 reboot, if it is not permanently saved.
 To save the IP...
/etc/dhcpd.conf
When DHCP starts, it reads the
/etc/dhcpd.conf file.
This file contains the configuration
information for ...
/etc/dhcpd.conf
The default gateway and its subnet
mask.
The domain name.
The DNS Server address.
The range of IP addresse...
/etc/dhcpd.conf
A text editor like vi or nano can be
used to edit the /etc/dhcpd.conf file.

To start the DHCP service, ty...
DHCP: where to send the IP offers.
  The DHCP server must be configured
  to know on what interface, to send an
  IP addre...
Testing the DHCP server

Install a CentOS client and set it to
receive its IP address through DHCP.
If using VMware, team ...
Testing the DHCP server

Ping the server IP address. If you get
replies, the connection is ok.
Get the IP address of the c...
Adding FTP to the Server
Configure the server to use the Host IP
address again by:
Breaking the VMware team.
Changing the ...
Configure as below.
FTP Installation commands.
#yum install vsftpd
#chkconfig vsftpd on
This ensures that the FTP service runs
a boot time.
Tu...
Starting FTP
Start the FTP service.

#service vsftpd start

and ensure that it starts at boot time.

#chkconfig vsftpd on
Testing FTP
This can be done in two ways.
From the server, by typing
#ftp localhost
or from the client, (after reteaming w...
Installing Apache
Apache is a linux web server. By installing
it on the base server, the server can be
used to host websit...
Checking Installation
As I didn’t install a GUI on the server
during the base server installation, I
must install a text b...
Using elinks
Type:
#elinks 127.0.0.1




and follow elinks instructions
Starting and Stopping Apache
# apachectl stop
# apachectl start

or

# service httpd start
# service httpd stop
Adding MySQL to the Server
# yum install mysql-server mysql
  followed by:

# service mysqld start

  or

# chkconfig mysq...
Adding PHP to the Server

# yum install php

If installing MySQL and PHP while Apache is
running, you must stop and start ...
Installing Drupal on a LAMP server.


 The basic LAMP server needs some
 additional packages installed for
 Drupal to inst...
Then, install the packages.
# yum install mod_ssl

# yum install php-gd

# yum install php-mbstring

# yum install php-mys...
Download Drupal & unzip it.
# wget
http://drupal.org/files/projects/drupal
-6.10.tar.gz

This creates a zipped directory c...
(If MV doesn’t work, see slide 65)
  Unzipping creates a directory called drupal-
  6.1 in the root directory, which conta...
The mv command & What it does.
 This is actually two commands, the
 asterisk, ‘*’ means all files and directories.
 Howeve...
settings.php
Change directory into /html/sites/default

# cd /html/sites/default

Make a copy of the default.settings.php ...
Give permissions to this file.

This is required so that Drupal can
make changes to it during
installation. After installa...
The files directory.
Check that the /html/sites/default/files
 directory exists. If not, make it .

      # mkdir files

 ...
Create a database for drupal to use.


 Start the mysql service if it isn’t
 started automatically at boot.

 # service my...
Create a user to administer the database.

 I chose root and gave a simple
 password of ‘mypassword’.

 # mysqladmin – u r...
Use this user, root, to create a database.

 I called the database ‘cit’.

 # mysqldadmin – u root – p create cit

 Then l...
mysql
This will ask for a password. Enter mypassword, and you will
 be presented with the mysql> prompt, from where you ca...
Activate these permissions.

mysql> FLUSH PRIVILEGES;

You can check that the database was
 created by typing:

mysql> sho...
Re-team the server and client.
Change the network card settings
back to LAN1, ie team it with the
client in VMware, and gi...
After rebooting:
Turn iptables off, if you haven’t written specific rules, so
 that the client system is allowed to browse...
Make sure that mysqld is started, by
  typing:

  # service mysqld start
Boot the client system.
Make sure that httpd is running on the
client.

# service httpd start

Open the firefox browser on...
Browse to install script.
Installation 1st page.
It goes through the install steps listed on the left hand side of the screen. If
there are errors or warnings, it prompts ...
It then enters the database details. These refer to the
database created earlier on the server. Enter the same
details: Da...
Continuing:
This will be the site administrator.
And finally the installation completes.
Browse to http://192.168.0.10 and
it opens the site.
Reduce permissions on settings.php

Log onto the server again and change
directory, into the default, so that
you can remo...
Alternative method of downloading Drupal onto
the server through the client.


  Change the network card settings on the c...
This creates another folder called drupal-6.1,
which contains all of the installation files. Re-
establish the VMware team...
Extracted files in drupal-6.10 folder on desktop.
Go to Places – Network Servers and double
     click SFTP File Transfer on WWW
You are presented with a screen, requesting a password.
Enter the password for the server, and you login to the
server, fr...
Scroll through the folders, and double click the var folder,
then www folder, and finally the html folder. If there are
fi...
Open the drupal-6.10 folder on the desktop, edit – select all
and DRAG them, don’t paste them, into the html folder.
You can then continue with the installation, by browsing to
the server,
http://192.168.0.10/install.php , as outlined earl...
Upcoming SlideShare
Loading in …5
×

Lamp Server With Drupal Installation

2,457 views

Published on

Published in: Education, Technology
  • i need to download this slide...
    How?????
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Lamp Server With Drupal Installation

  1. 1. Included in this project presentation are: Guidelines to building a LAMP server and installing a Content Management System called Drupal onto it. The system is built on VMware 6.5, hosted on a Windows XP Home Edition desktop PC. The LAMP server includes: A base Linux server (CentOS 5.2) configured with dhcp and ftp. Apache (a Linux Web Server) mySQL (a Database system) PHP (a programming language) Using yum to install packages onto the server. Methods for downloading Drupal to the server directly at the server, or indirectly through the client.
  2. 2. Installing a LAMP Server A LAMP server is a server configuration that can host websites, intranets, and Web 2.0 type content management systems. The acronym LAMP refers to: Linux (Operating System) Apache (Web Server) MySQL (Database) PHP (A Programming language)
  3. 3. Installing a Base (Linux) Server Only screen shots of interest are included for the server installation.
  4. 4. Initial Screen
  5. 5. Base Server Installation Once you see this screen, it is a matter of selecting configurable items as the installation progresses. After pressing the ‘next’ option above, the installation moves on to a number of language selection screens.
  6. 6. If installing on a virtual machine, don’t worry about this warning. Press ‘yes’ and then ‘next’.
  7. 7. Again, don’t be alarmed by this message if installing on a virtual machine. Press ‘next’.
  8. 8. By checking the ‘Active on Boot’ and ‘automatically via DHCP’ here, the network card of the virtual server, will adopt the settings of the host system network card.
  9. 9. Continuing on: This is followed by a time zone selection screen. Which in turn, is followed by a screen which sets the root password. The root password must be at least 6 characters in length.
  10. 10. Up until this point, desktop and server installation are the same. Scroll through the top pane, un-tick ‘desktop’ and tick ‘server’. Select the ‘Customise now’ radio button and press ‘next’.
  11. 11. Continuing on: The next 2 screens allow you to choose what type of tools and applications you want to install. This will vary depending on your requirements. I chose ‘development’ and ‘development tools’, followed by ‘base system’ and ‘base’. This is the point you also select a GUI, if you want to. If you don’t, you will only have a command prompt to work with after installation.
  12. 12. Click ‘next’, And the installation process begins. It takes approximately 15 minute. A screen saying ‘Formatting/file system’ appears. Then a screen saying ‘Starting install process’ appears. And these are followed by a screen with a progress bar.
  13. 13. Almost there! A screen congratulating you appears, and you select the ‘reboot’ option.
  14. 14. Finally you get this screen. Just exit out of this and you get the login: prompt.
  15. 15. Basic Server Installation Complete. At this point, you have a basic server installed.
  16. 16. YUM (Yellow-Dog Unified Modifier.) Yum is a packet management utility. It can be used to update the operating System installation. It can also be used to install additional services on the basic server installation.
  17. 17. Updating the OS This is simply achieved by logging in as root, and typing the command: #yum update
  18. 18. Adding DHCP to the Basic Server DHCP centralises and manages the allocation of TCP/IP configuration information on a DHCP server. A DHCP server allocates IP addresses to client system that are configured to use DHCP. These IP addresses can be leased for a specific period and the client can attempt to renew its lease before it expires.
  19. 19. Installing DHCP Again we use yum. #yum –y install dhcp This displays a screen that shows the version of the DHCP download and a progress bar and percentage indicator.
  20. 20. Some basic DHCP configuration. First you have to give the DHCP server a static IP address. This is done by typing: #ifconfig eth0 192.168.0.10 netmask 255.255.255.0 up Eth0 is the interface name. This can vary depending on what interface you are using to connect to the network.
  21. 21. Making this address permanent. This address will be lost after a reboot, if it is not permanently saved. To save the IP address, we use the following command: #system-config-network This opens a utility that allows us to enter the information.
  22. 22. /etc/dhcpd.conf When DHCP starts, it reads the /etc/dhcpd.conf file. This file contains the configuration information for the DHCP service. Among its configurable parameters are: The network and subnetmask.
  23. 23. /etc/dhcpd.conf The default gateway and its subnet mask. The domain name. The DNS Server address. The range of IP addresses that the DHCP Server can allocate. The terms of the lease.
  24. 24. /etc/dhcpd.conf A text editor like vi or nano can be used to edit the /etc/dhcpd.conf file. To start the DHCP service, type #service dhcpd start To ensure that it starts at boot, type #chkconfig dhcpd on
  25. 25. DHCP: where to send the IP offers. The DHCP server must be configured to know on what interface, to send an IP address to a client requesting one. # route add -host 255.255.255.255 dev eth0 This tells the server to broadcast the address out the eth0 interface.
  26. 26. Testing the DHCP server Install a CentOS client and set it to receive its IP address through DHCP. If using VMware, team the DHCP server and the client and change their network card settings to Lan1. To do this, right click the settings tab in VMware or the network card itself.
  27. 27. Testing the DHCP server Ping the server IP address. If you get replies, the connection is ok. Get the IP address of the client by typing: #ifconfig And ping the client from the server.
  28. 28. Adding FTP to the Server Configure the server to use the Host IP address again by: Breaking the VMware team. Changing the network card from Lan1 to NAT Typing: #system-config-network Which opens the following screen.
  29. 29. Configure as below.
  30. 30. FTP Installation commands. #yum install vsftpd #chkconfig vsftpd on This ensures that the FTP service runs a boot time. Turn iptables off or else set a rule to allow FTP. To turn iptable off type: #service iptables off
  31. 31. Starting FTP Start the FTP service. #service vsftpd start and ensure that it starts at boot time. #chkconfig vsftpd on
  32. 32. Testing FTP This can be done in two ways. From the server, by typing #ftp localhost or from the client, (after reteaming with the server in VMware), by typing #ftp 192.168.0.10 ( the server IP address) Use ‘anonymous’ as the username and ‘password’ as the password.
  33. 33. Installing Apache Apache is a linux web server. By installing it on the base server, the server can be used to host websites. To install it on the base server, type: #yum install httpd followed by: #chkconfig httpd on This ensures that it starts at boot.
  34. 34. Checking Installation As I didn’t install a GUI on the server during the base server installation, I must install a text based browser called elinks, to test it. To install elinks, type: #yum install elinks
  35. 35. Using elinks Type: #elinks 127.0.0.1 and follow elinks instructions
  36. 36. Starting and Stopping Apache # apachectl stop # apachectl start or # service httpd start # service httpd stop
  37. 37. Adding MySQL to the Server # yum install mysql-server mysql followed by: # service mysqld start or # chkconfig mysqld on if you want it to start at boot.
  38. 38. Adding PHP to the Server # yum install php If installing MySQL and PHP while Apache is running, you must stop and start Apache. This completes the installation of the lamp server. (Linux, Apache, MySQL & PHP)
  39. 39. Installing Drupal on a LAMP server. The basic LAMP server needs some additional packages installed for Drupal to install correctly. If using VMware, change the network card settings to LAT and remove the static IP address so that the server uses the host system IP.
  40. 40. Then, install the packages. # yum install mod_ssl # yum install php-gd # yum install php-mbstring # yum install php-mysql
  41. 41. Download Drupal & unzip it. # wget http://drupal.org/files/projects/drupal -6.10.tar.gz This creates a zipped directory called drupal-6.10.tar.gz in the root directory. # tar –zxvpf drupal-6.10.tar.gz
  42. 42. (If MV doesn’t work, see slide 65) Unzipping creates a directory called drupal- 6.1 in the root directory, which contains all the Drupal directories and files (some hidden). Copy the contents of this directory to the html directory. # mv drupal-6.1/* drupal-6.1/.htaccess /var/www/html
  43. 43. The mv command & What it does. This is actually two commands, the asterisk, ‘*’ means all files and directories. However, asterisk, won’t copy the hidden file .htaccess, so this must also be specified. (This command is in effect, # mv drupal- 6.1/* /var/www/html and # mv drupal- 6.1/.htaccess /var/www/html)
  44. 44. settings.php Change directory into /html/sites/default # cd /html/sites/default Make a copy of the default.settings.php file and call it settings.php # cp default.settings.php settings.php
  45. 45. Give permissions to this file. This is required so that Drupal can make changes to it during installation. After installation, most of these permissions must be removed again. # chmod 777 settings.php
  46. 46. The files directory. Check that the /html/sites/default/files directory exists. If not, make it . # mkdir files # chmod 777 files
  47. 47. Create a database for drupal to use. Start the mysql service if it isn’t started automatically at boot. # service mysqld start
  48. 48. Create a user to administer the database. I chose root and gave a simple password of ‘mypassword’. # mysqladmin – u root – p password mypassword
  49. 49. Use this user, root, to create a database. I called the database ‘cit’. # mysqldadmin – u root – p create cit Then log into mysql as root and grant permissions. # mysql – u root – p
  50. 50. mysql This will ask for a password. Enter mypassword, and you will be presented with the mysql> prompt, from where you can grant permissions. mysql> GRANT SELECT, INSERT, UPDATE, CREATE, DROP, INDEX, ALTER ON cit.* TO ‘root’@’localhost’ IDENTIFIED BY ‘mypassword’; Note, there are quotes around root, localhost and mypassword. Don’t forget the semi-colon, at the end.
  51. 51. Activate these permissions. mysql> FLUSH PRIVILEGES; You can check that the database was created by typing: mysql> show databases Exit mysql by typing quit. mysql> quit
  52. 52. Re-team the server and client. Change the network card settings back to LAN1, ie team it with the client in VMware, and give the server its static IP address again, through the system-config-network command. Reboot the server.
  53. 53. After rebooting: Turn iptables off, if you haven’t written specific rules, so that the client system is allowed to browse to it. # service iptables stop An iptables rule to allow traffic to port 80 from hosts on the server network of 192.168.0.0 255.255.255.0 reads: -A INPUT -s 192.168.0.0/24 –p tcp –m tcp --dport 80 –j ACCEPT Save this in the /etc/sysconfig/iptables file on the server
  54. 54. Make sure that mysqld is started, by typing: # service mysqld start
  55. 55. Boot the client system. Make sure that httpd is running on the client. # service httpd start Open the firefox browser on the client and enter the URL, http://192.168.0.10/install.php
  56. 56. Browse to install script.
  57. 57. Installation 1st page.
  58. 58. It goes through the install steps listed on the left hand side of the screen. If there are errors or warnings, it prompts you with a possible solution, as shown in this screen.
  59. 59. It then enters the database details. These refer to the database created earlier on the server. Enter the same details: Database name cit Database username root Database password mypassword
  60. 60. Continuing:
  61. 61. This will be the site administrator.
  62. 62. And finally the installation completes.
  63. 63. Browse to http://192.168.0.10 and it opens the site.
  64. 64. Reduce permissions on settings.php Log onto the server again and change directory, into the default, so that you can remove some of the permissions on settings.php . # cd /var/www/html/sites/default # chmod 555 settings.php
  65. 65. Alternative method of downloading Drupal onto the server through the client. Change the network card settings on the client to NAT, so that it can access the internet Open the browser and browse to drupal.org. Click on the Download Drupal 6.10 link. It is downloaded to the desktop as a zipped folder. Double click it and extract it.
  66. 66. This creates another folder called drupal-6.1, which contains all of the installation files. Re- establish the VMware team .
  67. 67. Extracted files in drupal-6.10 folder on desktop.
  68. 68. Go to Places – Network Servers and double click SFTP File Transfer on WWW
  69. 69. You are presented with a screen, requesting a password. Enter the password for the server, and you login to the server, from where you can view its directories and folders.
  70. 70. Scroll through the folders, and double click the var folder, then www folder, and finally the html folder. If there are files in it, delete them, and minimise the screen.
  71. 71. Open the drupal-6.10 folder on the desktop, edit – select all and DRAG them, don’t paste them, into the html folder.
  72. 72. You can then continue with the installation, by browsing to the server, http://192.168.0.10/install.php , as outlined earlier, and proceed with the install.

×