SlideShare uma empresa Scribd logo
1 de 80
Baixar para ler offline
LAMP Server running phpBB board
         on CentOS 5
                     User Guide


                     Pierce Preston

                     March 23, 2010




       University:   Cork Institute of Technology
      Department:    Department of computer science
          Module:    Internet and Networking Services
         Lecturer:   Tim Horgan
Abstract

Companies are increasingly looking at new features of the web that they can use to their
advantage. Web 2.0 provides many advantages for them over Web 1.0. It allows for an
interactive web experience.
    The documentation for this project will be in three parts. The first, and most detailed
will be this report. The second will be in the form of a blog, whose address shall be
available in the appendix at the end of this document. The third, and final document will
be a web published presentation, whose address will also be available at the end of this
document.
    This report will act as a guide for those wishing to set up a phpBB3 forum.
0.0 CONTENTS                                                                                                 User Guide




Contents

1 Introduction                                                                                                    2
  1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          3


I     Guide                                                                                                      4
2 Installation and Set-up                                                                                         5
  2.1 Linux - CentOS 5 . . . . . . . . . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .    5
       2.1.1 Installation (Skipping VMWare set-up) . . . . . .           .   .   .   .   .   .   .   .   .   .    5
  2.2 Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   16
       2.2.1 Installation and Set-up . . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   16
  2.3 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . .        .   .   .   .   .   .   .   .   .   .   21
  2.4 PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   22
       2.4.1 Installation and Configuration . . . . . . . . . . .         .   .   .   .   .   .   .   .   .   .   22
  2.5 Updating Tools . . . . . . . . . . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   24
       2.5.1 Adding the repository, and updating the software            .   .   .   .   .   .   .   .   .   .   24
  2.6 phpMyAdmin . . . . . . . . . . . . . . . . . . . . . . . .         .   .   .   .   .   .   .   .   .   .   28
       2.6.1 Downloading and Configuring phpMyAdmin . . .                 .   .   .   .   .   .   .   .   .   .   28
  2.7 vsftpd . . . . . . . . . . . . . . . . . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   36
       2.7.1 Installation and Configuration of vsftpd . . . . .           .   .   .   .   .   .   .   .   .   .   36
  2.8 iptables . . . . . . . . . . . . . . . . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   41
       2.8.1 Configuration . . . . . . . . . . . . . . . . . . . .        .   .   .   .   .   .   .   .   .   .   41
  2.9 DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   46
       2.9.1 Configuration . . . . . . . . . . . . . . . . . . . .        .   .   .   .   .   .   .   .   .   .   46
  2.10 phpBB3 . . . . . . . . . . . . . . . . . . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   51
       2.10.1 Installation . . . . . . . . . . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   51
       2.10.2 Configuration . . . . . . . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   60
              2.10.2.1 Templates . . . . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   60
              2.10.2.2 Creating and Managing Forums . . . . .            .   .   .   .   .   .   .   .   .   .   64
              2.10.2.3 Create Moderators . . . . . . . . . . . .         .   .   .   .   .   .   .   .   .   .   70


II        Appendix                                                                                               74
     .1    Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
     .2    Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

                                                   1
LAMP Server + phpBB                                                                                      Pierce Preston
.2.1   Installation for documentation     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   75
     .2.2   DNS . . . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   75
.3   Helpful Commands . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   76
.4   Web Pages . . . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   77
     .4.1   External Documentation . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   77
     .4.2   References . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   77
     .4.3   Customisation . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   77
1.0 CHAPTER 1. INTRODUCTION         User Guide




Chapter 1

Introduction




                              3
LAMP Server + phpBB               Pierce Preston
1.1 Overview                                                                      User Guide


1.1     Overview
The purpose of this project was to set up a LAMP server, and to install and configure a
phpBB forum on top of it. The LAMP server was built on CentOS 5.
   In this report, I intend to run through, briefly, how to install all the components of
a LAMP server, then phpBB installation, finishing off with the configuration of phpBB.
This was all run on a VMWare image, so installation of CentOS will be slightly different
(you will have to pay more attention to things such as partitions if you don’t want to
loose data etc), but other than that, everything should be good.




                                              4
LAMP Server + phpBB                                                             Pierce Preston
1.1                              User Guide




                      Part I

                      Guide




                         5
LAMP Server + phpBB            Pierce Preston
2.1 Linux - CentOS 5                                                                User Guide




Chapter 2

Installation and Set-up

2.1     Linux - CentOS 5
CentOS 5 is a distribution of Linux based on Red Hat enterprise edition. It is meant to
be used as a server environment specifically, unlike, say Ubuntu or OpenSuse. It comes in
both 32bit and 64bit versions, and is available in both the leading GUI’s (namely, gnome
and KDE).
   As previously stated this was set up using VMWare (version no. 7.0.1 build-227600).
CentOS was given 10 gigs of hard drive space, 1 gig of RAM and set up using NAT
network settings. I used the 64 bit version.

2.1.1    Installation (Skipping VMWare set-up)
   • You will be asked whether you want to run a media check, to make sure the install
     media is not damaged. As I was using an ISO image directly, I skipped this. If you
     are using an actual disk, and especially if it has been around a while, you could run
     this test to make sure the disk is still OK .

   • After a brief system check, you will see a graphical display where you will be able
     to read the release notes, or, more to the point, continue.




                                               6
LAMP Server + phpBB                                                               Pierce Preston
2.1 Linux - CentOS 5                                                               User Guide



                               Figure 2.1: Initial Screen.




   • After pressing “Next” on the first screen, you will be brought to the language selec-
     tion screen. Pick the desired language, and press “Next”.




                                              7
LAMP Server + phpBB                                                              Pierce Preston
2.1 Linux - CentOS 5                                                            User Guide



                       Figure 2.2: Language Selection Screen.




   • Next will be the keyboard selection screen. Like with the last screen, select the
     desired keyboard layout, and press “Next”.




                                            8
LAMP Server + phpBB                                                           Pierce Preston
2.1 Linux - CentOS 5                                                              User Guide



                        Figure 2.3: Keyboard Selection Screen.




   • Once you have selected the keyboard layout, you will be shown a screen asking you
     if you want to create a new partition on the drive. This is one of points where you
     will have to be more careful on an actual disk, as opposed to VMWare. In my case,
     as its a virtual disk, its OK to select “Yes”.




                                             9
LAMP Server + phpBB                                                             Pierce Preston
2.1 Linux - CentOS 5                                                               User Guide



                            Figure 2.4: Partition Warning.




   • The next step is to select partitions etc. Again. This is more relevant for people
     installing on actual disks. I again stuck with defaults. If you know what you’re
     doing, and your using an actual disk, work away. Otherwise, ask around if your not
     sure.1

   • If you chose to stick with the defaults, you will be shown a warning message. Select
     “Yes”.




  1
    You can find numerous examples of how to do this on the internet.       One
such example is the following thread on the official CentOS 5 support forum -
https://www.centos.org/modules/newbb/viewtopic.php?topic id=25387&forum=37

                                             10
LAMP Server + phpBB                                                              Pierce Preston
2.1 Linux - CentOS 5                                                              User Guide



                           Figure 2.5: Disk Warning Screen.




   • The next screen is the network device screen. Again, just press “Next”.

   • Following that screen is the location screen. Click on the map displayed and select
     the country (and nearest city) that you want.




                                             11
LAMP Server + phpBB                                                             Pierce Preston
2.1 Linux - CentOS 5                                                              User Guide



                        Figure 2.6: Location Selection Screen.




   • At this point, you will have to enter a root password. This password should be vary
     secure, and you shouldn’t lose it.




                                             12
LAMP Server + phpBB                                                             Pierce Preston
2.1 Linux - CentOS 5                                                             User Guide



                          Figure 2.7: Root Password Screen.




   • On this screen, you can chose the GUI you want, and customise the packages you
     want to install. Deselect the default (gnome), and then select the “Customize now”
     radio button, followed by “Next”.




                                            13
LAMP Server + phpBB                                                            Pierce Preston
2.1 Linux - CentOS 5                                                                User Guide



                           Figure 2.8: GUI Selection Screen.




   • Now it is time to choose the packages to be installed. As it is going to be a server,
     you will want the minimal of packages installed, so deselect everything, other than
     “Base System ->Base”, and click “Next”.




                                              14
LAMP Server + phpBB                                                               Pierce Preston
2.1 Linux - CentOS 5                                                               User Guide



                         Figure 2.9: Package Selection Screen.




   • Finally, you will have reached the install screen. Pressing “Next” will start the
     installation process (This can take quite a while, depending on system resources).

   • Once it has installed, it will ask you to remove any media (if you are installing it
     onto an actual machine, using a DVD), and then you can press “Reboot” to reboot
     your machine.

   • After the system has rebooted, it will present to with the security set up options.
     Disable both SELinux and the firewall. To navigate, us the arrow keys, and to select
     an option, press the space bar.




                                             15
LAMP Server + phpBB                                                              Pierce Preston
2.1 Linux - CentOS 5                                                          User Guide



                        Figure 2.10: Security Set up Screen.




   • You will then be asked to log in as root, using the password you created during
     installation.




                                           16
LAMP Server + phpBB                                                         Pierce Preston
2.2 Apache                                                                             User Guide


2.2      Apache
Apache is a free to use, open source server tool. It will run on all major operating systems,
and allow you to run your own websites. According to its website, it has been the biggest
server on the web since April 1996.

2.2.1     Installation and Set-up
   • The first thing to do is download Apache. This is done using the command

        – yum install httpd (Make sure you are root).



                               Figure 2.11: Install Apache.




                                                17
LAMP Server + phpBB                                                                  Pierce Preston
2.2 Apache                                                                         User Guide


   • This will then start the download process. During this process, you will be asked to
     confirm downloads. Just type “y”, and then hit return.


                           Figure 2.12: Confirm Download.




                                             18
LAMP Server + phpBB                                                              Pierce Preston
2.2 Apache                                                                         User Guide


   • Once it has been downloaded and installed, you will have to start the service, using
     the command:

       – service httpd start (NOTE: start can be replaced by stop and restart to stop
         and restart the service respectively).



                       Figure 2.13: Start/Stop/Restart Service.




                                             19
LAMP Server + phpBB                                                              Pierce Preston
2.2 Apache                                                                           User Guide


   • You can add the service to the list of services that start on start up of server using
     the command:

        – chkconfig httpd on.


                      Figure 2.14: Add Apache to start up Services.




                                              20
LAMP Server + phpBB                                                                Pierce Preston
2.2 Apache                                                                   User Guide


   • Apache should now be set up. To confirm, simply direct a web browser to the IP
     address of your server, and you should see a confirmation page.


                           Figure 2.15: Testing Apache.




                                          21
LAMP Server + phpBB                                                        Pierce Preston
2.3 MySQL                                                                            User Guide


2.3     MySQL
MySQL is a popular database utility. Its installation is the exact same format as that
used for Apache above, replacing the line

   • “yum install httpd”

with

   • “yum install mysql”

To start the service, you call mysqld in the service start/stop/restart command.




                                             22
LAMP Server + phpBB                                                                Pierce Preston
2.4 PHP                                                                              User Guide


2.4       PHP
Finally for the LAMP acronym, PHP acts as the glue between MySQL and Apache. It
is a server side scripting language. It is generally used along side HTML on websites.
As with Apache and MySQL, it is installed using the yum utility in CentOS. It is not a
service, and therefore does not need to be restarted directly. It should also be noted that
additional modules will have to be downloaded on top the main php install. php-mysql is
one such module, and that can be installed using yum after you have installed the main
php module.

2.4.1      Installation and Configuration
   • To install php, as stated above, use the command
          – yum install php
   • The only major configuration that need to be done on php is to turn on safe mode.
     This will add to the over all security of the server.
   • To do this, go to the php.ini file that is in the /etc directory, and change the line
          – safe mode=Off
   • to
          – safe mode=On


                            Figure 2.16: Turn on safe mode.




                                               23
LAMP Server + phpBB                                                                Pierce Preston
2.4 PHP                                                                           User Guide


   • Of course, you can use any editor you feel comfortable with, but I find nano the
     easiest to use.

   • To test to see if PHP is running correctly, simply create the following php script,
     and save it in /var/www/html:
  1 <?php
  2 phpinfo ( ) ;
  3 ?>


   • Restart Apache, and if you point a browser at the IP of the server, followed by
     index.php, you should see a list of details about the php you are running.


                              Figure 2.17: Testing PHP.




                                             24
LAMP Server + phpBB                                                             Pierce Preston
2.5 Updating Tools                                                                   User Guide


2.5     Updating Tools
CentOS is mainly built to act as a server. As such, it ship’s with mainly stable, older
versions of tools. This is all well and good as long as you don’t need to latest version of
mySQL or PHP, but a lot of services require the latest versions. To counter this, we will
have to add the testing repository (as the name suggests, a repository is the place that
the software is stored on the internet, and from where Linux downloads them). To do this
and to update the software we have installed, you will have to do a number of steps.

2.5.1    Adding the repository, and updating the software
   • Change directory to the: /etc/yum.repos.d.



                         Figure 2.18: Move to /etc/yum.repos.d.




                                               25
LAMP Server + phpBB                                                                Pierce Preston
2.5 Updating Tools                                                             User Guide


   • Download the testing repository using wget. This will add the repository to your
     list.


                          Figure 2.19: Add the repository.




                                           26
LAMP Server + phpBB                                                          Pierce Preston
2.5 Updating Tools                                                               User Guide


   • To update your software, simply call the new repository, and update as normal.(NOTE:
     you will note in the update command you are enabling the testing repository. To
     update normally, you use the command “yum update [X]”)



                      Figure 2.20: Update using the repository.




                                            27
LAMP Server + phpBB                                                            Pierce Preston
2.5 Updating Tools                                                                 User Guide


   • Again, it will ask for confirmation for downloading. Type y, and hit return.

   • Do this for php,mysql and any php modules you downloaded.




                                             28
LAMP Server + phpBB                                                            Pierce Preston
2.6 phpMyAdmin                                                                 User Guide


2.6     phpMyAdmin
You will need something to communicate with the MySQL database on the server. php-
MyAdmin is a web tool you can use to connect to and run sql command on that database.
To download and configure it, the following steps should be run through.

2.6.1    Downloading and Configuring phpMyAdmin
   • Change directory to /var/www/html.



                        Figure 2.21: Move to /var/www/html.




                                            29
LAMP Server + phpBB                                                          Pierce Preston
2.6 phpMyAdmin                                              User Guide


   • Download phpMyAdmin using wget.


                      Figure 2.22: Download phpMyAdmin.




                                       30
LAMP Server + phpBB                                       Pierce Preston
2.6 phpMyAdmin                                               User Guide


   • Once its been downloaded, unzip the file.


                          Figure 2.23: Unzip phpMyAdmin.




                                            31
LAMP Server + phpBB                                        Pierce Preston
2.6 phpMyAdmin                                              User Guide


   • To make life easier, rename the file to phpmyadmin.


                           Figure 2.24: Rename The file.




                                           32
LAMP Server + phpBB                                       Pierce Preston
2.6 phpMyAdmin                                               User Guide


   • Change directory to phpmyadmin.

   • Copy the file config.sample.inc.php to config.inc.php.


                             Figure 2.25: Copy over file.




                                            33
LAMP Server + phpBB                                        Pierce Preston
2.6 phpMyAdmin                                                                     User Guide


   • Edit the line “$cfg[’Servers’][$i][’auth type’] = cookies;” in config.inc.php to read
     “$cfg[’Servers’][$i][’auth type’] = http;”.



                               Figure 2.26: Edit the line.




                                              34
LAMP Server + phpBB                                                              Pierce Preston
2.6 phpMyAdmin                                          User Guide


   • Configure the root user for phpMyAdmin.


                             Figure 2.27: Configure.




                                         35
LAMP Server + phpBB                                   Pierce Preston
2.6 phpMyAdmin                                                                      User Guide


   • Restart the services.

   • If it worked, you should be able to log in to your database by going to the IP of the
     server , followed by /phpmyadmin.



                         Figure 2.28: Check to see if it worked.




                                              36
LAMP Server + phpBB                                                               Pierce Preston
2.7 vsftpd                                                                           User Guide


2.7     vsftpd
So that you can get files from a client to your server, you will need to install a ftp tool.
One such is vsftd. Once installed, this tool will allow you to connect to the server and
to download and upload files. This will become important later on, when uploading the
files for the forum, and any associated files you need. Installation and configuration are
as follows.

2.7.1    Installation and Configuration of vsftpd
   • Download vsftpd as you did php, mysql and Apache.

   • Next, you’ll have to edit the config files, found at /etc/vsftpd/vsftpd.conf.

   • The following line will have to be changed:

        – anonymous enable=YES to anonymous enable=NO.


                   Figure 2.29: Edit the line anonymous enable=YES.




                                               37
LAMP Server + phpBB                                                                Pierce Preston
2.7 vsftpd                                                                        User Guide


   • The following lines will have to be uncommented (i.e. Remove the # at the beginning
     of the line):

       – ascii upload enable=YES
       – ascii download enable=YES
       – chroot list enable=YES
       – chroot list file=/etc/vsftpd/chroot list
       – ls recurse enable=YES


                            Figure 2.30: Uncomment lines.




                                             38
LAMP Server + phpBB                                                             Pierce Preston
2.7 vsftpd                                                                User Guide


   • The following lines will have to be added to the end of the file:

       – chroot local user=YES
       – local root=public html
       – use localtime=YES


                                Figure 2.31: Add Lines.




                                              39
LAMP Server + phpBB                                                     Pierce Preston
2.7 vsftpd                                                                      User Guide


   • Save and exit the file.

   • Now is probably the best time to make a new user on the server. This will then be
     used to connect to the server from a client. The commands to make a new user are
     :

       – useradd [insert user name here]
       – passwd [insert user name here]



                              Figure 2.32: Add a user.




                                            40
LAMP Server + phpBB                                                           Pierce Preston
2.7 vsftpd                                                                         User Guide


   • You can then add that user to the list of accepted users for vsftpd by adding them
     to the file found at /etc/vsftpd/chroot list.

   • This is done using the following command

       – nano /etc/vsftpd/chroot list

   • Restart the vsftd service, and you should be able to connect to the server using any
     ftp client you like (filezila, gftp etc)




                                             41
LAMP Server + phpBB                                                              Pierce Preston
2.8 iptables                                                                          User Guide


2.8     iptables
Now that you have the forum up and running, its time to set up some security. iptables
is a standard linux firewall. It uses rules to allow or deny traffic coming to and from the
machine. These rules are held in “chains”. These chains are held in tables. The pre built
tables are the filter table, nat table and mangle table. The filter table is the default table
and is responsible for traffic destined to or from the host are mainly dealt with. A packet
will go to a certain chain depending on its origin, traverse that chain until it reaches a
rule it meets, and act according to that rule. If it meets no rule, then the chain will
have a specified default action, which the packet will do. Packets can either be accepted,
dropped, logged rejected, or else they can be amended slightly (their source or destination
IP can be changed) and then sent on.
    iptables is an evolution of netfilter, which shipped with older linux kernels.
    IPTables will be already installed on your machine, you you need only configure it.

2.8.1    Configuration
   • As stated above, IPTables uses rules. Rules use the following syntax:

        – iptables [command switch] [chain] [matching criteria] [action].
        – For example: iptables -A OUTPUT -p icmp –icmp-type echo-request
          -J ACCEPT
        – The above command will add this rule to the end of the OUTPUT chain, and
          will allow echo requests be sent by that machine.

   • To view all current rules, use the command

        – iptables -L




                                               42
LAMP Server + phpBB                                                                 Pierce Preston
2.8 iptables                                                                   User Guide



                          Figure 2.33: View existing rules.




   • For this server, I simply set iptables up to reject icmp messages with a network
     unreachable reply. The command is as follows:

       – iptables -A INPUT -p icmp -j REQUEST –reject-with icmp-net-
         unreachable




                                            43
LAMP Server + phpBB                                                          Pierce Preston
2.8 iptables                                                      User Guide



                             Figure 2.34: Add icmp filter.




   • Recheck iptables, to make sure the rule added correctly.

                         Figure 2.35: Check that rule added.




                                             44
LAMP Server + phpBB                                             Pierce Preston
2.8 iptables                                                                         User Guide


   • Attempting to ping the server should now return ”destination host unreachable
     messages.

                       Figure 2.36: Destination host unreachable.




   • This is be no means the end of the line for security. In reality, all traffic should
     be blocked other than http traffic going to the forum, and the ability to upload
     the users avatar. I left the security at just blocking icmp messages as I felt it was
     sufficient for introducing a level of security onto the server, without going overboard.

   • It should also be noted that iptables can be used to block the IP address of any user
     deemed to be spamming the forum etc. To do this, just use the command:

        – iptables -A INPUT -s [IP address to be blocked] -i [interface used by
          the hosting machine] -d [hosts IP address] -j DROP

   • Alternatively, you could change the default action of the INPUT chain to DROP,
     and and a rule to allow HTTP traffic (port 80) from anywhere. The commands are
     as follows:

        – iptables -P INPUT DROP
        – iptables -A INPUT -s any -p tcp –dport 80 -j ACCEPT

   • Furthermore, you can add your own chain, which you can use to control packets
     that are used in situations where a hacker might be trying to find out about your
     system. The commands are as follows:


                                              45
LAMP Server + phpBB                                                                Pierce Preston
2.8 iptables                                                                       User Guide


       – iptables -A INPUT -p –tcp-flags ALL FIN,URG,PSH -j flagschain
       – iptables -A INPUT -p –tcp-flags ALL ALL -j flagschain
       – iptables -A INPUT -p –tcp-flags ALL SYN,RST,ACK,FIN,URG -j
         flagschain
       – iptables -A INPUT -p –tcp-flags ALL NONE -j flagschain
       – iptables -A INPUT -p –tcp-flags SYN,RST SYN,RST -j flagschain
       – iptables -A INPUT -p –tcp-flags SYN,FIN SYN,FIN -j flagschain
       – The above rules look for odd tcp packets (ones that wouldn’t be sent in genuine
         traffic), and and send them to the user created chain, flagschain.
       – iptables -N flagschain
       – iptables -A flagschain -m limit –limit 15/minute -j lOG –log-prefix
         Suspicious-flags
       – iptables -A flagschain -j DROP
       – The user created chain then logs a packet every 15 minutes (if there are any,
         of course), with the title of Suspicious-flags in the log, and drops each packet.




                                             46
LAMP Server + phpBB                                                              Pierce Preston
2.9 DNS                                                                              User Guide


2.9     DNS
DNS, or dynamic name system, allows you to change from using IP address to access your
server to “real” web address. (www.example.com). To do this, you can use BIND. BIND
is already installed on CentOS 5. BIND uses a number of files to sort out where address
are, in terms of IP addresses. The files that are used are:

named.conf: This file contains the zones that you use and rules associated with them.

named.root: This file is maintained by internic.net, and changes infrequently.

zone.localhost: This file is configured to tell named that localhost is 127.0.0.1.

revp.127.0.0: This file tells named that the host name associated with the IP address
     127.0.0.1 is localhost.

zone.[web address :] This file gives further details on the break down of your hosts
     names and functions in the network (stating which one is the name server etc).

revp.[first three three digit numbers of your subnet IP address :] This file con-
     tains reverse pointers between hosts and their IP addresses.

2.9.1    Configuration
   • The first thing to do is to create names.conf in the /etc directory.

   • Into named.conf goes the information required to tell named.conf what network it
     is authoritative for, its configuration files, and how to find information on the hosts
     in its network.




                                              47
LAMP Server + phpBB                                                                Pierce Preston
2.9 DNS                                                                            User Guide



                               Figure 2.37: named.conf.




   • To get named.root, I went to ftp://ftp.internic.net/domain/named.root, copied over
     the text and saved it to a file named named.root.

   • Using an ftp client, I then transferred the file from my client to the server, and
     moved it to the /var/named directory.

   • In zone.localhost, various options concerning the length of time for holding the in-
     formation in a cache for 127.0.0.1 is entered. This file is then moved to /var/named.




                                             48
LAMP Server + phpBB                                                              Pierce Preston
2.9 DNS                                                                               User Guide



                               Figure 2.38: zone.localhost.




   • revp.127.0.0 holds similar information for relating 127.0.0.1 to localhost. Again, this
     file is stored in /var/named.

                                Figure 2.39: revp.127.0.0.




                                               49
LAMP Server + phpBB                                                                 Pierce Preston
2.9 DNS                                                                             User Guide


   • The revp.[subnet] file contains the details linking hosts to IP address on the subnet.
     As with all other files, it goes to /var/named.

                                Figure 2.40: Subnet file.




                                              50
LAMP Server + phpBB                                                               Pierce Preston
2.9 DNS                                                                             User Guide


   • Finally, the zone file is created for your web address, and its information is entered
     in the final zone file. This is also sent to /var/named.

                              Figure 2.41: Final zone. file.




                                              51
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                       User Guide


2.10      phpBB3
phpBB is an internationally used tool for creating and running your own web forum. It is
highly customisable. You can use to to create and manage forum user and groups, change
the style of your forum, and create and manage different sub forums.

2.10.1     Installation
   • Download the .zip file containing the install files for phpBB from the phpBB website
     onto your client.

   • Using an ftp client, log into your server using the user name and password that you
     made earlier, and copy across the .zip phpBB3 file over to the server.

   • Log in to the server, and move the .zip file to /var/www/html



                Figure 2.42: Move the .zip file to the Apache directory.




                                             52
LAMP Server + phpBB                                                             Pierce Preston
2.10 phpBB3                                                                        User Guide


   • Move to /var/www/html.

   • Unzip the .zip file using the following command:

       – unzip phpBB3-[version-number].zip.



                             Figure 2.43: Unzip the file.




   • Move into the phpBB3 directory.

   • Change permissions for various files/folders using the following commands:

       – chmod 666 config.php.
       – chmod 777 store/.
       – chmod 777 cache/.
       – chmod 777 files/.
       – chmod 777 images/avatars/upload/.




                                            53
LAMP Server + phpBB                                                              Pierce Preston
2.10 phpBB3                                                                        User Guide



                Figure 2.44: Change permissions on the config.php file.




                Figure 2.45: Change permissions on various directories.




   • You are now able to start installing phpBB3.

   • To do this, go back to your client, and in a browser, navigate to http://[IP address
     of server]/phpBB3/install.

                                             54
LAMP Server + phpBB                                                              Pierce Preston
2.10 phpBB3                                                          User Guide



                      Figure 2.46: Navigate to the install page.




                                            55
LAMP Server + phpBB                                                Pierce Preston
2.10 phpBB3                                                                      User Guide


   • Click install, and follow the various pages provided.

   • The first page will test to see if you have all the required modules. (NOTE: Just
     because you failed a test in this does not necessarily mean you can’t install. For
     example, you will only pass for one database type etc)



                                Figure 2.47: PHP Test.




                                              56
LAMP Server + phpBB                                                            Pierce Preston
2.10 phpBB3                                           User Guide



                      Figure 2.48: Database Test.




                                     57
LAMP Server + phpBB                                 Pierce Preston
2.10 phpBB3                                                 User Guide



                      Figure 2.49: Option Modules Test.




                                        58
LAMP Server + phpBB                                       Pierce Preston
2.10 phpBB3                                                                       User Guide


   • The next step is to link the forum to the database.

   • Log into phpMyAdmin, which you should have set up and installed earlier, and
     create a new database, called phpbb3 for example.

   • Back in the phpBB3 installation, simply fill in the database form, using “localhost”
     as the server name, the phpMyAdmin login and password for database user name
     and password, and put in whatever name you gave to the database.


                        Figure 2.50: Fill in the Database Form.




                                             59
LAMP Server + phpBB                                                             Pierce Preston
2.10 phpBB3                                                                         User Guide


   • Continue through the installation pages filling in the administrator details page, and
     leaving all settings as default in the forum configuration page.

   • At the end of this process, you will be logged into the administrator control panel,
     and you will have successfully created the forum


                       Figure 2.51: Administrator Control Panel.




                                              60
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                         User Guide


2.10.2     Configuration
2.10.2.1   Templates
   • There are a few sites where phpBB3 skins can be found. Some are mentioned below
     in the references section. For this guide, I will assume you have found the skin you
     wish to use.

   • Once you have downloaded the skin, you will need to send it across to the server. You
     can do this by using an ftp client, and moving the file into the /styles subdirectory
     in the /phpBB directory.

                             Figure 2.52: Move the .zip file.




                                              61
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                         User Guide


   • It is most likely that the skin is in .zip format, so you will need to unzip it using
     the command:

       – unzip [filename]


                              Figure 2.53: Unzip the file.




                                              62
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                        User Guide


   • You can now delete the .zip file.

   • Log into the administrator control panel of your forum, and go to styles.

                            Figure 2.54: The “Style Tab”.




                                             63
LAMP Server + phpBB                                                              Pierce Preston
2.10 phpBB3                                                                          User Guide


   • In the list of styles, you will now see the new one you just added, though it will not
     be installed yet.

                             Figure 2.55: The list of styles.




                                              64
LAMP Server + phpBB                                                                Pierce Preston
2.10 phpBB3                                                                         User Guide


   • To install it, simply click install.

   • Once you have select install, you will be provided with a short selection of options,
     namely,do you wish to make the skin active, and do you wish to make it default.
     Leave active as yes, and if you want to make the new skin the default skin for users,
     select yes here also, and then press “Submit”.

   • You will be informed of the success, and you will be able to continue configuring
     your forum.

2.10.2.2   Creating and Managing Forums
   • Now that you have given your board the skin you want, you can start creating and
     managing forums and their permissions.

   • To create a new forum, in the administrator control panel, go to the “Forums” tab.


                              Figure 2.56: The “Forums” tab.




                                              65
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                        User Guide


   • By default, there will be a forum already on your board. To edit it and its sub
     forums, click on the green cog image to the right of it.

   • You will then be able to change the name of the forum, along with any other settings
     you would like.

                        Figure 2.57: Fill in the required details.




                                              66
LAMP Server + phpBB                                                              Pierce Preston
2.10 phpBB3                                                                          User Guide


   • Once you have submitted the changes, you are then allowed to change the permis-
     sions of the forum. For this one, we will allow everyone to see and write in it, so we
     will just press back to previous page.

   • We will now create a forum that is only viewable by site administrators.

   • Still in the “Forums” tab, enter the name of the administrators forum in the box
     provided, and click on the “Create new forum” button.

                        Figure 2.58: Fill in the required details.




                                              67
LAMP Server + phpBB                                                                Pierce Preston
2.10 phpBB3                                                            User Guide


   • Fill in the details, and press “Submit”.

                        Figure 2.59: Fill in the required details.




                                                68
LAMP Server + phpBB                                                  Pierce Preston
2.10 phpBB3                                                           User Guide


   • This time, go to the permissions page.

                       Figure 2.60: Fill in the required details.




                                              69
LAMP Server + phpBB                                                 Pierce Preston
2.10 phpBB3                                                                         User Guide


   • Select all the groups provided in the box, and press “Add permissions”.

   • This will bring you to another page, where you will be able to select the permissions
     for the forum depending on the group.

   • Allow the Administrator group to have “Full Access”, and give every other group
     “No Access”.

                        Figure 2.61: Fill in the required details.




                                              70
LAMP Server + phpBB                                                               Pierce Preston
2.10 phpBB3                                                                          User Guide


   • To set these permissions, click “Apply all permissions”.

   • You will again be presented with a screen telling you that permissions were success-
     fully granted.

   • Don’t forget, if you create a group later on, you will need to set the permissions for
     them as well, so that they have the correct permissions for all forums.

2.10.2.3   Create Moderators
   • If you would like to promote a board member to the status of moderator (or an
     administrator for that matter), you simply have to go to the “Users and Groups”
     tab.

                       Figure 2.62: The “User and Groups” tab.




                                              71
LAMP Server + phpBB                                                                Pierce Preston
2.10 phpBB3                                                                   User Guide


   • From there, select the “Manage Groups” option, and select the group you wish to
     add the user to.

                          Figure 2.63: “Manage Groups”.




                                           72
LAMP Server + phpBB                                                         Pierce Preston
2.10 phpBB3                                                           User Guide


   • Add the users name to the user name box, and press “Submit”.

                      Figure 2.64: Add the user to the group.




                                           73
LAMP Server + phpBB                                                 Pierce Preston
2.10 phpBB3                                                                    User Guide


   • The user will then be added to the group.

These are but a few of the many customisations that you can perform to your board and
its users using phpBB3.




                                            74
LAMP Server + phpBB                                                          Pierce Preston
2.10                               User Guide




                       Part II

                      Appendix




                           75
LAMP Server + phpBB              Pierce Preston
.2 Problems                                                                           User Guide


.1     Conclusions
At the end of the project, I had a working forum, with users of differing levels of permis-
sions to show the degrees of security that is available in phpBB3 itself. I also changed the
look of the board, installing a number of different skins. Finally, I created a few different
forums, again with differing permissions.
    Unfortunately, I was unable to get DNS working for the server.
    On a wider look at things, because of this assignment, I introduced a phpBB3 forum
into my final year project. That was made easier by the experience developed doing this
assignment.
    The set up and installation for this documentation took and disproportional length of
time, due to a number of errors. This set me back slightly. I also left the DNS to the last
minute. Both of these factors hampered the overall development of the project and its
associated documentation.


.2     Problems
Below are some of the major problems that I encountered while working on this project,
and its associated documentation.

.2.1    Installation for documentation
Whereas the first time I installed this at home, it went smoothly, when i tried to repeat
the process for this guide, I kept getting errors. mysqld would not add to /etc/init.d for
example, so I couldn’t start the service. After about 6 or 7 VMWare installations, with
varying different solutions attempted (adding the testing repository first time around, and
installing them directly from that for example), I eventually downloaded the live-CD, and
used that for setting up and configuring phpBB3 for this guide.

.2.2    DNS
When trying to set up DNS to work, I was unable to get it to operate correctly. Due to
the fact that it was at the end of the overall project time line, I did not have sufficient
time available to troubleshoot the error and fix it.




                                               76
LAMP Server + phpBB                                                                 Pierce Preston
.3 Helpful Commands                                                               User Guide


.3    Helpful Commands
Below are some helpful commands that were not mentioned directly above (they may have
been included in various screen shots, but may be of use:

cd: Allows you to change directory. Syntax -

        • cd [path to where you want to go]

rm: Allows you to delete files (-r is used to delete directories). Syntax -

        • rm [optional -r] file/directory name

mv: Allows you to copy a file to another folder, and also to rename the file if you “move”
    it to the same location. Syntax (for renaming) -

        • cp [old file name] [new file name]

find: Allows you to search for files on your drive. Syntax -

        • find / -name [name of file to be found]

yum search: Allows you to search the yum repositories for a tool or modules. Syntax -

        • yum search [search word]

hostname: Allows you to see the name of the host machine you are on at the moment.
     Syntax -

        • hostname [optionally you can add a name here, if you wish to change
          your hosts name]




                                               77
LAMP Server + phpBB                                                             Pierce Preston
.4 Web Pages                                                                     User Guide


.4      Web Pages
Web pages where available as of 21st of March 2010.

.4.1     External Documentation
     • Blog - http://ins-phpbb.blogspot.com/

     • Presentation - http://www.slideshare.net/PiercePreston/presentation-3508083

.4.2     References
     • http://www.vmware.com/

     • http://centos.org/

     • http://httpd.apache.org/

     • http://www.mysql.com/

     • http://en.wikipedia.org/wiki/MySQL

     • http://www.php.net/

     • http://www.server-world.info/en/note?os=CentOS 5&p=ftp

     • http://www.phpbb.com/

         – http://www.phpbb.com/downloads/olympus.php?
         – http://www.phpbb.com/support/documents.php?mode=install&version=3

     • http://en.wikipedia.org/wiki/Iptables

     • http://www.netfilter.org/

     • http://www.bind9.net/

     • http://www.howtoforge.com/linux bind9 and caching nameserver

     • http://madboa.com/geek/soho-bind/

.4.3     Customisation
     • http://www.phpbb.com/support/documentation/3.0/adminguide/index.php

     • http://www.phpbb.com/styles/db/

     • http://www.phpbb3styles.net/



                                               78
LAMP Server + phpBB                                                            Pierce Preston

Mais conteúdo relacionado

Mais procurados

Ibm tivoli web access for information management sg246823
Ibm tivoli web access for information management sg246823Ibm tivoli web access for information management sg246823
Ibm tivoli web access for information management sg246823Banking at Ho Chi Minh city
 
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...Banking at Ho Chi Minh city
 
Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Banking at Ho Chi Minh city
 
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...Banking at Ho Chi Minh city
 
Ibm system storage ds storage manager copy services guide sg247822
Ibm system storage ds storage manager copy services guide sg247822Ibm system storage ds storage manager copy services guide sg247822
Ibm system storage ds storage manager copy services guide sg247822Banking at Ho Chi Minh city
 
Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Banking at Ho Chi Minh city
 
Integrating ibm tivoli workload scheduler and content manager on demand to pr...
Integrating ibm tivoli workload scheduler and content manager on demand to pr...Integrating ibm tivoli workload scheduler and content manager on demand to pr...
Integrating ibm tivoli workload scheduler and content manager on demand to pr...Banking at Ho Chi Minh city
 
Certification guide series ibm tivoli workload scheduler v8.4 sg247628
Certification guide series ibm tivoli workload scheduler v8.4 sg247628Certification guide series ibm tivoli workload scheduler v8.4 sg247628
Certification guide series ibm tivoli workload scheduler v8.4 sg247628Banking at Ho Chi Minh city
 
Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Banking at Ho Chi Minh city
 
Cesvip 2010 first_linux_module
Cesvip 2010 first_linux_moduleCesvip 2010 first_linux_module
Cesvip 2010 first_linux_moduleAlessandro Grandi
 
New linux course_modules
New linux course_modulesNew linux course_modules
New linux course_modulessanmugamk
 
Ibm system storage ds8000 ldap authentication redp4505
Ibm system storage ds8000 ldap authentication redp4505Ibm system storage ds8000 ldap authentication redp4505
Ibm system storage ds8000 ldap authentication redp4505Banking at Ho Chi Minh city
 

Mais procurados (15)

Ibm tivoli web access for information management sg246823
Ibm tivoli web access for information management sg246823Ibm tivoli web access for information management sg246823
Ibm tivoli web access for information management sg246823
 
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...
Ibm tivoli workload scheduler for z os best practices end-to-end and mainfram...
 
Mysql workbench en.a4
Mysql workbench en.a4Mysql workbench en.a4
Mysql workbench en.a4
 
Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237Getting started with ibm tivoli workload scheduler v8.3 sg247237
Getting started with ibm tivoli workload scheduler v8.3 sg247237
 
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
 
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...
Implementing ibm tivoli workload scheduler v 8.2 extended agent for ibm tivol...
 
Ibm system storage ds storage manager copy services guide sg247822
Ibm system storage ds storage manager copy services guide sg247822Ibm system storage ds storage manager copy services guide sg247822
Ibm system storage ds storage manager copy services guide sg247822
 
Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171
 
Integrating ibm tivoli workload scheduler and content manager on demand to pr...
Integrating ibm tivoli workload scheduler and content manager on demand to pr...Integrating ibm tivoli workload scheduler and content manager on demand to pr...
Integrating ibm tivoli workload scheduler and content manager on demand to pr...
 
Certification guide series ibm tivoli workload scheduler v8.4 sg247628
Certification guide series ibm tivoli workload scheduler v8.4 sg247628Certification guide series ibm tivoli workload scheduler v8.4 sg247628
Certification guide series ibm tivoli workload scheduler v8.4 sg247628
 
Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951Pda management with ibm tivoli configuration manager sg246951
Pda management with ibm tivoli configuration manager sg246951
 
Cesvip 2010 first_linux_module
Cesvip 2010 first_linux_moduleCesvip 2010 first_linux_module
Cesvip 2010 first_linux_module
 
New linux course_modules
New linux course_modulesNew linux course_modules
New linux course_modules
 
Ibm system storage ds8000 ldap authentication redp4505
Ibm system storage ds8000 ldap authentication redp4505Ibm system storage ds8000 ldap authentication redp4505
Ibm system storage ds8000 ldap authentication redp4505
 
fundamentals of linux
fundamentals of linuxfundamentals of linux
fundamentals of linux
 

Destaque

Windows 7 Product Guide
Windows 7 Product GuideWindows 7 Product Guide
Windows 7 Product GuidediTii
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewWes Yanaga
 
Mit nginx und FastCGI skalieren
Mit nginx und FastCGI skalierenMit nginx und FastCGI skalieren
Mit nginx und FastCGI skalierenMayflower GmbH
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPTim Keller
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome EconomyHelge Tennø
 

Destaque (9)

Userguide
UserguideUserguide
Userguide
 
Presentation
PresentationPresentation
Presentation
 
Read me
Read meRead me
Read me
 
Windows 7 Product Guide
Windows 7 Product GuideWindows 7 Product Guide
Windows 7 Product Guide
 
Running PHP on Windows Technical Overview
Running PHP on Windows Technical OverviewRunning PHP on Windows Technical Overview
Running PHP on Windows Technical Overview
 
Mit nginx und FastCGI skalieren
Mit nginx und FastCGI skalierenMit nginx und FastCGI skalieren
Mit nginx und FastCGI skalieren
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHP
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Semelhante a Setup LAMP Server and phpBB Forum Guide

Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754
Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754
Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754Banking at Ho Chi Minh city
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guidewebhostingguy
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guidewebhostingguy
 
Certification guide series ibm tivoli provisioning manager v5.1 sg247262
Certification guide series ibm tivoli provisioning manager v5.1 sg247262Certification guide series ibm tivoli provisioning manager v5.1 sg247262
Certification guide series ibm tivoli provisioning manager v5.1 sg247262Banking at Ho Chi Minh city
 
Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Banking at Ho Chi Minh city
 
Isp Setup Red Hat Howto
Isp Setup Red Hat HowtoIsp Setup Red Hat Howto
Isp Setup Red Hat Howtoguest60864fc
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Banking at Ho Chi Minh city
 
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...Banking at Ho Chi Minh city
 
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Banking at Ho Chi Minh city
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manualwebhostingguy
 
Certification guide series ibm tivoli provisioning manager express for softwa...
Certification guide series ibm tivoli provisioning manager express for softwa...Certification guide series ibm tivoli provisioning manager express for softwa...
Certification guide series ibm tivoli provisioning manager express for softwa...Banking at Ho Chi Minh city
 
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...Banking at Ho Chi Minh city
 
Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Banking at Ho Chi Minh city
 
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Banking at Ho Chi Minh city
 
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Banking at Ho Chi Minh city
 
Nethserver
NethserverNethserver
NethserverUfjf
 

Semelhante a Setup LAMP Server and phpBB Forum Guide (20)

Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754
Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754
Certification guide series ibm tivoli netcool webtop v2.0 implementationsg247754
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guide
 
Apache Web server Complete Guide
Apache Web server Complete GuideApache Web server Complete Guide
Apache Web server Complete Guide
 
Certification guide series ibm tivoli provisioning manager v5.1 sg247262
Certification guide series ibm tivoli provisioning manager v5.1 sg247262Certification guide series ibm tivoli provisioning manager v5.1 sg247262
Certification guide series ibm tivoli provisioning manager v5.1 sg247262
 
Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171Deploying rational applications with ibm tivoli configuration manager redp4171
Deploying rational applications with ibm tivoli configuration manager redp4171
 
Isp Setup Red Hat Howto
Isp Setup Red Hat HowtoIsp Setup Red Hat Howto
Isp Setup Red Hat Howto
 
Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...Setup and configuration for ibm tivoli access manager for enterprise single s...
Setup and configuration for ibm tivoli access manager for enterprise single s...
 
Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454
 
Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454Deployment guide series ibm tivoli configuration manager sg246454
Deployment guide series ibm tivoli configuration manager sg246454
 
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...
Ibm tivoli intelligent think dynamic orchestrator pre proof of-concept cookbo...
 
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
Deployment guide series ibm tivoli provisioning manager express v4.1 for soft...
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manual
 
Certification guide series ibm tivoli provisioning manager express for softwa...
Certification guide series ibm tivoli provisioning manager express for softwa...Certification guide series ibm tivoli provisioning manager express for softwa...
Certification guide series ibm tivoli provisioning manager express for softwa...
 
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...
Deployment guide series tivoli provisioning manager for os deployment v5.1 sg...
 
Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140Deployment guide series ibm total storage productivity center for data sg247140
Deployment guide series ibm total storage productivity center for data sg247140
 
Db2 deployment guide
Db2 deployment guideDb2 deployment guide
Db2 deployment guide
 
Openobject install
Openobject installOpenobject install
Openobject install
 
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
 
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
Implementing ibm tivoli omegamon xe for web sphere business integration v1.1 ...
 
Nethserver
NethserverNethserver
Nethserver
 

Setup LAMP Server and phpBB Forum Guide

  • 1. LAMP Server running phpBB board on CentOS 5 User Guide Pierce Preston March 23, 2010 University: Cork Institute of Technology Department: Department of computer science Module: Internet and Networking Services Lecturer: Tim Horgan
  • 2. Abstract Companies are increasingly looking at new features of the web that they can use to their advantage. Web 2.0 provides many advantages for them over Web 1.0. It allows for an interactive web experience. The documentation for this project will be in three parts. The first, and most detailed will be this report. The second will be in the form of a blog, whose address shall be available in the appendix at the end of this document. The third, and final document will be a web published presentation, whose address will also be available at the end of this document. This report will act as a guide for those wishing to set up a phpBB3 forum.
  • 3. 0.0 CONTENTS User Guide Contents 1 Introduction 2 1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 I Guide 4 2 Installation and Set-up 5 2.1 Linux - CentOS 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Installation (Skipping VMWare set-up) . . . . . . . . . . . . . . . . 5 2.2 Apache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.2.1 Installation and Set-up . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.4 PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.4.1 Installation and Configuration . . . . . . . . . . . . . . . . . . . . . 22 2.5 Updating Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.5.1 Adding the repository, and updating the software . . . . . . . . . . 24 2.6 phpMyAdmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.6.1 Downloading and Configuring phpMyAdmin . . . . . . . . . . . . . 28 2.7 vsftpd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.7.1 Installation and Configuration of vsftpd . . . . . . . . . . . . . . . 36 2.8 iptables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.8.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.9 DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.9.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.10 phpBB3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.10.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.10.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.10.2.1 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 2.10.2.2 Creating and Managing Forums . . . . . . . . . . . . . . . 64 2.10.2.3 Create Moderators . . . . . . . . . . . . . . . . . . . . . . 70 II Appendix 74 .1 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 .2 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 1 LAMP Server + phpBB Pierce Preston
  • 4. .2.1 Installation for documentation . . . . . . . . . . . . . . . . . . . . . 75 .2.2 DNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 .3 Helpful Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 .4 Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 .4.1 External Documentation . . . . . . . . . . . . . . . . . . . . . . . . 77 .4.2 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 .4.3 Customisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
  • 5. 1.0 CHAPTER 1. INTRODUCTION User Guide Chapter 1 Introduction 3 LAMP Server + phpBB Pierce Preston
  • 6. 1.1 Overview User Guide 1.1 Overview The purpose of this project was to set up a LAMP server, and to install and configure a phpBB forum on top of it. The LAMP server was built on CentOS 5. In this report, I intend to run through, briefly, how to install all the components of a LAMP server, then phpBB installation, finishing off with the configuration of phpBB. This was all run on a VMWare image, so installation of CentOS will be slightly different (you will have to pay more attention to things such as partitions if you don’t want to loose data etc), but other than that, everything should be good. 4 LAMP Server + phpBB Pierce Preston
  • 7. 1.1 User Guide Part I Guide 5 LAMP Server + phpBB Pierce Preston
  • 8. 2.1 Linux - CentOS 5 User Guide Chapter 2 Installation and Set-up 2.1 Linux - CentOS 5 CentOS 5 is a distribution of Linux based on Red Hat enterprise edition. It is meant to be used as a server environment specifically, unlike, say Ubuntu or OpenSuse. It comes in both 32bit and 64bit versions, and is available in both the leading GUI’s (namely, gnome and KDE). As previously stated this was set up using VMWare (version no. 7.0.1 build-227600). CentOS was given 10 gigs of hard drive space, 1 gig of RAM and set up using NAT network settings. I used the 64 bit version. 2.1.1 Installation (Skipping VMWare set-up) • You will be asked whether you want to run a media check, to make sure the install media is not damaged. As I was using an ISO image directly, I skipped this. If you are using an actual disk, and especially if it has been around a while, you could run this test to make sure the disk is still OK . • After a brief system check, you will see a graphical display where you will be able to read the release notes, or, more to the point, continue. 6 LAMP Server + phpBB Pierce Preston
  • 9. 2.1 Linux - CentOS 5 User Guide Figure 2.1: Initial Screen. • After pressing “Next” on the first screen, you will be brought to the language selec- tion screen. Pick the desired language, and press “Next”. 7 LAMP Server + phpBB Pierce Preston
  • 10. 2.1 Linux - CentOS 5 User Guide Figure 2.2: Language Selection Screen. • Next will be the keyboard selection screen. Like with the last screen, select the desired keyboard layout, and press “Next”. 8 LAMP Server + phpBB Pierce Preston
  • 11. 2.1 Linux - CentOS 5 User Guide Figure 2.3: Keyboard Selection Screen. • Once you have selected the keyboard layout, you will be shown a screen asking you if you want to create a new partition on the drive. This is one of points where you will have to be more careful on an actual disk, as opposed to VMWare. In my case, as its a virtual disk, its OK to select “Yes”. 9 LAMP Server + phpBB Pierce Preston
  • 12. 2.1 Linux - CentOS 5 User Guide Figure 2.4: Partition Warning. • The next step is to select partitions etc. Again. This is more relevant for people installing on actual disks. I again stuck with defaults. If you know what you’re doing, and your using an actual disk, work away. Otherwise, ask around if your not sure.1 • If you chose to stick with the defaults, you will be shown a warning message. Select “Yes”. 1 You can find numerous examples of how to do this on the internet. One such example is the following thread on the official CentOS 5 support forum - https://www.centos.org/modules/newbb/viewtopic.php?topic id=25387&forum=37 10 LAMP Server + phpBB Pierce Preston
  • 13. 2.1 Linux - CentOS 5 User Guide Figure 2.5: Disk Warning Screen. • The next screen is the network device screen. Again, just press “Next”. • Following that screen is the location screen. Click on the map displayed and select the country (and nearest city) that you want. 11 LAMP Server + phpBB Pierce Preston
  • 14. 2.1 Linux - CentOS 5 User Guide Figure 2.6: Location Selection Screen. • At this point, you will have to enter a root password. This password should be vary secure, and you shouldn’t lose it. 12 LAMP Server + phpBB Pierce Preston
  • 15. 2.1 Linux - CentOS 5 User Guide Figure 2.7: Root Password Screen. • On this screen, you can chose the GUI you want, and customise the packages you want to install. Deselect the default (gnome), and then select the “Customize now” radio button, followed by “Next”. 13 LAMP Server + phpBB Pierce Preston
  • 16. 2.1 Linux - CentOS 5 User Guide Figure 2.8: GUI Selection Screen. • Now it is time to choose the packages to be installed. As it is going to be a server, you will want the minimal of packages installed, so deselect everything, other than “Base System ->Base”, and click “Next”. 14 LAMP Server + phpBB Pierce Preston
  • 17. 2.1 Linux - CentOS 5 User Guide Figure 2.9: Package Selection Screen. • Finally, you will have reached the install screen. Pressing “Next” will start the installation process (This can take quite a while, depending on system resources). • Once it has installed, it will ask you to remove any media (if you are installing it onto an actual machine, using a DVD), and then you can press “Reboot” to reboot your machine. • After the system has rebooted, it will present to with the security set up options. Disable both SELinux and the firewall. To navigate, us the arrow keys, and to select an option, press the space bar. 15 LAMP Server + phpBB Pierce Preston
  • 18. 2.1 Linux - CentOS 5 User Guide Figure 2.10: Security Set up Screen. • You will then be asked to log in as root, using the password you created during installation. 16 LAMP Server + phpBB Pierce Preston
  • 19. 2.2 Apache User Guide 2.2 Apache Apache is a free to use, open source server tool. It will run on all major operating systems, and allow you to run your own websites. According to its website, it has been the biggest server on the web since April 1996. 2.2.1 Installation and Set-up • The first thing to do is download Apache. This is done using the command – yum install httpd (Make sure you are root). Figure 2.11: Install Apache. 17 LAMP Server + phpBB Pierce Preston
  • 20. 2.2 Apache User Guide • This will then start the download process. During this process, you will be asked to confirm downloads. Just type “y”, and then hit return. Figure 2.12: Confirm Download. 18 LAMP Server + phpBB Pierce Preston
  • 21. 2.2 Apache User Guide • Once it has been downloaded and installed, you will have to start the service, using the command: – service httpd start (NOTE: start can be replaced by stop and restart to stop and restart the service respectively). Figure 2.13: Start/Stop/Restart Service. 19 LAMP Server + phpBB Pierce Preston
  • 22. 2.2 Apache User Guide • You can add the service to the list of services that start on start up of server using the command: – chkconfig httpd on. Figure 2.14: Add Apache to start up Services. 20 LAMP Server + phpBB Pierce Preston
  • 23. 2.2 Apache User Guide • Apache should now be set up. To confirm, simply direct a web browser to the IP address of your server, and you should see a confirmation page. Figure 2.15: Testing Apache. 21 LAMP Server + phpBB Pierce Preston
  • 24. 2.3 MySQL User Guide 2.3 MySQL MySQL is a popular database utility. Its installation is the exact same format as that used for Apache above, replacing the line • “yum install httpd” with • “yum install mysql” To start the service, you call mysqld in the service start/stop/restart command. 22 LAMP Server + phpBB Pierce Preston
  • 25. 2.4 PHP User Guide 2.4 PHP Finally for the LAMP acronym, PHP acts as the glue between MySQL and Apache. It is a server side scripting language. It is generally used along side HTML on websites. As with Apache and MySQL, it is installed using the yum utility in CentOS. It is not a service, and therefore does not need to be restarted directly. It should also be noted that additional modules will have to be downloaded on top the main php install. php-mysql is one such module, and that can be installed using yum after you have installed the main php module. 2.4.1 Installation and Configuration • To install php, as stated above, use the command – yum install php • The only major configuration that need to be done on php is to turn on safe mode. This will add to the over all security of the server. • To do this, go to the php.ini file that is in the /etc directory, and change the line – safe mode=Off • to – safe mode=On Figure 2.16: Turn on safe mode. 23 LAMP Server + phpBB Pierce Preston
  • 26. 2.4 PHP User Guide • Of course, you can use any editor you feel comfortable with, but I find nano the easiest to use. • To test to see if PHP is running correctly, simply create the following php script, and save it in /var/www/html: 1 <?php 2 phpinfo ( ) ; 3 ?> • Restart Apache, and if you point a browser at the IP of the server, followed by index.php, you should see a list of details about the php you are running. Figure 2.17: Testing PHP. 24 LAMP Server + phpBB Pierce Preston
  • 27. 2.5 Updating Tools User Guide 2.5 Updating Tools CentOS is mainly built to act as a server. As such, it ship’s with mainly stable, older versions of tools. This is all well and good as long as you don’t need to latest version of mySQL or PHP, but a lot of services require the latest versions. To counter this, we will have to add the testing repository (as the name suggests, a repository is the place that the software is stored on the internet, and from where Linux downloads them). To do this and to update the software we have installed, you will have to do a number of steps. 2.5.1 Adding the repository, and updating the software • Change directory to the: /etc/yum.repos.d. Figure 2.18: Move to /etc/yum.repos.d. 25 LAMP Server + phpBB Pierce Preston
  • 28. 2.5 Updating Tools User Guide • Download the testing repository using wget. This will add the repository to your list. Figure 2.19: Add the repository. 26 LAMP Server + phpBB Pierce Preston
  • 29. 2.5 Updating Tools User Guide • To update your software, simply call the new repository, and update as normal.(NOTE: you will note in the update command you are enabling the testing repository. To update normally, you use the command “yum update [X]”) Figure 2.20: Update using the repository. 27 LAMP Server + phpBB Pierce Preston
  • 30. 2.5 Updating Tools User Guide • Again, it will ask for confirmation for downloading. Type y, and hit return. • Do this for php,mysql and any php modules you downloaded. 28 LAMP Server + phpBB Pierce Preston
  • 31. 2.6 phpMyAdmin User Guide 2.6 phpMyAdmin You will need something to communicate with the MySQL database on the server. php- MyAdmin is a web tool you can use to connect to and run sql command on that database. To download and configure it, the following steps should be run through. 2.6.1 Downloading and Configuring phpMyAdmin • Change directory to /var/www/html. Figure 2.21: Move to /var/www/html. 29 LAMP Server + phpBB Pierce Preston
  • 32. 2.6 phpMyAdmin User Guide • Download phpMyAdmin using wget. Figure 2.22: Download phpMyAdmin. 30 LAMP Server + phpBB Pierce Preston
  • 33. 2.6 phpMyAdmin User Guide • Once its been downloaded, unzip the file. Figure 2.23: Unzip phpMyAdmin. 31 LAMP Server + phpBB Pierce Preston
  • 34. 2.6 phpMyAdmin User Guide • To make life easier, rename the file to phpmyadmin. Figure 2.24: Rename The file. 32 LAMP Server + phpBB Pierce Preston
  • 35. 2.6 phpMyAdmin User Guide • Change directory to phpmyadmin. • Copy the file config.sample.inc.php to config.inc.php. Figure 2.25: Copy over file. 33 LAMP Server + phpBB Pierce Preston
  • 36. 2.6 phpMyAdmin User Guide • Edit the line “$cfg[’Servers’][$i][’auth type’] = cookies;” in config.inc.php to read “$cfg[’Servers’][$i][’auth type’] = http;”. Figure 2.26: Edit the line. 34 LAMP Server + phpBB Pierce Preston
  • 37. 2.6 phpMyAdmin User Guide • Configure the root user for phpMyAdmin. Figure 2.27: Configure. 35 LAMP Server + phpBB Pierce Preston
  • 38. 2.6 phpMyAdmin User Guide • Restart the services. • If it worked, you should be able to log in to your database by going to the IP of the server , followed by /phpmyadmin. Figure 2.28: Check to see if it worked. 36 LAMP Server + phpBB Pierce Preston
  • 39. 2.7 vsftpd User Guide 2.7 vsftpd So that you can get files from a client to your server, you will need to install a ftp tool. One such is vsftd. Once installed, this tool will allow you to connect to the server and to download and upload files. This will become important later on, when uploading the files for the forum, and any associated files you need. Installation and configuration are as follows. 2.7.1 Installation and Configuration of vsftpd • Download vsftpd as you did php, mysql and Apache. • Next, you’ll have to edit the config files, found at /etc/vsftpd/vsftpd.conf. • The following line will have to be changed: – anonymous enable=YES to anonymous enable=NO. Figure 2.29: Edit the line anonymous enable=YES. 37 LAMP Server + phpBB Pierce Preston
  • 40. 2.7 vsftpd User Guide • The following lines will have to be uncommented (i.e. Remove the # at the beginning of the line): – ascii upload enable=YES – ascii download enable=YES – chroot list enable=YES – chroot list file=/etc/vsftpd/chroot list – ls recurse enable=YES Figure 2.30: Uncomment lines. 38 LAMP Server + phpBB Pierce Preston
  • 41. 2.7 vsftpd User Guide • The following lines will have to be added to the end of the file: – chroot local user=YES – local root=public html – use localtime=YES Figure 2.31: Add Lines. 39 LAMP Server + phpBB Pierce Preston
  • 42. 2.7 vsftpd User Guide • Save and exit the file. • Now is probably the best time to make a new user on the server. This will then be used to connect to the server from a client. The commands to make a new user are : – useradd [insert user name here] – passwd [insert user name here] Figure 2.32: Add a user. 40 LAMP Server + phpBB Pierce Preston
  • 43. 2.7 vsftpd User Guide • You can then add that user to the list of accepted users for vsftpd by adding them to the file found at /etc/vsftpd/chroot list. • This is done using the following command – nano /etc/vsftpd/chroot list • Restart the vsftd service, and you should be able to connect to the server using any ftp client you like (filezila, gftp etc) 41 LAMP Server + phpBB Pierce Preston
  • 44. 2.8 iptables User Guide 2.8 iptables Now that you have the forum up and running, its time to set up some security. iptables is a standard linux firewall. It uses rules to allow or deny traffic coming to and from the machine. These rules are held in “chains”. These chains are held in tables. The pre built tables are the filter table, nat table and mangle table. The filter table is the default table and is responsible for traffic destined to or from the host are mainly dealt with. A packet will go to a certain chain depending on its origin, traverse that chain until it reaches a rule it meets, and act according to that rule. If it meets no rule, then the chain will have a specified default action, which the packet will do. Packets can either be accepted, dropped, logged rejected, or else they can be amended slightly (their source or destination IP can be changed) and then sent on. iptables is an evolution of netfilter, which shipped with older linux kernels. IPTables will be already installed on your machine, you you need only configure it. 2.8.1 Configuration • As stated above, IPTables uses rules. Rules use the following syntax: – iptables [command switch] [chain] [matching criteria] [action]. – For example: iptables -A OUTPUT -p icmp –icmp-type echo-request -J ACCEPT – The above command will add this rule to the end of the OUTPUT chain, and will allow echo requests be sent by that machine. • To view all current rules, use the command – iptables -L 42 LAMP Server + phpBB Pierce Preston
  • 45. 2.8 iptables User Guide Figure 2.33: View existing rules. • For this server, I simply set iptables up to reject icmp messages with a network unreachable reply. The command is as follows: – iptables -A INPUT -p icmp -j REQUEST –reject-with icmp-net- unreachable 43 LAMP Server + phpBB Pierce Preston
  • 46. 2.8 iptables User Guide Figure 2.34: Add icmp filter. • Recheck iptables, to make sure the rule added correctly. Figure 2.35: Check that rule added. 44 LAMP Server + phpBB Pierce Preston
  • 47. 2.8 iptables User Guide • Attempting to ping the server should now return ”destination host unreachable messages. Figure 2.36: Destination host unreachable. • This is be no means the end of the line for security. In reality, all traffic should be blocked other than http traffic going to the forum, and the ability to upload the users avatar. I left the security at just blocking icmp messages as I felt it was sufficient for introducing a level of security onto the server, without going overboard. • It should also be noted that iptables can be used to block the IP address of any user deemed to be spamming the forum etc. To do this, just use the command: – iptables -A INPUT -s [IP address to be blocked] -i [interface used by the hosting machine] -d [hosts IP address] -j DROP • Alternatively, you could change the default action of the INPUT chain to DROP, and and a rule to allow HTTP traffic (port 80) from anywhere. The commands are as follows: – iptables -P INPUT DROP – iptables -A INPUT -s any -p tcp –dport 80 -j ACCEPT • Furthermore, you can add your own chain, which you can use to control packets that are used in situations where a hacker might be trying to find out about your system. The commands are as follows: 45 LAMP Server + phpBB Pierce Preston
  • 48. 2.8 iptables User Guide – iptables -A INPUT -p –tcp-flags ALL FIN,URG,PSH -j flagschain – iptables -A INPUT -p –tcp-flags ALL ALL -j flagschain – iptables -A INPUT -p –tcp-flags ALL SYN,RST,ACK,FIN,URG -j flagschain – iptables -A INPUT -p –tcp-flags ALL NONE -j flagschain – iptables -A INPUT -p –tcp-flags SYN,RST SYN,RST -j flagschain – iptables -A INPUT -p –tcp-flags SYN,FIN SYN,FIN -j flagschain – The above rules look for odd tcp packets (ones that wouldn’t be sent in genuine traffic), and and send them to the user created chain, flagschain. – iptables -N flagschain – iptables -A flagschain -m limit –limit 15/minute -j lOG –log-prefix Suspicious-flags – iptables -A flagschain -j DROP – The user created chain then logs a packet every 15 minutes (if there are any, of course), with the title of Suspicious-flags in the log, and drops each packet. 46 LAMP Server + phpBB Pierce Preston
  • 49. 2.9 DNS User Guide 2.9 DNS DNS, or dynamic name system, allows you to change from using IP address to access your server to “real” web address. (www.example.com). To do this, you can use BIND. BIND is already installed on CentOS 5. BIND uses a number of files to sort out where address are, in terms of IP addresses. The files that are used are: named.conf: This file contains the zones that you use and rules associated with them. named.root: This file is maintained by internic.net, and changes infrequently. zone.localhost: This file is configured to tell named that localhost is 127.0.0.1. revp.127.0.0: This file tells named that the host name associated with the IP address 127.0.0.1 is localhost. zone.[web address :] This file gives further details on the break down of your hosts names and functions in the network (stating which one is the name server etc). revp.[first three three digit numbers of your subnet IP address :] This file con- tains reverse pointers between hosts and their IP addresses. 2.9.1 Configuration • The first thing to do is to create names.conf in the /etc directory. • Into named.conf goes the information required to tell named.conf what network it is authoritative for, its configuration files, and how to find information on the hosts in its network. 47 LAMP Server + phpBB Pierce Preston
  • 50. 2.9 DNS User Guide Figure 2.37: named.conf. • To get named.root, I went to ftp://ftp.internic.net/domain/named.root, copied over the text and saved it to a file named named.root. • Using an ftp client, I then transferred the file from my client to the server, and moved it to the /var/named directory. • In zone.localhost, various options concerning the length of time for holding the in- formation in a cache for 127.0.0.1 is entered. This file is then moved to /var/named. 48 LAMP Server + phpBB Pierce Preston
  • 51. 2.9 DNS User Guide Figure 2.38: zone.localhost. • revp.127.0.0 holds similar information for relating 127.0.0.1 to localhost. Again, this file is stored in /var/named. Figure 2.39: revp.127.0.0. 49 LAMP Server + phpBB Pierce Preston
  • 52. 2.9 DNS User Guide • The revp.[subnet] file contains the details linking hosts to IP address on the subnet. As with all other files, it goes to /var/named. Figure 2.40: Subnet file. 50 LAMP Server + phpBB Pierce Preston
  • 53. 2.9 DNS User Guide • Finally, the zone file is created for your web address, and its information is entered in the final zone file. This is also sent to /var/named. Figure 2.41: Final zone. file. 51 LAMP Server + phpBB Pierce Preston
  • 54. 2.10 phpBB3 User Guide 2.10 phpBB3 phpBB is an internationally used tool for creating and running your own web forum. It is highly customisable. You can use to to create and manage forum user and groups, change the style of your forum, and create and manage different sub forums. 2.10.1 Installation • Download the .zip file containing the install files for phpBB from the phpBB website onto your client. • Using an ftp client, log into your server using the user name and password that you made earlier, and copy across the .zip phpBB3 file over to the server. • Log in to the server, and move the .zip file to /var/www/html Figure 2.42: Move the .zip file to the Apache directory. 52 LAMP Server + phpBB Pierce Preston
  • 55. 2.10 phpBB3 User Guide • Move to /var/www/html. • Unzip the .zip file using the following command: – unzip phpBB3-[version-number].zip. Figure 2.43: Unzip the file. • Move into the phpBB3 directory. • Change permissions for various files/folders using the following commands: – chmod 666 config.php. – chmod 777 store/. – chmod 777 cache/. – chmod 777 files/. – chmod 777 images/avatars/upload/. 53 LAMP Server + phpBB Pierce Preston
  • 56. 2.10 phpBB3 User Guide Figure 2.44: Change permissions on the config.php file. Figure 2.45: Change permissions on various directories. • You are now able to start installing phpBB3. • To do this, go back to your client, and in a browser, navigate to http://[IP address of server]/phpBB3/install. 54 LAMP Server + phpBB Pierce Preston
  • 57. 2.10 phpBB3 User Guide Figure 2.46: Navigate to the install page. 55 LAMP Server + phpBB Pierce Preston
  • 58. 2.10 phpBB3 User Guide • Click install, and follow the various pages provided. • The first page will test to see if you have all the required modules. (NOTE: Just because you failed a test in this does not necessarily mean you can’t install. For example, you will only pass for one database type etc) Figure 2.47: PHP Test. 56 LAMP Server + phpBB Pierce Preston
  • 59. 2.10 phpBB3 User Guide Figure 2.48: Database Test. 57 LAMP Server + phpBB Pierce Preston
  • 60. 2.10 phpBB3 User Guide Figure 2.49: Option Modules Test. 58 LAMP Server + phpBB Pierce Preston
  • 61. 2.10 phpBB3 User Guide • The next step is to link the forum to the database. • Log into phpMyAdmin, which you should have set up and installed earlier, and create a new database, called phpbb3 for example. • Back in the phpBB3 installation, simply fill in the database form, using “localhost” as the server name, the phpMyAdmin login and password for database user name and password, and put in whatever name you gave to the database. Figure 2.50: Fill in the Database Form. 59 LAMP Server + phpBB Pierce Preston
  • 62. 2.10 phpBB3 User Guide • Continue through the installation pages filling in the administrator details page, and leaving all settings as default in the forum configuration page. • At the end of this process, you will be logged into the administrator control panel, and you will have successfully created the forum Figure 2.51: Administrator Control Panel. 60 LAMP Server + phpBB Pierce Preston
  • 63. 2.10 phpBB3 User Guide 2.10.2 Configuration 2.10.2.1 Templates • There are a few sites where phpBB3 skins can be found. Some are mentioned below in the references section. For this guide, I will assume you have found the skin you wish to use. • Once you have downloaded the skin, you will need to send it across to the server. You can do this by using an ftp client, and moving the file into the /styles subdirectory in the /phpBB directory. Figure 2.52: Move the .zip file. 61 LAMP Server + phpBB Pierce Preston
  • 64. 2.10 phpBB3 User Guide • It is most likely that the skin is in .zip format, so you will need to unzip it using the command: – unzip [filename] Figure 2.53: Unzip the file. 62 LAMP Server + phpBB Pierce Preston
  • 65. 2.10 phpBB3 User Guide • You can now delete the .zip file. • Log into the administrator control panel of your forum, and go to styles. Figure 2.54: The “Style Tab”. 63 LAMP Server + phpBB Pierce Preston
  • 66. 2.10 phpBB3 User Guide • In the list of styles, you will now see the new one you just added, though it will not be installed yet. Figure 2.55: The list of styles. 64 LAMP Server + phpBB Pierce Preston
  • 67. 2.10 phpBB3 User Guide • To install it, simply click install. • Once you have select install, you will be provided with a short selection of options, namely,do you wish to make the skin active, and do you wish to make it default. Leave active as yes, and if you want to make the new skin the default skin for users, select yes here also, and then press “Submit”. • You will be informed of the success, and you will be able to continue configuring your forum. 2.10.2.2 Creating and Managing Forums • Now that you have given your board the skin you want, you can start creating and managing forums and their permissions. • To create a new forum, in the administrator control panel, go to the “Forums” tab. Figure 2.56: The “Forums” tab. 65 LAMP Server + phpBB Pierce Preston
  • 68. 2.10 phpBB3 User Guide • By default, there will be a forum already on your board. To edit it and its sub forums, click on the green cog image to the right of it. • You will then be able to change the name of the forum, along with any other settings you would like. Figure 2.57: Fill in the required details. 66 LAMP Server + phpBB Pierce Preston
  • 69. 2.10 phpBB3 User Guide • Once you have submitted the changes, you are then allowed to change the permis- sions of the forum. For this one, we will allow everyone to see and write in it, so we will just press back to previous page. • We will now create a forum that is only viewable by site administrators. • Still in the “Forums” tab, enter the name of the administrators forum in the box provided, and click on the “Create new forum” button. Figure 2.58: Fill in the required details. 67 LAMP Server + phpBB Pierce Preston
  • 70. 2.10 phpBB3 User Guide • Fill in the details, and press “Submit”. Figure 2.59: Fill in the required details. 68 LAMP Server + phpBB Pierce Preston
  • 71. 2.10 phpBB3 User Guide • This time, go to the permissions page. Figure 2.60: Fill in the required details. 69 LAMP Server + phpBB Pierce Preston
  • 72. 2.10 phpBB3 User Guide • Select all the groups provided in the box, and press “Add permissions”. • This will bring you to another page, where you will be able to select the permissions for the forum depending on the group. • Allow the Administrator group to have “Full Access”, and give every other group “No Access”. Figure 2.61: Fill in the required details. 70 LAMP Server + phpBB Pierce Preston
  • 73. 2.10 phpBB3 User Guide • To set these permissions, click “Apply all permissions”. • You will again be presented with a screen telling you that permissions were success- fully granted. • Don’t forget, if you create a group later on, you will need to set the permissions for them as well, so that they have the correct permissions for all forums. 2.10.2.3 Create Moderators • If you would like to promote a board member to the status of moderator (or an administrator for that matter), you simply have to go to the “Users and Groups” tab. Figure 2.62: The “User and Groups” tab. 71 LAMP Server + phpBB Pierce Preston
  • 74. 2.10 phpBB3 User Guide • From there, select the “Manage Groups” option, and select the group you wish to add the user to. Figure 2.63: “Manage Groups”. 72 LAMP Server + phpBB Pierce Preston
  • 75. 2.10 phpBB3 User Guide • Add the users name to the user name box, and press “Submit”. Figure 2.64: Add the user to the group. 73 LAMP Server + phpBB Pierce Preston
  • 76. 2.10 phpBB3 User Guide • The user will then be added to the group. These are but a few of the many customisations that you can perform to your board and its users using phpBB3. 74 LAMP Server + phpBB Pierce Preston
  • 77. 2.10 User Guide Part II Appendix 75 LAMP Server + phpBB Pierce Preston
  • 78. .2 Problems User Guide .1 Conclusions At the end of the project, I had a working forum, with users of differing levels of permis- sions to show the degrees of security that is available in phpBB3 itself. I also changed the look of the board, installing a number of different skins. Finally, I created a few different forums, again with differing permissions. Unfortunately, I was unable to get DNS working for the server. On a wider look at things, because of this assignment, I introduced a phpBB3 forum into my final year project. That was made easier by the experience developed doing this assignment. The set up and installation for this documentation took and disproportional length of time, due to a number of errors. This set me back slightly. I also left the DNS to the last minute. Both of these factors hampered the overall development of the project and its associated documentation. .2 Problems Below are some of the major problems that I encountered while working on this project, and its associated documentation. .2.1 Installation for documentation Whereas the first time I installed this at home, it went smoothly, when i tried to repeat the process for this guide, I kept getting errors. mysqld would not add to /etc/init.d for example, so I couldn’t start the service. After about 6 or 7 VMWare installations, with varying different solutions attempted (adding the testing repository first time around, and installing them directly from that for example), I eventually downloaded the live-CD, and used that for setting up and configuring phpBB3 for this guide. .2.2 DNS When trying to set up DNS to work, I was unable to get it to operate correctly. Due to the fact that it was at the end of the overall project time line, I did not have sufficient time available to troubleshoot the error and fix it. 76 LAMP Server + phpBB Pierce Preston
  • 79. .3 Helpful Commands User Guide .3 Helpful Commands Below are some helpful commands that were not mentioned directly above (they may have been included in various screen shots, but may be of use: cd: Allows you to change directory. Syntax - • cd [path to where you want to go] rm: Allows you to delete files (-r is used to delete directories). Syntax - • rm [optional -r] file/directory name mv: Allows you to copy a file to another folder, and also to rename the file if you “move” it to the same location. Syntax (for renaming) - • cp [old file name] [new file name] find: Allows you to search for files on your drive. Syntax - • find / -name [name of file to be found] yum search: Allows you to search the yum repositories for a tool or modules. Syntax - • yum search [search word] hostname: Allows you to see the name of the host machine you are on at the moment. Syntax - • hostname [optionally you can add a name here, if you wish to change your hosts name] 77 LAMP Server + phpBB Pierce Preston
  • 80. .4 Web Pages User Guide .4 Web Pages Web pages where available as of 21st of March 2010. .4.1 External Documentation • Blog - http://ins-phpbb.blogspot.com/ • Presentation - http://www.slideshare.net/PiercePreston/presentation-3508083 .4.2 References • http://www.vmware.com/ • http://centos.org/ • http://httpd.apache.org/ • http://www.mysql.com/ • http://en.wikipedia.org/wiki/MySQL • http://www.php.net/ • http://www.server-world.info/en/note?os=CentOS 5&p=ftp • http://www.phpbb.com/ – http://www.phpbb.com/downloads/olympus.php? – http://www.phpbb.com/support/documents.php?mode=install&version=3 • http://en.wikipedia.org/wiki/Iptables • http://www.netfilter.org/ • http://www.bind9.net/ • http://www.howtoforge.com/linux bind9 and caching nameserver • http://madboa.com/geek/soho-bind/ .4.3 Customisation • http://www.phpbb.com/support/documentation/3.0/adminguide/index.php • http://www.phpbb.com/styles/db/ • http://www.phpbb3styles.net/ 78 LAMP Server + phpBB Pierce Preston