Installation Wiki

XOOPS

From InstallationWiki

Jump to: navigation, search

litroc

XOOPS
Official Page
Project Documentation
Download
Source Book
Building Websites with XOOPS: A step-by-step tutorial
Building Websites with XOOPS: A step-by-step tutorial
ISBN 978-1-904811-28-2
Publisher Packt Publishing
Author(s) Steve Atwal

Every software program requires installation, and XOOPS is no different. We will cover what is required before you can install XOOPS for both a local and hosted installation, and then show you how to set up a fully functional website with a default XOOPS configuration. To install XOOPS, you need four components:

  • Apache, the web server that will serve the HTML and PHP web pages
  • PHP, the programming language that XOOPS requires
  • MySQL, a SQL database to store the XOOPS data, user IDs, passwords, etc.
  • XOOPS, a suite of programs/web framework written in PHP that we shall use to build and manage our website

Contents

[edit] Creating the Local Development Environment

You may want to play with XOOPS or test new functionality on your own PC before installing or updating your live website. To accomplish this, you need to know what software is required on your PC to get XOOPS up and running successfully.

If you are running Windows on your PC, like most people, then you should install XAMPP Lite, which will ensure that you have the required software before you attempt to install XOOPS. XAMPP Lite and the full XAMPP are used by many developers who wish to run web-based applications based on the popular PHP programming language. In fact, schools use this software when teaching PHP and Apache courses.

Before installing XAMPP Lite, make sure that you are logged into Windows with the administrator user ID or a user ID that has administrator privileges. If you don't know how to set these, look at the Windows Help.

If you are using Windows, then you can download XAMPP Lite for Windows from http://www.apachefriends.org.

In order to use all the features of XAMPP Lite, make sure that you either disable your Windows firewall or enable the following ports inside it; otherwise, the applications such as Apache and MySQL will not work:

  • Port 80 for HTTP
  • Port 443 for HTTPS (SSL)
  • Port 3306 for MySQL

Although not required, enable the following ports if you intend to use the full version of XAMPP:

  • Port 21 for FTP
  • Port 25 for SMTP
  • Port 110 for POP3
  • Port 143 for IMAP
  • Port 8009 for AJP/1.3
  • Port 8080 for HTTP-ALT (Tomcat default port)

XAMPP Lite, which includes the following software, will install all the components you need for XOOPS:

  • MySQL
  • PHP
  • Apache
  • PhpMyAdmin (to manage MySQL)
  • OpenSSL, SQLite, eAccelerator (you may not need these but they are included)

Just extract the XAMPP Lite files, and run the setup_xampp.bat file to configure XAMPP Lite for use. Then run apache_start.bat and mysql_start.bat to get both Apache and MySQL operational. If you close the command windows that pop up, it will shutdown Apache and MySQL. So, just minimize them to keep them out of the way. XAMPP Lite makes no permanent changes to your computer and can be uninstalled easily by removing the XAMPP Lite folder.

To test to see if everything you need for XOOPS is operational, you need to see if Apache, PHP, and MySQL are operational. Just open your favorite web browser such as Mozilla Firefox and go to one of the following URLs: http://localhost or http://127.0.0.1.

If all is well, you should see the XAMPP for Windows welcome message, which may be in German! So click on the link for English under Languages on the left-hand side of the page. Click on the Status link on the top left and you will get another page that indicates the status of MySQL, PHP, HTTPS, and CGI.

Read the readme_en.txt file that came with XAMPP to get the user ID and password for MySQL; at the time of writing, the administrator user ID was root and the password was blank: not the type of insecure setup you would have for a live website. Use the phpMyAdmin link in the Tools section of the left navigation bar at http://localhost to create a new MySQL database for use by XOOPS. You will need this for the web-based installation of XOOPS.

To get more detailed information about the installed version of PHP, you can click on the phpinfo() link in the left navigation bar. However, just to show that PHP is now working fully within Apache on your test computer, let's create a file called phpinfo.php with the following PHP code in it and save it into the \xampplite\htdocs folder on your PC where you extracted the XAMPP Lite files:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

Then, open your web browser and go to the following URL:

http://localhost/xampp/phpinfo.php

You should see a web page similar to the following, which means that you are ready to move on to the next step:

Once you have Apache, PHP, and MySQL operational, all you have to do to start installing XOOPS is download the latest stable release of the XOOPS software from www.xoops.org, extract the contents of the htdocs folder inside the XOOPS.zip file into a folder within \xampplite\htdocs on your PC, such as \xampplite\htdocs\mysite, and then navigate to http://localhost/mysite to continue the web-based installation of XOOPS. The web-based installation of XOOPS from this point onwards is exactly the same for a local installation as when you are using an outside third-party web-host provider.

[edit] Creating a Development Environment on Linux

If you have Linux installed on your PC, then getting Apache, PHP, and MySQL is easy. You may already have these installed, but if not, then use the appropriate package manager for your version of Linux to install the missing software. Most likely, you will need to use either RPM or DEB packages. My favorite versions of Linux are Ubuntu and SUSE; installation of new packages in Ubuntu can be done easily in the console window using the following command:

apt-get install <package name>

For example:

apt-get install mysql

The downloading procedure for XOOPS is the same for both Windows and Linux. Since the web-based installation of XOOPS from this point onwards is exactly the same for a local installation as when you are using an outside third-party web-host provider, let us set up the requirements for the hosted live website before we show you how to use the web‑based installation of XOOPS.

[edit] Preparing the Hosted Server for your Live Site

In order to make your website available to others on the Internet, you will need to either make your local installation of XOOPS accessible from outside your home network, or like most people, who have a website that must be operational all the time, sign up with a web-host provider and then install XOOPS on one of its servers. In this section, we will discuss what is required to prepare this outside web-host server before you can install XOOPS.

When you are ready to set up your live website, you will need to do a few things first:

  • Register a domain name, e.g. www.steveatwal.com. This can be done either separately by paying for web-hosting or, as is recommended, by letting your web‑hosting company take care of this for ease of future management and renewal. In fact, many web‑hosting companies now include the cost of registering a domain name when you start a web‑hosting plan. This leaves you with practically no reason for paying for it separately.
  • Find and pay for web-hosting. You can find many web-hosting companies listed at web-hosting review sites such as http://www.hostreview.com/. Just search for web-host reviews on www.google.com to find many more. Note that many web-hosting companies allow you to register your domain name or transfer it from another company for free. Web-hosting is very cheap starting at less than $7 US per month for 10 GB and more of space and lots of bandwidth (amount of data that can be transferred from the web-host to people who access your website). Bandwidth (or traffic) becomes very important if your website becomes popular or you plan to put a lot of audio or video content on your website. In addition, web-hosting companies are including the cost of registering a new domain name when you sign up for a year or more web-hosting plan. You need to shop around for the best deal. Some companies even give you SSH command-line access to their server, in case FTP is not sufficient to install a particular application.
  • Write down the user ID and password you received from your web‑hosting company. You will need these to transfer the XOOPS files onto its servers as well as creating a MySQL database and user ID for XOOPS.

Usually, when you sign up with a web-host, you get access to a web-based control panel such as cPanel that lets you configure Apache, MySQL, and the PHP parameters, as well as additional features such as creating sub-domains. For example, games.steveatwal.com is a sub-domain of www.steveatwal.com and both can have a fully functional XOOPS website independent of each other. This is what the control panel of your website would look like:

If you plan to install XOOPS onto a server managed by a web-hosting company, you will need a few tools. Listed below are my favorites for each type of tool you need:

  • Winzip or the free ZipGenius. You can also use the built-in Windows Explorer unpacking feature, i.e. right-mouse click on a file and select open and then drag and drop files outside of the ZIP archive. However, use Winzip or ZipGenius for a full-featured un-archiving program that also handles files archived in Linux.
  • Filezilla for FTP.
  • Notepad++, a programmer's editor.
  • Putty, a free Telnet/SSH client. You need this only if you have SSH command‑level access to the web-host servers, and plan to install anything that cannot be installed using FTP. Usually, you will not need this.

You will need to create a MySQL database and a MySQL user ID that will be used by XOOPS to store information into this database.

To create a database, go to the control panel for your web-host account. You need to learn how to use this control panel; one web-host may have a different control panel than another, but they all basically work in the same fashion and most likely will use phpMyAdmin to manage your MySQL database. Following is the MySQL section of the cPanel control panel used by BlueHost:

As you can see, it is quite intuitive. So you can easily create the required MySQL database and user ID to log into that database. Following are the steps needed to create a MySQL database using the cPanel for www.bluehost.com:

1. Log into the cPanel.

2. Click the icon for MySQL.

3. Create a user for your database (keep it short). This is the dbusername, which you will be using later.

4. Create a database (keep it short).

5. An important step is to click the Add User button; otherwise, the user ID will not be able to connect to this new MySQL database, and the installation of XOOPS will fail.

The format for the MySQL user name will be <yourwebusername>_<dbusername>, where <yourwebusername> is the user ID your web-host provider assigned to you to log into its website and the control panel shown previously. The <dbusername> is the user created for your database above.

The format of the MySQL database name will be <yourwebusername>_<dbname>, where <dbname> is the name of your MySQL database. Your host address will be localhost. For example, if you use the following names:

dbusername: billyjean
password: password
dbname: DB1

and your login user name for the web-hosting company (<yourwebusername>) is jimmydea (which is sometimes the first 8 characters of your domain name), then you will use the following information in the web-based installation of XOOPS:

Hostname: localhost
DBUser: jimmydea_billyjean
Password: password
DBName: jimmydea_DB1

Make sure to write this information down in a safe place. You can also use the default user ID and password that your web-host provider gave you to create a new MySQL database during the web-based installation of XOOPS.

[edit] Installing XOOPS

Download the latest stable release from the XOOPS downloads page to your local computer. We will use XOOPS 2.0.15, since that was the latest stable release available for download at the time of writing this article. Uncompress the XOOPS.zip file to a folder on your computer, as shown below:

I like to use Windows Explorer to create a folder called C:\Download into which I extract all files downloaded from the Internet. The only folder you need is the htdocs folder; other folders are not needed for a new installation of XOOPS, so you can ignore those.

For a local installation of XOOPS, simply copy the contents of the htdocs folder into a new folder inside the \xampplite\htdocs folder. This is useful if you decide to test multiple installations of XOOPS, each with a separate website. Thus, you may be testing the following websites, which are all running a copy of XOOPS independent of each other:

  • \xampplite\htdocs\website1
  • \xampplite\htdocs\website2
  • \xampplite\htdocs\website3

For a hosted installation of XOOPS, start up Filezilla, log into the server with your web‑host provider, and then copy the contents of the html folder into either the root of the public_html folder on the web-host server or a folder within that (if you plan to run multiple websites).

Upload the XOOPS files to the root of your website (the public_html folder) to have XOOPS launched as soon as someone visits your website.

After you upload all the files and folders in the html folder to your web server root folder, you are ready to start the web-based installation of XOOPS.

Start up your favorite web browser, such as Mozilla Firefox or Internet Explorer, and go to your website. For a local installation, simply enter http://localhost into your web browser; for a hosted installation, enter the name of your website such as <yourwebsite>.com http://www.<yourwebsite>.com. The rest of the installation process will be fairly simple, but may require updating file and folder permissions on your web-host server.

Click Next to use the default english language for XOOPS. This will take you to the XOOPS welcome screen, which provides some useful information about permissions required for a proper setup.

Click Next, if you have set the file permissions correctly. If you have not set the file permissions, you can do so using Filezilla, as follows:

  • Log into your website using Filezilla.
  • Right-click the mouse on the folder uploads, located inside the public_html folder, and select File Attributes. Select all the permissions, as follows:
  • Repeat this for the other folders cache, templates_c.
  • Set the file permissions for mainfile.php to the equivalent of Linux chmod 666, i.e. assign read and write permissions for everyone, as follows:

The next screen of the XOOPS installation will verify if the file permissions are set correctly.

If all is well, you should see a message indicating No errors detected. You can then click Next to enter the MySQL database information required by XOOPS to function properly.

The preceding screenshot shows the general configuration settings for a web-hosted installation. Note that the table prefix is randomly generated to provide extra security.

For a local installation, the fields will be different. The following is an example of the values used by XAMPP, which assigns a blank or empty password for the root (administrative user) for MySQL. Normally, for a web-hosted installation of XOOPS, you would assign a non-blank value for the MySQL root user.

Database Username: root
Database Password: <blank>
Database Name: jimmydea_DB1
XOOPS Physical Path: C:/Download/xampplite/htdocs/mywebsite
XOOPS Virtual Path (URL): http://localhost/mywebsite

Click Next and you will have the chance to check your settings. Click Next again to save the configuration information. You will see the following screen for a local installation:

If everything was entered correctly for the database, you should get a message indicating Configuration data has been saved successfully to mainfile.php. Click Next to go to the next step of the installation.

Click Next to confirm the database settings.

Click Next to check if the database exists.

For a local installation, you may want the web-based installation wizard to create the MySQL database for you, as in the preceding example. Thus, you will see a message such as Attempt to create it?. Click Next to allow XOOPS to create the database. For a web-hosted installation, this process may fail due to the fact that the database user has to be assigned permissions to the database first. It is the best practice to manually create the MySQL database first before running the XOOPS installation wizard.

In the preceding screen, XOOPS indicates that the MySQL database was created successfully. Click Next to check the database. The following screen indicates that XOOPS was able to connect to the MySQL database.

Click Next to create the database tables that XOOPS needs to function appropriately.

If all is well, you will get a message indicating Database tables created. Click Next to create the administrator user ID and password that you will use to manage XOOPS using the Internet.

Enter your name or nickname as a user ID, email address, and password for the administrator user ID you want to create. Don't lose this information or you may not be able to log into your XOOPS website to manage it or make any changes to it. Click Next once you have decided what you want for these values.

XOOPS will populate the database tables with default values and install the module required to allow you to administer XOOPS via the web. Click Next to finish the installation.

Note that after installation, you can install any number of additional modules you may need.

Well done! If you got this far then XOOPS has now been successfully installed. All you have to do now is clean up, which ensures that a key file used for proper operation of XOOPS is never updated accidentally and removes the installed files. To accomplish this:

1. Use Filezilla to log into your web-host and go to the public_html folder.

2. Right-click the mouse on the mainfile.php file and select File Attributes.

3. Uncheck all the Write and Execute permissions. This sets the permissions to Read Only for everyone, which is equivalent to the Linux command of chmod 444. This ensures that the file is never updated accidentally, which may cause problems for the operation of the XOOPS software.

4. In addition, remove the install folder. If you don't, you will get a warning to do so when you log into XOOPS to administer it.

To see what your new website looks like with XOOPS installed on it, open your web browser and go to either http://localhost or http://www.yourdomain.com. It will look something like this:

[edit] Summary

We have covered a lot of ground in this tutorial. We have shown you how to set up your local development environment, and shown you what you need to do before you install XOOPS on your live, public-facing, website. And finally, we have shown you how to set up XOOPS.

[edit] Additional Refrences

For instructions on creating themes with XOOPS, click here

[edit] Source

The source of this content is Chapter 2: Installing XOOPS of Building Websites with XOOPS by Steve Atwal (Packt Publishing, 2007).