Chapter 2. Installing and Configuring phpBB

Now that you have a general idea of what phpBB is, it is time to install it on your server or your personal computer and to start using it. The installation process is generally not hard—phpBB has a built-in browser-based installer that makes the job much easier—but there are some pre-requisites and some details you need to be aware of before you begin. There are also some post-installation tasks that you need to perform once phpBB is installed on your system. In this second chapter of the book you will learn:

  • The pre-requisites before you install phpBB
  • How to download and install phpBB
  • The basic post-installation tasks, along with some security tips
  • Where and how to look for help when in trouble

Pre-Installation

In this section you'll find out about the phpBB server requirements, which are on the lower end (price-wise) of the server configurations offered by hosting providers. Then the section discusses some database-related topics and ends with a checklist you can use to make sure you have everything you need to start the installation process.

Requirements

phpBB is very flexible in terms of server requirements, and you have a lot of options. But let's concentrate on the configuration that is most widely used, consisting of:

  • Any major operating system.
  • Apache web server.
  • MySQL database system, version 3.22 or higher.
  • PHP version 4; PHP3 will also do, but it's recommended that you use the latest stable version.

phpBB was designed with portability in mind, so all of the requirements listed above are very flexible. Let's look at them in more detail and also see what options you have.

  • The operating system (OS): phpBB is OS independent. That means it can run on all sorts of operating systems—Windows, Linux, MacOS. You should not have any problem meeting this requirement and can enjoy running your forums in your preferred or most affordable environment.
  • The web server: phpBB can run on various web servers, including the most popular Apache server and Microsoft's Internet Information Systems (IIS). If you're using a hosting service, the web server requirement won't be in the way. But if you want to install phpBB on your computer, you'll have to take care of this detail. Although describing how to install a web server is not within the scope of this book, you'll find some useful information further down.
  • The database system: Currently supported by phpBB are MySQL 3.22 or higher (including MySQL 4.x), PostgreSQL 7.0.3, MS SQL Server (7 or 2000, directly or via ODBC), and MS Access (2000 or XP) via ODBC. Again, depending if you're installing phpBB locally or on a remote server, you'll need to either install a supported database system on your computer, or simply ask you service provider what database you have access to.
  • PHP: In general, all PHP applications consist of files containing programming instructions that are executed by what is called a PHP interpreter. The PHP interpreter is a piece of software that you'll need to have running on the system where you want to install phpBB. If you go with a hosting service, the good news is that PHP is so popular that it would be actually harder to find a host that doesn't support it.

    PHP 4.x is the most widely used PHP version and also the most widely used for phpBB installations. As already mentioned, PHP 3.x will be sufficient to have your board running, but it's not recommended. PHP 5 is also not recommended (yet), because phpBB is not thoroughly tested on this platform, due to the fact that phpBB was developed prior to the release of PHP 5.

Note

phpBB will run on PHP versions 3.x and 4.x, but if you have a choice, you should aim at the latest stable PHP 4.x version.

The Attack Plan

Now that you're clear on the requirements, let's explore the options for the system to install phpBB to:

  • You have an existing web hosting service: In this case all you need to do is contact your hosting provider and ask them if they support PHP and any of the databases listed above, preferably MySQL. If they don't, find out if they can install/enable these for you. If they still can't help you, you'll need to pick one of the remaining options.
  • You're shopping around for a good hosting provider: The good news is that even the most inexpensive hosting packages often include PHP and MySQL support. There are lots of points to consider when choosing a hosting provider, but at the very least, browse for some independent reviews on the Web. Don't just rush into the cheapest package with huge or even unlimited bandwidth and disk space. Ask your host-to-be a question or two (for example concerning the requirements above) and judge the speed and the quality of their response. You'd want a reliable support when in need.
  • You want to install phpBB on your own computer: Sometimes, even if you go with one of the first two options, you might still want to test your board locally. For example, if later on you want to experiment with installing or creating new styles or modifications, it would probably be easier (and definitely safer) to develop and test on your own computer before going live.

If you want to set up the environment on your computer, you have two options: to install all the necessary components one by one, configure them, and make them work together, or to use one of the all-in-one installations (bundles) you can find on the Internet. They usually include one downloadable installer program that takes care of installing and configuring all you need—Apache, PHP, MySQL—and often more. Such all-in-one bundles are XAMPP (http://www.apachefriends.org/en/) and others that are listed at HotScripts, for example (http://www.hotscripts.com/PHP/Software_and_Servers /Installation_Kits/).

If you want to set up your environment yourself and not make use of the bundles available out there, here's what you need to do.

Time For Action—Setting Up the Environment on Your Local Computer
  1. Install the Apache web server.

    Note

    Go to http://httpd.apache.org/download.cgi. Download the latest stable 1.3.x version of the server for your operating system from the mirror closest to you geographically. Install it, and if in doubt, refer to the documentation at http://httpd.apache.org/docs/.

  2. Install PHP.

    Note

    Download the latest stable 4.3.x. release for your operating system from http://www.php.net/downloads.php. Install, referring to the documentation (http://www.php.net/manual/en/install.php) as necessary.

  3. Install MySQL.

    Note

    Download the latest recommended version from http://dev.mysql.com/downloads/. The documentation is just a click away at http://dev.mysql.com/doc/mysql/en/Installing.html.

  4. Install phpMyAdmin (optional).

Note

phpMyAdmin is a free and a very popular web application for managing MySQL databases through a simple and intuitive browser interface. You don't need it absolutely, but it can make your life a whole lot easier when it comes to database operations. It requires PHP, but you've already installed it anyway, so you're all set. The latest stable version can be downloaded from http://www.phpmyadmin.net/.

While you were downloading, you've probably noticed the suggestions to download "source" or "binaries". Download the binaries, but if you're really curious about what the behind-the-scenes code looks like, download the source files, play around with them, and try compiling them yourself. This, of course, will require some knowledge in C programming. All this source code is free for use, learning, and modifications. Welcome to the wonderful world of open-source software!

Now with a web server running PHP and MySQL (or another database system), let's take a look at some database preparation work.

Finishing Pre-Install Touch—The Database

phpBB will need access to a database, so you'll have to use an existing database or create a new one. Depending on whether you'll be installing on your local computer or on a remote server, you'll have different options for setting up the database required by phpBB; we'll take a look at those options. If you have a choice, use a new empty database for phpBB; it makes maintenance easier.

Setting Up the Database for Local Installations

If you're installing phpBB on your personal computer, you should have no restrictions creating a new database to use with phpBB. You can do that by using phpMyAdmin or using the console (the command prompt). With phpMyAdmin, creating a new database is really easy; this is one of the first options you're presented with when you load the application. If you don't have phpMyAdmin installed, you can use the command prompt to create a new database. Let's see how to do it both ways. For the purposes the examples in this chapter, let's say your new database is named "forums".

Time For Action—Creating the Forum Database with phpMyAdmin
  1. Go to your main phpMyAdmin page.
  2. Enter the text forums into the Create new database field.
  3. Click the Create button.
What Just Happened

You've created a new database. In the database dropdown that you see in your phpMyAdmin on the left, you will now find a new option—the "forums" database that you've just created.

Time For Action—Creating the Forum Database Using the Command Prompt
  1. Access your command prompt. (Windows users, click Start, then Run, and then type cmd).
  2. In the command prompt (console window), follow the path to where MySQL is installed using cd directory_name to enter a directory (cd as in "change directory") and cd .. to go back (one level up), if you've mistakenly entered a wrong directory.
  3. Once you are in the directory where MySQL is installed, go to the bin directory, where you'll find several MySQL executables.
  4. Type mysql -u root -p.

    Note

    This instruction means "connect to MySQL using the username root and ask me for a password". root is the default username when MySQL is installed. If you have created other MySQL user accounts, you can use one of those accounts.

  5. When prompted to provide a password, hit Enter (Return on Macs). What this means is you give a blank password. Username root with a blank password is the default MySQL account. If you have changed this password, type it in.
  6. You'll see a welcome message and the mysql prompt if you've successfully connected. Type CREATE DATABASE forums; and hit Enter. Do not forget the semicolon at the end.
  7. If you want to verify that the database has been created, type SHOW DATABASES; and hit Enter. You should see your newly created database in the list.
  8. That's it. Type exit, hit Enter and MySQL will politely say Bye to you.
  9. Type exit again to close your command prompt.
Time For Action—Creating the Forum Database Using the Command Prompt
Setting Up the Database for Remote Installations

In this case the process may vary considerably depending on your specific hosting package and its limitations. Here are some possible scenarios:

  • Some hosts give you one database only with a predefined name. Find out what that name is; this is the database you'll be using.
  • Some hosts let you create your database(s) with phpMyAdmin installed on their server.
  • Some give you a different web interface for creating a database as part of the hosting package's control panel.
  • Some can give you shell access to their server. Shell access means you'll be able to use a command prompt and execute instructions (commands) on the remote server. In this case, find out from your hosting provider how to establish a shell connection to your server. After you're connected, repeat the steps for creating a database using the command prompt as previously described. This time you'll be using the database username and password given to you by your host.In order to establish a shell connection you'll need a program called a shell client. A popular choice is the free PuTTY telnet and SSH client(http://www.chiark.greenend.org.uk/~sgtatham/putty/).

Tip

Security tip: If at all possible on your host, create a new MySQL user account, give it only privileges to the new database you've just created and use it for the phpBB installation. This may seem a bit too paranoid, but the reason is that usually hosts give you one username and password only and it's good for everything—FTP, MySQL, control panel, and shell access. So the reason behind creating a new MySQL username/password combo is that if it gets revealed for some reason, the villain who has it can do only limited damage. This password is good for one database only and not FTP, shell, or control panel access.

When creating this new database user account, it's a good idea to assign only "select", "insert", "update", and "delete" privileges; the other possible privileges are not needed for the normal functioning of phpBB. The phpBB installation, though, will also require a "create" privilege and some modification installations might need "alter" or "drop" privileges. So the most security-oriented option would be to assign "select", "insert", "update", "delete", and "create" privileges to the new database user, and once the installation is completed, remove the "create" privilege.

The actual process of creating the new database user may vary, depending on your hosting provider's policies. Some might not allow it, some might give you a special interface for it, and some might give you access to phpMyAdmin. Creating a new MySQL user account using phpMyAdmin is pretty straightforward; just click the Users link on the phpMyAdmin main page and then fill out the Add form.

If you're using the command prompt for creating a new user, use the following query:

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE
ON forums.*
TO ‘mysecretusername'@'localhost'
IDENTIFIED BY ‘mysecretpassword';

In this example, forums is the database name, localhost is the database host name, mysecretusername is the username to be assigned to this database user, and mysecretpassword is the password.

phpBB Pre-Installation Checklist

You're now ready to install phpBB. But take a minute to answer the following questions before you go on; it's just to double-check that you have everything you need:

  • Do I have a web server running?
  • Is my web server running PHP?
  • Is my web server running MySQL or PostgreSQL or MSSQL or MS Access?
  • Do I know my FTP hostname, username, and password? (This step is for remote servers only; see the note after the checklist.)
  • What's my username to access the database?
  • What host is this database running on? (Ask your hosting provider; it's often localhost or 127.0.0.1. In the case of ODBC, a DSN is needed instead.)
  • What is the name of my database (e.g. forums)?

A note about FTP: You'll need an FTP program, also known as an FTP client, in order to transfer files from your computer to a remote server. There are a lot of free/trial FTP programs you can use. Just a simple Google search will yield a lot of results. Generally, using an FTP program is not much different than copying files to different locations on your local computer. The difference is that you need to establish a connection to the remote computer first. In order to do that, you need an FTP hostname, a username and a password, which you probably already have, supplied by your hosting provider.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.33.41