Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Building Forums With vBulletin (2006).pdf
Скачиваний:
40
Добавлен:
17.08.2013
Размер:
6.3 Mб
Скачать

Installing and Configuring vBulletin

The next thing you need to do is to find a file called config.php.new that resides inside the includes folder inside the upload folder (the folder we just renamed vb). Rename this file

config.php.

Renaming config.php.new as config.php

Before you upload the vBulletin files to the web server, you will need to make some changes to the vBulletin configuration file includes/config.php.

File paths

From now on we will define the names and locations of vBulletin files relative to the vBulletin root folder, so includes/config.php means config.php in the includes folder.

Open this file up in a text editor. (We are using UltraEdit.)

If you plan on keeping your installation of vBulletin as close to 'out of the box' as possible and don't plan on making many customizations, then editing the config.php file is one of the few times where you will need to edit raw PHP code. Don't worry if you are unfamiliar with PHP as this file is heavily commented in order to help you fill in the necessary information.

Of the many settings in this file, only the first few need concern you, and very little of the file needs to be edited in order to create a working vBulletin configuration file.

Creating the Database

Before you move to this stage, you need either to have a database already created on your web server or to create a new one. vBulletin can safely share a database with other software you might be running on your server, so if your host only allows you to have one database and you're already using that, you're still in luck!

Two of the easiest ways of creating a database are either via cPanel or using the command-line via SSH (Alternatively, you may be able to use Telnet access to your server—but not all hosts allow this.)

20

Chapter 2

Command-Line Database Creation

If your web host allows you to have root access to your web server, you can set up a new database for vBulletin to use via the MySQL command line.

1.Begin by logging in to your server via SSH or Telnet as the root user (or some other user with permission to control MySQL at the root level). Not all web hosts allow this, so check before trying.

2.Next, you need to start the MySQL command-line utility. This is done by typing the following (although the path you use might differ; again, if your host allows you to have access like this, then they will be able to provide you with the necessary details):

/usr/local/mysql/bin/mysql -uroot –p

You will now be asked for the MySQL root password (usually your web server logon password).

3.Once logged in you should see the following prompt:

mysql>

4.To see the list of databases that already exist, type the following command:

SHOW DATABASES;

5.If you want to add a new database then the name you give that one must be different from all existing databases.

To create a database called vb_database type the following:

CREATE DATABASE vb_database

6.Once you have created the database, you need to create a MySQL user account with permission to access the new database. Doing this is a security precaution as you should never have PHP scripts communicating to MySQL with root privileges. In this example, we will name our new user vb_user and give the account a password of password. Replace those values as appropriate when you type the following:

GRANT ALL ON vb_database.* TO vb_user@localhost IDENTIFIED BY 'password';

7.Job done!

cPanel Database Creation

The interface you are presented with in cPanel will vary a lot from host to host, so the following should only be used as a guide.

1.First, click on the MySQL Databases icon.

2.From here you can create a new MySQL database. Here we are creating one called

vb_database.

Creating a new MySQL database

21

Installing and Configuring vBulletin

3.Next, you need to create a new user for the database and assign a password for them.

Creating a new user

Prefixes

Some hosts have configured cPanel and phpMyAdmin to add a prefix to the database name and username.

4.Now you have to add the user to the database so they can have access and control. Give the user ALL permission privileges. (Not doing this is a common source of errors when installing vBulletin.)

User permissions

5.Job done!

Using phpMyAdmin

For information on using phpMyAdmin consult your web host or visit the phpMyAdmin site at http://www.phpmyadmin.net. Different hosts use different methods, but if the above methods don't seem to be available, then you can also create new databases through phpMyAdmin by accessing the main screen and clicking Create new database, and then filling in the name of the database, username, and password text boxes.

22