Build A Low-Cost Web Community Server, Part 1
In this recipe, we will configure a basic Linux, Apache, MySQL, and PHP (LAMP) platform machine, and then install a discussion forum. These forums can be used for both internal employee collaboration and discussions with clients, as well as to encourage collaboration between customers as a secondary means of support and community relations.
This is the first part of a two-part Recipe. In Part Two, I will show you how to add a content portal to the server.
Ingredients
While you can't put a price on good community relations, the material cost of a community portal is quite low indeed. Here's all it takes:
id
unit-1659132512259
type
Sponsored post
- Any Old Server: For most community environments, a Pentium III class machine with one modest 7200-RPM hard drive should do. In fact, for this Recipe I used an aging 400-MHz Gateway Solo 2150 laptop with an old 3Com 589EC PCMCIA Ethernet card, just 160 MB of RAM, and 4 GB of hard-disk space. Obviously, if your client needs an enterprise server that can handle tens of thousands of unique users, then you'll need a more potent machine. However, because we will be using Linux, avoiding the absolute bleeding-edge hardware is usually a good idea. We want to avoid devices that are not yet supported by Linux drivers.
- A networked PC, with browser (optional). Having a second machine on the same LAN with the server will help when it's time to debug the configuration. In this recipe, we will use it to remotely configure and test the forum. All this PC needs is a browser; Internet Explorer 6 or a recent Mozilla or Firefox build will do fine.
- Operating system: Linux is very desirable for such a server. One interesting, off-the-beaten-path choice is Ubuntu Linux, named after an old African word for "humanity to others." Based on the time-tested Debian distribution of Linux, Ubuntu comes with an appealing amount of prebuilt software. It can be downloaded on a single CD. And it has a fast, easy-to-use package manager for obtaining crucial server-software and OS updates.
- Forum software: While there are several perfectly valid choices in forum software out there, the up-and-coming Simple Machines forum has much to recommend. For one, it's free. Also, the forum is easy to install and configure. Finally, it has a user-friendly administration interface, meaning your client's community manager won't need to know or care about server scripting before they can manage the site.
- 25 Steps To Building a Forum Server
- Now that you have the basic hardware and software components ready, it's time to start building.
- 1. If you're using a new hardware system, build the server hardware. Be sure the BIOS is set to allow booting from CD-ROM.
- 2. Obtain the OS. If you're using Ubuntu Linux, install the CD from one of the servers listed at www.ubuntulinux.org/download. Version 4.1, the newest at the time of this writing, is distributed in a burnable ISO image called warty-release-install-i386.iso. Open this ISO file in the CD burning program of your choice, then create the boot CD.
- 3. Insert the Ubuntu Linux CD in the server machine and power up the machine. Ubuntu will go through a process of hardware detection, then prompt you to supply your region, language, and an internal machine name. Call the machine "community" unless the client has other ideas.
- 4. Accept the hard-drive partitioning defaults suggested by Ubuntu. The OS image will install, then prompt you to reboot. Be sure to remove the install CD before proceeding. Linux will boot, prompt you to configure the time zone, and then request a user name and password for the default administrator.
- Note: In Ubuntu Linux, the true root user is actually disabled by default to discourage hacking. But the first configured user has most common administrative access. For this recipe I configured a username "intranet," with the password "intranet."
- 5. Ensure that all major patches and security fixes are deployed. Start by letting Ubuntu finish installing by downloading additional software from the Internet. Depending on the number of fixes available for your current version, and the speed of the connection and machine, this process can take anywhere from a few minutes to more than an hour. Ubuntu will then be ready to load. So next, input the username and password as configured in the setup to reach the desktop.
- 6. To use the package manager, you must first do some housekeeping tasks in a shell window. Click Applications/System Tools/Terminal for a command prompt, and enter ifconfig. Make a note of the IP address provided by the DHCP server. (If the client site offers an internal domain name service, you can skip this step, as the name of the server will simply be community.clientdomain.com.)
- 7. While still in the terminal, edit the package manager's configuration file so it shows the entire universe of available programs, not just the Ubuntu-approved list. To do so, enter this command: sudo nano /etc/apt/sources.list (sudo allows you root-level access for one command. You will be asked for your regular user password). Next, remove the # comment markers in front of deb http://archive.ubuntu.com/ubuntu warty universe and deb-src http://archive.ubuntu.com/ubuntu warty universe. Then press CTRL-X to exit the editor. This expands the range of packages you can automatically install, including a PHP/MySQL component you'll need later.
- 8. It's time to install the server software. Select Computer/System Configuration/Synaptic Package Manager from the menu taskbar at the top of the screen. You will be prompted again for the user password. Browse to Sections/World Wide Web and look for "apache2." Click the box on the left side of the entry, then select Mark For Installation. Click the green Apply arrow to install Apache. The Synaptic Package Manager will obtain the files from the Ubuntu repository and automatically install them. Wait for "Successfully applied all changes. You can close the window now." Then close the window.
- The Synaptic Package Manager, shown below, helps to automatically install thousands of software packages in Ubuntu Linux. The package manager, shown below, highlights dependencies that must be installed or updated to support the requested software.
- To view this picture click here.
- 9. Using the Package Manager's search tool and the same procedure outlined above, install these packages: libapache2-mod-php4, php4-cgi, mysql-server, and php4-mysql.
- 10. When all four packages are completely installed, you may wish to reboot the machine. Or you can simply restart the Apache server by opening a terminal window and entering: sudo invoke-rc.d apache2 restart
- 11. Browse to your main user's home directory by clicking Computer/Home. Then create a new directory -- public_html -- with File/Create Folder. Right-click the public_html directory, and select the Permissions tab. Ensure they are set to 755, which is a standard permission set for Web-accessible files. This ensures world read and execute permissions while reserving write changes to the owner or administrator.
- 12. Return to the terminal prompt to create the MySQL database for your forum. Next, assign a password to the root user's access of MySQL. Enter: mysqladmin u root password (new password). For instance, to assign the password "data" to root, you would use: mysqladmin %96u root password data
- 13. While still in the terminal prompt, run this command: sudo mysql %96p
- You will be asked for two passwords. The first is the Ubuntu user password ("intranet" in our example). The second is the MySQL password ("data" in our example). This brings you to the MySQL command interface.
- We will create a new database for Simple Machines and create a dummy username and password for database access.
- Enter these two commands in the MySQL interface, remembering the semicolons, which indicate end-of-line: create database smf_forum; and grant all privileges on smf_forum.* to smf_user@"localhost" identified by 'password';
- MySQL will allow logins from a user named "smf_forum" with password "password" to perform any database action. This user doesn't exist as far as Linux is concerned, but our forum can log into the database with those credentials.
- 14. Obtain the Simple Machines forum from its download page. Save the smf_1-0-rc2_install.tar.gz package in your home directory. Using the file manager, double-click the archive and extract it to a new directory, public_html/forum.
- The Simple Machines Forum software, shown below, is a free download.
- To view this picture click here.
- 15. In the file manager, right-click the new "forum" directory. Then select the Permissions tab. Ensure it is set to 755, which will probably require checking "execute" in the "others" section.
- 16. It's time to make some files and directories completely open-access. This is needed for the forum to install and operate properly. The rest of the permissions can be set quickly at the command line. In the terminal, enter: cd /public_html/forum
- Then issue the following series of commands: chmod R 777 (directory) with this list of directories:
- attachments
- avatars
- Packages
- Packages/installed.list
- Packages/server.list
- Smileys
- Themes
- Issue chmod 777 (filename) with this list of files:
- agreement.txt
- Settings.php
- Settings_bak.php
- install.php
- 17. Launch the forum install. Do this step on a separate machine, so that you know the Web server is properly configured to communicate with outside machines. Point a browser at the install.php file in the forum directory. A configuration screen should appear.
- This next image shows the first stage of the Web-based SMF installer.
- To view this picture click here.
- During the SMF install, shown below, you will configure the forum administrator account. This user has complete control over all aspects of forum operation.
- To view this picture click here.
- 18. While still in the SMF installer, fill out the blanks on this first screen. Change the Forum name as you see fit for the client's branding. The MySQL user name is "smf_user" and the database password is "password." The database name is "smf_forum." The other entries can be left at default. Click Proceed to continue.
- 19. On the next screen, set a forum administrator username and password, along with the contact e-mail that will be used for all official forum notices. Re-enter the database password. Click Finish.
- Once the final installation screen is cleared, you can access the brand-new community forum, as shown in the two screen-shots below.
- To view the first picture click here.
- To view the second picture click here.
- 20. Manually remove the public_html/forum/install.php file, as the auto-delete click will not work in our Apache configuration. Proceed to the URL to view the freshly minted forum.
- 21. Start customizing the forum. Click the Admin button in the forum interface. Enter the admin password; this is the password that belongs to the forum administrator, not any Linux user or database passwords. In the left-hand pane, click Edit Features and Options. For an internal forum, or simply a community with high membership standards, unselect "Allow guests to browse the forum." This means that unless a user is logged in to a valid account, they will only see a terse login screen, and they will have no access to posts or user information.
- The SMF administration panel, shown below, allows many of the features and look-and-feel options of the forum to be changed. This is the admin panel you will see after clicking the Admin button.
- To view this picture click here.
- 22. For a higher-security or selective community, set "Method of registration employed for new members" to Member Approval. This requires that administrators review and approve new account signups.
- 23. To customize the welcome message and terms of service that will be presented to all new signups, click Edit Registration Agreement. Simple Machines provides a basic, reasonably thorough, and common-sense set of regulations for new users. But consult your client for any special legal notices or customer greetings they may wish to include in their registration agreement. When you're finished, click Save.
- 24. Create a new discussion board by clicking Manage Boards. Click Add Board to bring up the appropriate screen. The Full Name is the official name of the new group. The optional Description tag -- displayed below the name -- may contain some HTML code, such as a link to a project homepage. To disallow certain membership groups (such as unregistered guests) from seeing the new board, click to disable them in the Allowed Groups section. If you wish to create a board for forum administrative and moderator staff only, disable all groups except Global Moderators. When you're finished, click Add Board.
- If administration approval is required for new accounts, a special link will appear when users are awaiting approval. Clicking the link brings up the account authorization screen. Both are shown in the next two screen shots.
- To view the first picture click here.
- To view the second picture click here.
- 25. To test adding a new user, log out of your administrator account, or use a different computer or browser. Then access the forum. Click the Register button to sign up; you will need to provide a username, password, and e-mail address. Then click the I Agree box under the user-registration text.
- Next, return to the Administrator's browser window and click Refresh. With registration approval required, "There is one member awaiting approval" will appear in the information box in the upper left-hand corner of the screen. Click "one member" to proceed to the registration management screen. Click the box to the right of the username, then click the "With Selected" dropdown. Choose "Approve and send e-mail." That user may now log in to the forum.
- There are literally hundreds of modifications and customizations a forum administrator can make to improve the navigation and unique branding of the site. But this guide will get you up and running with the basics of communication and collaboration.
- In Part 2 of this two-part Recipe, I show you how to add a content portal to the mix.
- JASON COMPTON is a technology writer who has covered topics ranging from 8-bit entertainment to supercomputing for more than a decade. He wishes to thank bob2 (Rob Weir) on #ubuntu for his assistance with this article.
- Discuss this Recipe with other system builders in TechBuilder's Recipe Forum.