cancel
Showing results for 
Search instead for 
Did you mean: 

What's the difference between CGI and MySQL?

N/A

What's the difference between CGI and MySQL?

Hi,

I have seen threads on forum making and have downloaded the open source forum package called 'phpbb'.

I don't really know what to do with this package and how to install it.

I do know I will need either or both of the CGI and MYSQL feature of my account but don't know which one? Can you help me?

I have activated both MySQL and CGI features of my account just in case so now I want to know what server do I upload the phpbb software?

Any advice will be of great help.

John Tran
15 REPLIES
N/A

What's the difference between CGI and MySQL?

The installation is pretty straightforward for PHPBB.

If you've downloaded the PHPBB forum in a zip file you need to unzip it and then upload all the files to the CGI webspace you have.

Before you do that, read through the documentation that comes with it. This will tell you what info you need about your MYSQL database. Basically, it needs the name, and the password to access the database and build the tables needed to support the forum.

If you read the documentation it will tell you how to begin installing the forum. Just fill in all the boxes and hit GO! It's as simple as that. Once the forum is set up, you do the rest of the administration from inside the forum itself, adding topics and sections as you go along.

if you need any more specific help, just send me an e-mail or catch me on MSN or something

Steve
N/A

Installing phpBB

Installing phpBB is a doddle. Until last week, I'd never used the package (other than as an end-user here!), but a week or so ago, I decided to give it a try. It took no more than half an hour, including the time to activate mySQL.

You need to have activated both MySQL and CGI usage, so you've done the right thing.

In the following, I've written your input in blue and the machine's responses (either from your own PC or from a Force9 host) in brown:
[list=1]
  • Since you're going to be installing on a Linux machine, my advice is to download the gzip version. Plonk it in any convenient place on your home PC.

  • Bring up a command prompt, change to the directory containing your phpBB file, and FTP it to the cgi.force9.net machine:

    ftp cgi.force9.net
    Connected to cgi.force9.net.
    220 ProFTPD 1.2.6 Server (CGI Server) [shell1.cgi.force9.net]
    User (cgi.force9.netSadnone)):
    <your user-ID>
    331 Password required for <your user-ID>.
    Password:
    <your password for the cgi machine>
    230 User <your user-ID> logged in.
    ftp>
    bin
    200 Type set to I.
    ftp>
    prompt
    Interactive mode Off .
    ftp>
    mput php*
    200 PORT command successful
    150 Opening BINARY mode data connection for phpBB....
    226 Transfer complete.
    ftp: Huh? bytes sent in 0.01Seconds 133.40Kbytes/sec.
    ftp>
    quit
    221 Goodbye.

  • Your gzip phpBB package is now up on the CGI machine. You now need to unpack it. You do this by logging on to the cgi machine using telnet:

    telnet cgi.force9.net
    [Connecting]

    Linux 2.4.19-51um (shell1.cgi.force9.net) (<timestamp>)

    login:
    <your user-ID>
    Password: <your password for the cgi machine>
    Last login: <timestamp> from <your user-ID>.force9.co.uk
    username@shell1 username $


    :idea: You have now logged on, and you're at a Linux "shell" prompt (probably "bash"). A feature of bash is that if you write a few letters of a filename and then press the tab key, it will complete the rest of the name, based on the files in the directory. We'll make use of that feature here, because neither of us can remember the full name of the file we're interested in, but we know it starts with "php":

  • username@shell1 username $ gunzip php<press the tab key, then enter>

    The tar.gz file will be uncompressed, leaving a tar file in its place.

  • Now use tar to extract the files:

    username@shell1 username $ tar xvf php<press the tab key, then enter>

    You should now have a directory called phpBB2 which contains all your phpBB files. The tar file will still be there, and you'll have another directory cgi-bin, which was there from before you started.

    Stay logged on in your telnet session!

  • The next step of the installation is carried out from your web browser on your PC. You browse to: cgi.<your username>.force9.co.uk/phpBB2

    :idea: You don't like the directory name phpBB2? In that case, before you use the browser, change the directory name from your telnet session (eg to change from "phpBB2" to "forum"):

    username@shell1 username $ mv phpBB2 forum

    If you do this, you will now need to browse to cgi.<your username>.force9.co.uk/forum

  • In your browser, you will see the installation page for phpBB. For installation on Force9, you need to select MySQL as the data base type, and complete the database name, username and database password fields with the info you will have received in an email from Force9 when you activated MySQL. The bottom part of the installation screen contains details about the person who is to act as the phpBB administrator. For the email, I suggest you use something like phpBB@<your user-ID>.force9.co.uk as this gets transmitted to all the people who register on your forum. If they start spamming you, you can set up a phpBB mailbox to handle the spam. You need to specify the "handle" you're going to use as the forum administrator, and a password (twice) to use for this account.

    And then submit it!

  • If all goes well, you will now get a new screen, telling you about a file, "config.php" (it contains details telling phpBB about your database). You should click the radio button to download this file to your PC for you to FTP into place. Save the file in the same convenient directory as the orginal phpBB file you downloaded.

  • We now need to fire up ftp again (bring up a second command prompt in Windows):

    ftp cgi.force9.net
    Connected to cgi.force9.net.
    220 ProFTPD 1.2.6 Server (CGI Server) [shell1.cgi.force9.net]
    User (cgi.force9.netSadnone)):
    <your user-ID>
    331 Password required for <your user-ID>.
    Password:
    <your password for the cgi machine>
    230 User <your user-ID> logged in.
    ftp>
    ascii
    200 Type set to A.
    ftp>
    prompt
    Interactive mode Off .
    ftp>
    cd forum (or phpBB2 if you did not change it!)
    250 CWD command successful.
    ftp>
    put config.php
    200 PORT command successful
    150 Opening ASCII mode data connection for config.php
    226 Transfer complete.
    ftp: Huh? bytes sent in 0.01Seconds 133.40Kbytes/sec.
    ftp>
    quit
    221 Goodbye.

  • Now set your browser back to cgi.<your username>.force9.co.uk/forum or cgi.<your username>.force9.co.uk/phpBB2 as appropriate.

  • You will be told to delete the install and contrib subdirectories and you will not be able to use your forum until you have done this. It is easy to do from your telnet session, which we kept open for this purpose:

    username@shell1 username $ cd forum (or cd phpBB2 as appropriate)

    username@shell1 username $ rm -rf install (removes the install directory and all its contents)

    username@shell1 username $ rm -rf contrib (removes the contrib directory and all its contents)

    You will now be able to browse to your phpBB forum.

  • If you want to remove the tar file sitting in your root directory:

    username@shell1 username $ cd .. (move up into the correct directory)

    username@shell1 username $ rm -f php*.tar (remove php tar file)

  • In view of the security issues raised in the thread Very Weak Security you should remove group permissions for all the objects in the forum (or phpBB2) directory:

    username@shell1 username $ chmod -R g-rwx forum (or chmod -R g-rwx phpBB2 as appropriate)

    :idea: Doing this will prevent all other Force 9 customers with accounts on the cgi.force9.net machine being able to look at the files in the forum (phpBB2) directory, including the config.php file which holds your MySQL database details, including the password! The other Force 9 customers access your files by virtue of being in the same user group as you, so it is important to switch off read, write and execute permissions for group users (the g-rwx parameter in the command above).

  • You may also wish to turn on the "sticky bit" for the forum (or phpBB2 if you didn't change it) directory. Doing this means that even if someone has write permission to files in the directory, they will only be able to delete or rename files if they own them (ie if they're you):

    username@shell1 username $ chmod o+t forum (or chmod o+t phpBB2 as appropriate)

  • Now exit from telnet:

    username@shell1 username $ exit
    logout


    Connection to host lost.

    [/listShocked]

    You've now completed the installation work, and you should use your browser to access your forum, log on with the administrator user-ID you specified in the installation, and configure it for your purposes.
  • N/A

    Upgrading phpBB

    Well, having installed phpBB for the first time a few weeks ago, an upgraded version is now out, so the time has arrived to upgrade the product.

    Or has it?

    Experience shows it's not always a good idea to be too hasty to upgrade a product as soon as the next version comes out. "Upgrade in haste, repent at leisure" you might say. It's good to be on an up-to-date version of the product, but not to be so up-to-date that you're encountering all the bugs and problems that no one else has found yet. I know of companies that will not even consider an upgrade to MS Windows, for example, until at least the first service pack has been released. In the case of phpBB, you're running it to provide a message board service, not a debugging service, right? The present upgrade is not even a major release, being a point upgrade from 2.0.5 to 2.0.6, so you may be even more reluctant than ever to consider upgrading. But what may tip the balance is that some of the changes are for security, so that could be the end of the debate.

    Having decided you do want to upgrade, here's a procedure to guide you. As in the earlier installation guide I posted, I've written your input in blue and the machine's responses (either from your own PC or from a Force9 host) in brown. I'm using an extra convention, though: where text appears in cyan rather than blue, it means you do not type exactly what has been shown but need to change it to suit your circumstances. Three examples are your username, passwords and the directory in which you installed your forum ("phpBB2" by default, although we changed it to "forum" in the earlier installation guide). The directory name is not simply the name of the directory into which phpBB has been installed: phpBB also stores the name in the MySQL database (via the phpBB Administrator's configuration options -- see below), so you can't simply change this directory once you've set up phpBB and expect everything to still work. (You'd have to also change the settings in the Configuration screen, or simply zap the entry in the database, which amounts to the same thing.)

    Our first problem is to decide which package to download. phpBB gives us three choices, with two formats (zip and gzip) for each choice. For a Linux host (the Force9 cgi machine) the gzip format is the obvious one, so we now have to decide between the "full package", the "changed files only" or the "patch files". Turns out the patch files are essentially for people who have made major changes to their phpBB software. Here's another general principle: keep your software products as "vanilla" as possible -- only make changes to code if you absolutely have to, and that way upgrades can be relatively straightforward. So, the patch file probably isn't what you want. Also, it turns out that the "changed files only" contains changed files from lots of previous versions, so it's actually much larger than the "full package". I decided the "full package" was going to provide the easiest upgrade for me.

    So here's the process. This is for an upgrade, remember -- if you have not installed the product previously, the installation procedure posted a few weeks ago should be followed.
    [list=1]
  • Since you're going to be installing on a Linux machine, my advice is to download the gzip version of the "Full Package" from http://www.phpbb.com/downloads.php. Store it on your home PC in the place where you keep all downloaded phpBB material.

  • Bring up a command prompt, change to the directory containing the downloaded phpBB file, and FTP it to the cgi.force9.net machine:

    drive:\dir>ftp cgi.force9.net
    Connected to cgi.force9.net.
    220 ProFTPD 1.2.6 Server (CGI Server) [shell1.cgi.force9.net]
    User (cgi.force9.netSadnone)):
    username
    331 Password required for <username>.
    Password:
    password
    230 User <username> logged in.
    ftp>
    bin
    200 Type set to I.
    ftp>
    prompt
    Interactive mode Off .
    ftp>
    mput php*6* (makes sure you only transfer the 2.0.6 package if the 2.0.5 package is also on your local machine!)
    200 PORT command successful
    150 Opening BINARY mode data connection for phpBB-2.0.6.tar.gz
    226 Transfer complete.
    ftp: 544080 bytes sent in 0.20Seconds 2680.20Kbytes/sec.
    ftp>


  • Your gzip phpBB package is now up on the CGI machine. While we have an FTP connection open, let's save a copy of the all-important "config.php" file which is in the forum directory; so we're getting it from the cgi machine and storing it on our home PC, in the same directory as the gzip file we downloaded from phpBB. And then we quit out of FTP. "config.php" is an ascii file.

    ftp> ascii
    200 Type set to A.
    ftp>
    cd forum
    250 CWD command successful.
    ftp>
    get config.php
    200 PORT command successful
    150 Opening ASCII mode data connection for config.php (271 bytes)
    226 Transfer complete.
    ftp: 271 bytes received in 0.00Seconds 271000.00Kbytes/sec.
    ftp>
    quit
    221 Goodbye.

    drive:\dir>
    (back to the Windows command prompt)

  • Take backups!

    At the moment we haven't done anything drastic -- we haven't actually started the upgrade itself -- we've simply got our materials together and put them in place ready to start the work. Before we do start the upgrade itself, we need to disable the forum, so users aren't signed in while we're hacking it from underneath them(!), and we need to back up the existing system, so we can restore it should something go wrong.

    To disable the forum, use your browser to access cgi.username.force9.co.uk/forum, sign in as an administrator and go to the General Admin -> Configuration screen. Select "Yes" for the "Disable board" option, and press the "Submit" button at the bottom of the screen. (Incidentally, a few lines above the "Disable board" option is the "Script path" which is where the forum directory is configured, shown as "/forum/")

    While signed in as an Administrator, perform a backup of the database by selecting General Admin -> Backup Database from the left hand column and completing the options which then appear. (My understanding is the 2.0.5 -> 2.0.6 upgrade makes no database changes, so you could omit this step, but it's good form anyway! Also, old lags will immediately object to using a tool within the component being upgraded to backup the product; if you want to be ultra-safe, don't rely on phpBB facilities for backing-up your database.)

    The phpBB people also recommend that you revert to the "subSilver" style (template + theme) prior to commencing the upgrade -- their way of saying "Be vanilla", I suppose! You can do this from the Styles Admin menu.

  • The final backup is of the phpBB code itself, in our forum directory on the cgi machine ("crofters"). Again, if you stayed "vanilla" there's not much there that's of great concern, other than the config.php file. To perform this (and much of the subsequent upgrade work itself) we need to log on to the machine using telnet:

    drive:\dir> telnet cgi.force9.net
    [Connecting]

    Linux 2.4.19-51um (shell1.cgi.force9.net) (<timestamp>)

    login:
    username
    Password: password
    Last login: <timestamp> from <username>.force9.co.uk
    username@shell1 username $


    First, we use "tar" to create an archive of our present forum directory's contents (the command shown creates the archive and gzips it in one fell swoop):

    username@shell1 username $ tar cvzf phpBackup.tar.gz forum

    The backup file (phpBackup.tar.gz -- change this name to suit your purposes) can be FTP'd back to your local machine later, if desired, or simply deleted if the upgrade is successful.

  • Still logged on through telnet, we'll save a local copy of the config.php file, which we will need later (the same file as we FTP'd to the local machine earlier, as an extra safeguard):

    username@shell1 username $ cp forum/config.php . (note: a space then a dot at the end of the line)

  • Crunch time has now arrived: start the upgrade process.

    Remove the existing forum directory and all its contents:

    username@shell1 username $ rm -rf forum

  • Unzip and decompress the phpBB-2.0.6.tar.gz file which we put here earlier:

    username@shell1 username $ tar xvzf phpBB-2.0.6.tar.gz

    A new directory, phpBB2 will be created, containing the phpBB system.

  • Rename this directory to the name used by your forum:

    username@shell1 username $ mv phpBB2 forum

  • Copy the saved config.php file into the directory:

    username@shell1 username $ cp -f config.php forum (the -f option forces overwriting of the default config.php already in the forum directory)

  • For security reasons, remove all read, write and execute permissions at the group level:

    username@shell1 username $ chmod -R g-rwx forum

  • Now from your local machine point your browser to cgi.username.force9.co.uk/forum/install/update_to_206.php

    You should see a phpBB "Updating to latest stable release" screen, which when complete should report "No errors" and advise you to go to the Administration panels to check the general Configuration of the board. A link is provided to do this.

    While there, set the "Disable board" option back to "No".

  • Before normal use can be made of the board, however, two subdirectories need to be removed from your forum directory. To do this we go back to the telnet session:

    username@shell1 username $ cd forum
    username@shell1 <forum> $ rm -rf install
    username@shell1 <forum> $ rm -rf contrib

  • Once you're happy the board is working poperly, you can tidy-up by removing backup files on the cgi machine. It's probably safest to do this after saving a copy on your home machine! There's the archive file and the copy of the config.php file (do NOT delete the one in the forum directory!)

    username@shell1 <forum> $ cd /home/username
    username@shell1 username $ pwd (check we're in the correct directory)
    /home/<username>
    username@shell1 username $
    rm -f config.php
    username@shell1 username $ rm -f phpBackup.tar.gz

  • Finally, exit from telnet:

    username@shell1 username $ exit
    logout


    Connection to host lost.

    drive:\dir>
    (back to the Windows command prompt)
    [/listShocked]

    I don't think that's too daunting!

    Addendum: At home, I use PostgreSQL rather than MySQL. After doing this upgrade, I found I could no longer post messages, getting an error message referring to an "INSERT IGNORE INTO" sql statement on the search_wordmatch table. Turns out most DBMSs do not have an INSERT IGNORE INTO statement (although MySQL has, so it works OK). The workaround posted on the phpBB forum is to edit the code and remove "IGNORE" making it an "INSERT INTO" statement. The statement occurs on line 243 of the includes/functions_search.php file. [What did I say about waiting for other people to find the bugs -- well, I suppose they had, already, but I like to pick up code that's had them corrected :roll:]
  • N/A

    ???

    I would first like to thank you for providing this guide which obviously took some time to type.

    I am having a problem however and wondered if you could help me...

    when I do the ftp cgi.force9.net thing in the command prompt it says

    Quote
    connected to cgi.force9.net.
    connection closed by the remote host.


    I can however connect to hompages.force9.net.

    If it makes any difference (which I doubt it will) I am not on my F9 machine but on a BT openworld 56k machine.

    Thanks in advance for any help.

    -Lozboz
    N/A

    What's the difference between CGI and MySQL?

    Hi,

    I thought the telnet/ftp address of the cgi server was crofters.force9.net. As far as I know you only use the cgi subdomain (as in cgi.<username>.force9.co.uk) when you're trying to access your cgi space via http (i.e. in a browser).

    I can't check this at the moment because I'm at work and you can only connect to the cgi server from your force9 connection but it's worth a try doing


    ftp crofters.force9.net


    Jon.
    Ianwild
    Grafter
    Posts: 3,835
    Registered: 05-04-2007

    What's the difference between CGI and MySQL?

    Hi,

    cgi.force9.net does work fine, however this is the error you might get if you are not conncted to our network at the time you make the connection. Shell and FTP access to the CGI server are not permitted from external connections for security reasons.

    Regards,
    N/A

    What's the difference between CGI and MySQL?

    Yes, I suppose saying "I can't connect because I'm not on the F9 network at the moment" but not asking "are you on the F9 network when you're trying to connect" was a bit shortsighted Shockedops:

    I get "Unknown error" trying to connect via ftp and "Could not open connection to the host, on port 23: Connect failed" via telnet. While this isn't very interesting information it might help someone who's searching the forum after failed connection attempts in the future Smiley

    Jon.
    N/A

    What's the difference between CGI and MySQL?

    Hi there

    I have try instuction above of Task Info

    see this

    ftp cgi.force9.net
    Connected to cgi.force9.net.
    220 ProFTPD 1.2.6 Server (CGI Server) [shell1.cgi.force9.net]
    User (cgi.force9.netSadnone)): <your user-ID>
    331 Password required for <your user-ID>.
    Password: <your password for the cgi machine>
    230 User <your user-ID> logged in.
    ftp> bin
    200 Type set to I.
    ftp> prompt
    Interactive mode Off .
    ftp> mput php*
    php*:File not found
    ftp>quit
    221 Goodbye.

    i've put phpbb2 folder in htdocs folder from CuteFTP Software
    something say about outside cgi ? i dont getting this

    and other said i have to put upload to cgi webspace im confuse here

    i try everything upload on CuteFTP

    i need someone say clear to how put upload of phpbb2 folder (done phpbb2 unzip folder)

    Then i will doing on command prompt as above Task Info i need one thing how can i put phpbb2 folder put to where !!!

    if no CuteFTP then use command prompt or go to CGI WebSpace or ?

    Thanks
    N/A

    What's the difference between CGI and MySQL?

    Quote
    i've put phpbb2 folder in htdocs folder from CuteFTP Software


    You need to place the phpBB2 software on the Force9 host machine known as crofters (and also known as cgi). You can use the fully-qualified names crofters.force9.net or cgi.force9.net in your FTP software to access this machine -- it does not matter which you use.

    Do not put the software on either the "homepages" machine or the "frontpage" machine!

    Quote
    something say about outside cgi ? i dont getting this

    and other said i have to put upload to cgi webspace im confuse here


    The reason for your confusion, I think, is that there is a directory on the cgi machine (crofters) called cgi-bin. You must not put the phpBB2 package in the cgi-bin directory. It must be on the cgi machine, but not in the cgi-bin directory of that machine! Since the cgi machine is also known as "crofters", I'll use that name for it, to save any further confusion.

    From what you've written it sounds like you've downloaded the "zip" package from www.phpbb.com and have unzipped it on your local machine. This is fine. You now need to use CuteFTP to ftp the entire unzipped package to the crofters.force9.net machine, putting it in your top level directory there. Once you've done that, you should have two directories at the same level, phpBB2 and cgi-bin.

    Once you've got the unzipped phpBB2 package on the crofters machine, you can jump to step 6 of the installation instructions posted earlier (the bit where you use the web browser).
    N/A

    What's the difference between CGI and MySQL?

    its really worked on this Forum on my site Excellent u did it Cheesy i am happy bunny here

    Thank you Task for this Clear Help

    erm one more question

    ive this domain name from force9 e.g http://www.domainname.co.uk

    i try input http://cgi.domainname.co.uk/phpbb2/
    that's wont working :shock:

    but its worked fine with http://cgi.username.force9.co.uk/phpbb2/
    its show completed forum site.

    i really need domain name on it

    there r both the same site as http://www.username.force9.co.uk and http://www.domainname.co.uk at same htdocs Files

    any chance can put the place to domainname for forum ?

    Thanks Task for all ur help

    Rob
    N/A

    What's the difference between CGI and MySQL?

    I'm really pleased you've got it working! Well done!

    Quote
    ive this domain name from force9 e.g http://www.domainname.co.uk

    i try input http://cgi.domainname.co.uk/phpbb2/
    that's wont working :shock:


    I think someone else raised this a couple of weeks ago. As far as I'm aware, Force9 makes no association between additional domain names you may have and the crofters machine, so -- as you point out -- this does not work.

    One way round this might be to use HTML using frames. A common layout is three frames:
    • A horizontal frame extending all the way across the top of the screen. This is normally used for the site name, company name, or whatever, and remain on-screen, unchanged, all the time.

    • A vertical frame down the left hand side of the screen, providing a "Contents" with links to the various things in the site. (The "Contents frame")

    • The principal frame, to the right of the "Contents" frame. By clicking on a link in the "Contents frame" what is displayed in this frame changes accordingly.
    The effect of this would be similar to the very layout used here now on Force9's site! (although I don't think Force9 uses frames to achieve it).

    With this arrangement, your www.domainname.co.uk site could have a link in its "Contents frame" which simply says something like "Domainname Forum" but linked to "cgi.username.force9.co.uk/phpbb2" with "target" specifying the right-hand frame. This will result in the forum being displayed in that frame, without the user being aware that it's come from a "different site". Similarly, when the use has finished doing his forum stuff, he simply uses one of the links on your "Contents frame" which seemlessly takes him back to "domainname", again, without him being aware this is happening.
    Community Veteran
    Posts: 6,111
    Thanks: 1
    Registered: 05-04-2007

    What's the difference between CGI and MySQL?

    An alternative would be to move the whole site to the CGI server (F9 don't mind this), and point your domain name there.

    Thomas
    N/A

    What's the difference between CGI and MySQL?

    Quote
    An alternative would be to move the whole site to the CGI server (F9 don't mind this), and point your domain name there.

    How does someone exercise that option? Is it a "Contact us" job? -- as far as I'm aware, the "Domain names" tool expects the web server host to be the homepages machine and only allows you to change the directory within your allocated space on that machine.
    Community Veteran
    Posts: 6,111
    Thanks: 1
    Registered: 05-04-2007

    What's the difference between CGI and MySQL?

    You have to set your own DNS records to accomplish this, but it can be done. Smiley

    Thomas