Web Server Product

HostForFree Free Webhosting

Hostforfree is one the best free hosting company that offers quality support to all of their customer's despite to their type, free or paid. It has a great user interface that helps to set up your site more easily and quickly. They are popular as a free hosting service provider where you can host your site within 30 seconds. They are running a quality service and providing the same quality of service in both free and paid service. Their network will be up and running at least 99.9% of the time (excluding scheduled maintenance work).This product can help to increase the security of your site, it offers security and quality to their users, whereby mitigate security problem. Don't ignore them as they provide free service. Some of their services is better than paid hosting service. They remain updated with many themes and tools. They offer many different services in their free hosting plan. In a very small period of time, they became a well-known free hosting service provider.

HostForFree Free Webhosting Summary

Rating:

4.6 stars out of 11 votes

Contents: Webhosting
Price: $97.00

My HostForFree Free Webhosting Review

Highly Recommended

Maintaining your trust is number one. Therefore I try to provide as much reliable information as possible.

I personally recommend to buy this product. The quality is excellent and for this low price and 100% Money back guarantee, you have nothing to lose.

Download Now

Other Web Server Optimizations

There are a few other things that you can do to make your web server run more efficiently. Apache is the most common web server used with Drupal, and it can be tweaked to provide better performance. The following sections will suggest some approaches to try. This Apache module will let Drupal send out Expires HTTP headers, caching all static files in the user's browser for two weeks or until a newer version of a file exists. This goes for all images, CSS and JavaScript files, and other static files. The end result is reduced bandwidth and less traffic for the web server to negotiate. Drupal is preconfigured to work with mod_expires and will use it if it is available. The settings for mod_expires are found in Drupal's . htaccess file. Drupal ships with two .htaccess files one is at the Drupal root, and the other is automatically generated after you create your directory to store uploaded files and visit Administer File system to tell Drupal where the directory is. Any .htaccess files...

Separate Database Server and a Web Server Cluster

Multiple web servers provide failover and can handle more traffic. The minimum number of computers needed for a cluster is two web servers. Additionally, you need a way to switch traffic between the machines. Should one of the machines stop responding, the rest of the cluster should be able to handle the load. Load balancers distribute web traffic among web servers. There are other kinds of load balancers for distributing other resources such as a hard disks and databases, but we'll cover those later. In the case of multiple web servers, load balancers allow web services to continue in the face of one web server's downtime or maintenance. In addition to load balancing, multiple web servers introduce several complications, primarily file uploading and keeping the codebase consistent across servers. When Drupal is run on a single web server, uploaded files are typically stored in Drupal's files directory. The location is configurable at Administer Site configuration. With multiple web...

Web Server File System Permissions

Drupal requires write permissions to the files directory and the temp directory to enable features such as file uploads, CSS aggregation, and the upload of a new logo for the theme. However, it is a dangerous mistake to simply let Drupal have permission to write to all of the files inside the document root on your web server. Doing so would allow Drupal to write files that could then be executed. Again, you endeavor to audit your site and never let an attacker upload PHP code, which could be executed. However, if there is a vulnerability that allows an attacker to upload a PHP file, using proper file permissions that keep your files read-only for the web server will provide Defense in Depth that would prevent the vulnerability from becoming exploitable. The web server on this server runs as the user www-data, and there is a server group called maintenance, which is assigned to members of the server maintenance team. The specific directory permissions allow the www-data user to read...

Installing the Apache Web Server

To get started, you need to install Apache (GNU Linux, Windows, Mac), the most popular web server software on the Internet. The easiest way to do this on Ubuntu is to install the apache2 metapackage, using System Administration Synaptic Package Manager (see Figure 12-1). This installs all the basic packages that the second major release of the Apache web server requires, without your having to specify them individually. Other GNU Linux distributions have Apache packages available, and Windows and Mac users can download the software from http httpd.apache.org. Figure 12-4. GNU nano is a very useful command-line text editor for administering web servers. Figure 12-4. GNU nano is a very useful command-line text editor for administering web servers. To make edits in nano, use the cursor keys to move around the text file, change the part you want, and then press Ctrl+O followed by the Enter key to write out a new copy of the file (save it to disk). (Most commands in nano are accomplished...

Web Server

You need a web server that can execute PHP scripts. The Apache server is the overwhelming first choice for most of the people currently running Drupal. Drupal's core distribution is always tested with the latest 1.3.x version of Apache, but Drupal is known to work with the 2.0.x versions as well. Less common, but also supported, is the use of the Microsoft Internet Information Services (IIS) server. (For more information about running Drupal with the Windows IIS server, see http drupal.org node 3854 and http drupal.org node 940.)

Importing the local database

Firstly, we need to export the local database, and then we need to import it into the database in our web hosting account. The database can be exported from our local phpMyAdmin installation (comes included with most local web server setups, for example, WAMPServer). We need to open http localhost phpmyadmin in a web browser. From here, we need to select the Database we are using from the drop-down list. Now that we have the database from our local installation saved, we can import it into the database on our web hosting account. From our cPanel control panel, we need to click the phpMyAdmin link.

Verifying that your Backup Works

Create a subdomain in your existing account For example, if your site is accessible at http www.yoursite.org, the subdomain would be at http test.yoursite.org. The advantage of the subdomain is that it is probably the easiest to set up, as most web hosts will help you to do this, and some will even do it for you. The disadvantage of using a subdomain is that if your server goes down, you will lose both your backup site and your main site.

Autothrottling blocks

To throttle blocks go to the block administration page on your site at administer configuration blocks . Now, for any blocks that should be disabled when your site is under a severe load click the throttle checkbox. It is recommended that you select nearly all boxes, except perhaps Navigation and User login , as it will be rare that the auto-throttle actually causes them to be temporarily disabled. If you have an especially under-powered webserver, you may even wish to enable the throttle for the User login block so that users will be discouraged from logging in under heavy loads, as each page viewed by a user has to be dynamically built rather than displaying them from the cache.

Weblogs Guides to the

On that original web server, Tim maintained a What's New newsletter that included news about developments in the technology of the Web. He also wrote about, and linked to, new sites as they came online. Naturally, Tim's page included a brief description of these new places on the Web, and often Tim added his opinion of them. This style of web page periodic, subject-specific, linking to interesting sites with commentary is the very essence of the first weblogs.

Meeting the Requirements

Your system needs to meet some basic requirements to install and run a WordPress blog. The first is hosting. You'll need an account on a server somewhere. This may be shared hosting or your own server, if you have one. WordPress does work on Windows, especially with the same web server and database setup. But because it's the most common and, frankly, the simplest to set up, I'm going to concentrate on GNU Linux-based hosting. Your hosting server needs to have support for PHP version 4.1 or later and MySQL database server version 3.23.23 or later. I recommend Apache as a web server (version 1.3.23 or later), but any web server capable of supporting PHP should work. If you have support for mod_rewrite in Apache, you'll be able to use some especially useful features ofWordPress. (See for more information about mod_rewrite.) You'll also need to be able to upload files via FTP and change permissions on your files and folders.

The Age of Scripts and Databases

The search for solutions to these problems prompted the first real revolution in web design the use of scripts and Common Gateway Interface (CGI) programs. The first step was the use of special tags called Server-Side Includes (SSI) in each HTML file. These tags let web designers tell the web server to suck in the contents of another file (say, a standard copyright message or a list of the latest news stories) and include it in the current web page as if it were part of the HTML file itself. It made updating those bits much easier, as they were stored in only one place. The second change was the use of simple databases to store pieces of similar content. All the news stories on CNN.com (http www.cnn.com) are similar in structure, even if their content differs. The same is true of all the product pages on Apple.com (http www.apple.com), all the blog entries on Blogger.com (http www.blogger.com), and so on. Rather than storing each one as a separate HTML file, webmasters used a program...

How Drupals cache works

Every time you visit a Drupal page, Drupal makes dozes of queries (perhaps even hundreds on sites with many modules installed or with lots of content on a page) to the database to pull out the data and code needed to generate the HTML which makes up a Drupal web page. That means every page Drupal creates uses a relatively large amount of your server's processing power. Usually, you don't notice all the work Drupal does because computers are very fast and Drupal is very efficient. However, very busy sites with many hundreds or thousands of page views per minute may start to slowing things to a crawl. This is because the web server is having a very hard time making all the required database queries it needs to make in order to keep with all the page requests. By enabling Drupal's cache, you can significantly reduce the load on your server by reducing the number of database queries required to create a page. With the cache turned on, Drupal stores all the HTML code for any page visited...

Chapter Project and Features

While it is not the purpose of this manual to fully educate you on database, web server or operating systems basics specific to your site, this will hopefully introduce you to getting a Drupal based website installed and configured for your needs. For a more technical sounding definition

Configuring Site Settings

If Drupal tells you that it was unable to create the files directory, the most likely problem is that the web server doesn't have permission to write to the files directory. For Linux servers, you can solve this problem by changing the group ownership of the folder to the same user that runs the web server, often apache or www.

Installing the Drupal Content Management System

Other GNU Linux distributions are likely to have Drupal packages but for those that don't, and for Windows or the Mac, you can also install Drupal manually on a web server. To do this, download the tarball (compressed archive) from www.drupal.org, unpack the tarball in the directory of your web server where the HTML files go, and follow the instructions in the supplied text file. Restarting web server apache2 apache2 Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 far ServerNaroe

Historical Look at Website Creation

This system worked pretty well, and it made sense. Every URL that a user on the Internet could visit corresponded to a unique .html file on the web server. If you wanted to organize them into sections, you made a folder and moved the files into that folder for example, http www.example.com news would be the address to the News section of the site, and the 1997 newsletter would be located at http www.example.com news fall_1997_products.html. When the webmaster (or the intern) needed to fix a problem, they could look at the page in their web browser and open up the matching file on the web server to tweak it.

Getting Started With Drupal

Those who are not technically inclined may feel a little queasy when considering what they'll need to do in order to get Drupal installed locally. Take comfort in knowing that if you have a little patience and can follow directions then you can do it. I have created a video aptly titled How To Install Drupal On A Localhost to help get you started. The instructions in the video are applicable for Windows users and recommend a tool called Wampserver to create a web server on your local machine. Mac users can achieve similar results using a free tool called Mamp.

Installing Drupal

Copy the files to your web server's root directory. Moving the Drupal Distribution to the Root Directory of Your Web Server The next step is to move the contents of the Drupal folder that you just decompressed in the previous step, to the root directory of your web server. If you are using XAMPP, the root directory is the folder marked as htdocs in the directory where XAMPP is installed. If you are installing Drupal on a hosted platform, the root directory will be that specified by your hosting company (for example, the hosting company that I use names the root directory public_html ). You should check with your hosting company if you are unsure where to put your Drupal files).

Changing the Template

If you want to make modifications to your theme files, you can edit them in WordPress's Theme Editor, as long as the theme files are writable by the web server process (see the Setting File Upload Options section in Chapter 14). To activate the Theme Editor, go to the Presentation administration page and click the Theme Editor tab. Make sure that the theme you want to edit (c3ro mask 2 in this example) is selected in the drop-down list.

Installing Drupal The Detailed Version

In your web browser, navigate to where PHPMyAdmin is installed on your web server. If you are using a different tool for creating and managing your database, use that tool to create your database, and database user. 11. Click the Install Drupal in English link as shown in the preceding screenshot. As soon as you click this link, the installer will verify that your web host meets the requirements to run Drupal. In most basic hosting setups, your database is accessible at localhost. To verify the name or location of your Database host, you can use phpMyAdmin (as shown in the screenshot under the section Creating the Database and the Database User) or contact an administrator for your web server. For the vast majority of installs, none of the Advanced options will need to be adjusted. 14. Click the Save and continue button. You will see a progress meter as Drupal installs itself on your web server.

Installing Drupal on Windows

Drupal requires a web server, PHP4 (http www .php.net ) and MySQL or a database server supported by the PHP PEAR API (http pear.php.net ). NOTE The Apache web server and MySQL database are strongly recommended other web server and database combinations such as IIS and PostgreSQL are possible but tested to a lesser extend. I strongly recommend a complete web server packaged installer if you are at all new to Apache, MySQL or PHP. There are many out there. My personal favorite (because it worked out of the box) is FoxServ This will create a new directory drupal-x.x.x containing all Drupal files and directories. This directory can be several directorys deeper than the unzipped directory. The directory we are concerned about has the index.php page and modules directory in it. Move the contents of that directory into a directory within your web server's document root or your public HTML directory. On my local machine I created a directory of the name of the domain name it is part of. For...

Preparing for Search with Cron and Poormanscron

Like most websites, a Drupal website normally springs into action when it receives a request for a page. Like the web server and the database that support the site, it is idle for much of the time. (Even the busiest websites are idle for much of the time. To provide responsive service, the web server and network normally run well below 100 capacity to allow for temporary peaks of demand.)

Focus on Collaboration

With traditional websites, allowing people to create and edit pages means that you have to give them access to the web server usually by giving them the File Transfer Protocol (FTP) login information for the site so that they can move files to and from the site as well as within it. With Drupal, you can allow specific users to create, modify, delete, and use different types of content There is no single FTP login information to pass around.

Mastering the htaccess file

There is a server configuration file at the root level of your Drupal 6 site called the .htaccess file. This file is a list of instructions to your web server software, usually Apache. These instructions are very helpful for cleaning up some redirects and otherwise making your site function a bit better for the search engines. In Chapter 1, The Tools You'll Need, we told Google Webmaster Tools that we wanted our site to show up in Google with or without the www in the URL. The .htaccess file allows you to do the same thing directly on your web site. Why are both necessary In Google's tool, you're only telling Google how you want them to display your URLs you're not actually changing the URLs on your web site. With the .htaccess file, you're actually affecting how the files are served. This will change how your site is displayed in all search engines.

Showing images on the page using Slideshow Creator

You can use Slideshow Creator to either display specific pictures or to display all of the pictures that are stored within a specified folder on your web server. Displaying specific pictures gives you much more control and allows you to give each image a title, description, and the page to be displayed when the image is clicked (if any). Displaying all images in a folder is much easier to manage as you do not need to add each image to the slideshow individually.

MoWeS Portable development WAMP server

The first thing you'll want to do in order to follow these instructions is make sure you're running a WAMP localhost environment on your Windows XP system. I am using the portable application called MoWeS that installs Apache, MySQL, and PHP on your C drive so that you can run the Apache web server in a development configuration through your localhost. You can download the MoWeS Portable packages here apache2 The Apache web server folder and files. mowes.exe This is the MoWeS Portable executable file that lives at the root of your c drive. Double-click on this to fire up your MoWeS Portable application and start the Apache web server.

Fantastico and Debian

Two options for completely automated installations of Drupal include Fantastico (offered by many web hosts) and the Debian operating system. Fantastico is a set of scripts to install web applications (such as Drupal) on a server, and Debian is a GNU Linux distribution that allows you to install Drupal using the apt-get tool, which installs and updates Debian packages. If you're using one of these tools, make sure to check that they are installing the latest stable version of Drupal, or you risk missing out on features and security measures.

Backing up your site using Sftpftp and cPanel

This will launch a page that will give you options to download either a Full Backup (all of your site directories, databases, and e-mail forwarders and filters), or a specific Home Directory Backup, which will include all the site directories in the home directory of your web server.

Checking your PHP and MySQL settings

The location of your loaded php.ini configuration file It's good to know where the default php.ini file is located on your web server. You can overwrite this configuration with a custom php.ini file or with custom PHP setting code that you load into either your settings.php and or .htaccess file. However, there may be times when you need to edit the original default php.ini file as long as your host server gives you write access to that file.

Configuring multisite in a localhost environment

You have already prepped your multisite environment in the previous chapter when we set up a Drupal site on our localhost using MoWeS Portable applications. When doing this we installed the Apache web server, PHP, and MySQL on our local development environment. We now have Apache running and we have access to phpMyAdmin to do our database work by going here http i27.0.0.i phpmyadmin . The next step in multisite configuration is to add virtual host entries to our Apache web server configuration. You need to tell Apache to look for these additional sites in our multisite configuration when a site visitor loads the site's web address in the web browser. To do this we use a virtual host entry in the Apache configuration file. Make these code additions and tweaks, then save your httpd.conf file and close it. Then stop your MoWeS Apache web server and restart it so that the above changes take effect. Once you restart the web server, you will need to make one final tweak on Windows computers...

Introducing Good Eatin

Most web sites are created by simply creating standalone HTML pages that do not change. These pages can be created with a dedicated web site design program or with a simple text editor such as Microsoft Notepad. These pages are then uploaded to the web server using an FTP client, or another transfer client provided by the web host. Drupal is a content management system based on PHP and MySQL. To use Drupal, you need to install it onto your web server. After it is installed, you use Drupal to create and edit pages. Drupal handles most of the common functionality that is needed to build web sites of any size, including 3. After you unpack the installation, upload it to your web host. If you have not selected a host yet, skip ahead to Chapter 11, where we talk about recommendations for site hosting. 2. Change file permissions so that it is writable by the web server. If you are unsure how to grant file permissions, please consult the on-line handbook.

Administrator Notifications

This setting depends on having set up a cron job to periodically call the cron.php file this allows emails to be sent in groups periodically. For more information on setting up cron jobs, you should contact your web host. Typically it involves a crontab setting in your hosting control panel such as cPanel.

What is content management

Drupal is a content management system . This means it's a system for managing website content--like articles, photos, or other files. Drupal is a dynamic rather than a static system. Instead of being in pre-generated (static) files, content like the text on pages is stored in a database. When visitors bring up a page, a script runs on the web server, querying the database and putting the content of the page into a template. (Sometimes, to save time and resources, these scripts are run ahead of time and the resulting pages are cached or stored on the server instead of being generated afresh with each visitor.)

Installing Drupaland Common Hurdles to Its Installation

Once your Web server is working, installing Drupal is usually a fairly easy task. You may encounter some small hurdles when setting up the CMS, but these can be overcome quickly. As we walk through the installation process, you will get to know some of them. 3. Install Drupal. Once you have downloaded and extracted the Drupal files and created a database, you are ready to run Drupal's installer. This piece of software automatically creates all required database tables and sets some default settings. To launch the installer, navigate to the URL where your Drupal installation is reachable over your Web server (e.g., http localhost, http localhost drupal, or whatever you have chosen). Apache 2.2.4 (Unix) mod ssl 2.2.4 OpenSSl70.9.8g DAV 2 Web server

Pingbacks Track Backs and Comments

For checking and tracing purposes, the e-mail also includes the IP address of the visitor as reported by the web server, a reverse DNS lookup, and a link to a WHOIS lookup of that IP address. These three items should give you useful information if you are the victim of comment spam or some other comment nastiness. Unfortunately, some of the spammers post remotely from innocent machines or through third-party proxies, or else spoof the IP address, rendering those pieces of information less useful.

Command Execution SQL Injection and Friends

The user has posted the form to the web server, which hands the data to Drupal. Drupal first makes semantic checks on the form data to ensure that the user hasn't tampered with the drop-downs, check boxes, and radio buttons in the form to, for example, create a blog post with a taxonomy term that is not allowed.

The Importance of Cron

The indexing process used by Drupal's Search module only works when the cron utility has been properly configured. cron is a utility used to run various commands at scheduled intervals on your web server. It is responsible for performing maintenance tasks on a Drupal site, such as clearing old log entries, as well as scheduling bulk email and other tasks that happen with regular frequency.

Setting Up the Server

Before you install Drupal, you need three basic components in place the server, the web server, and the database. If you are hosting your site with a commercial hosting company, you can skip to the installing Drupal section, as everything you need is already installed. Apache The web server software package that handles requests for content residing on your server and returning the results of that request back to the person who made it.

Denial of Service Generic and Specific

In recent years denial of service attacks occasionally have made news headlines as servers are taken offline by attackers. There are two basic types of denial of service. The more common kind targets the more general network, operating system, or web server to overwhelm it with requests, which pushes the server into a degraded state so it can no longer perform its normal duties. This is often achieved using a large number of machines in a distributed denial of service attack. Most hosting companies have technicians who are prepared to handle distributed denial of service attacks at the network level by filtering out certain traffic or disabling services at the firewall level.

Configuring Document Root and Virtual Hosts

If you're unhappy with the default document root (the place where your Web server files are located), you can change it by modifying Apache's configuration file. To do so, you typically have to locate httpd.conf, as it is the main configuration file. Use Table A.1 to find the file location for your setup. For the changes to take effect, you have to restart the Apache Web server. To do so, follow the instructions found in Table A.2.

Hosting and domain names

When looking for a web host, it is important to keep in mind the amount of web space required, bandwidth (amount of data that can be transferred from your web site to your users per month), service level agreement, minimum contract term, acceptable usage policy and of course the cost. _ www.webhostingtalk.com is a popular forum discussing web hosts, I Some popular web hosting providers include Once you have registered a domain name, you will need to point it to your web hosting account by changing its nameservers to those of the hosting accounts. Your host should be able to provide information on the nameservers you will need to use, and your domain name registrar should be able to provide information on updating your domain nameservers.

Technical Requirements

Beginner's should know some important information about Drupal requirements before they get started developing a site. You're going to need a web hosting account in order to get a website based on Drupal up and running. This will cost you anywhere from 7.95 to 50 per month depending on the features of the account. You can do more research in the hosting forum at Drupal.org. Whichever host you choose there are two hosting features that are essential to building a Drupal site. You will also need FTP (short for File Transfer Protocol) access to your site. This is a standard feature of all hosting accounts and allows you to upload or download files between the web server and your local machine. If you are new to FTP then you will need to install a program that allows you to interface with your web server. Filezilla is a free FTP program that I use and recommend for you as well.

Search engine friendly and robotstxt

By default drupal does not ship with a pointer file for the search engines called robots.txt . By adding this file to the root of your (virtual) webserver, you can quide bots tghrough your site or forbid indexing parts of your site. See for an example the file for drupal.org itself at http drupal.org robots.txt. Change the file as you wish and save it. No upload it to your webserver and make sure it is in the root of the (virtual) webserver. If you have installed drupal in a subdirectory (for example drupal), than change the URL's in the robots.txt file but place the file in the root of the webserver, not in the root of your drupal instalation.

Web and Platform Choice

Having decided whether your project is commercial, noncommercial, all rights reserved, or Free Content, you need to select a technical means of distribution. GNU Linux and Free Software are the de facto standard in web hosting, but building and maintaining a static web site made of manually generated HTML pages can be a chore. This is particularly the case when the web site contains a large number of pages, images, or other files. Supposedly, programs like Adobe Dreamweaver, which provide some automation in web page production, make the process easier, but they're mostly used to generate static pages. The same goes for Adobe's Flash format, which is interactive only in the limited sense that users can click page elements and make things appear to happen. Flash animations are self-contained bundles of vector and application files that can't usually be directly manipulated or altered by the web site visitor. Since about 2004, Internet pundits have used the term Web 2.0 to describe...

Installing an Additional Theme

Theme installation requires that you have the ability to move files from your local machine on to your server. Typically, this is done with an FTP client or through your web hosting control panel. The method you use is up to you. It makes no difference to Drupal which method you choose to employ.

Setting Up the Database

Drupal does not create the database for you. For this, you will need to become familiar with the tools provided by the database management system that you have chosen to use. For MySQL, the PHP-based web application phpMyAdmin is popular. For PostgreSQL, phpPgAdmin is a common choice. Both are often included as standard fare by web hosting companies selling hosting packages. Create the database It is not particularly important what you name the database. It is important that you know what the name is. Some hosts will prefix the name you provide. Similarly, some web hosts will truncate the name to fit into a certain number of characters. So, make sure to double-check what the database is actually called, because you will need to know this when you're configuring Drupal.

Performing the Initial Tests

The installer also tests to make sure that the proper files and directories are writable by the web server. For phpBB 3.0, you'll want to ensure that the cache, files, and store directories are writable, as is config.php, as you have done for phpBB 2.0. The installer will test for this, as shown in Figure 8-16, and complain accordingly if it can't write to the files.

Scheduling Automated Tasks

Drupal is programmed in PHI, and PHP running on a web server like Apache offers no solution to the problem of scheduling tasks to be run at repeating intervals that just isn't what Apache and PHP were designed to do. Therefore, you need to use other tools to trigger the tasks.

Installing and Activating the RSS Link List PlugIn

Bill also recommends creating a new folder to allow the plug-in to cache the external RSS content. Create the folder wpcontent rssCache and set the permissions so that the web server process can create and write to files in that folder. The permissions need to be the same as the wp-content folder. See Chapter 14 for details on setting permissions.

Creating the files Directory

The first step to creating the files directory with the optimal permissions is to determine the username of the web server process. To find out what user the Apache web server is running as, look in the httpd.conf file, which is responsible for the Apache configuration. There you will find an entry like this (from Debian 3.1) Note Some Apache servers run using suPHP (http www.suphp.org ), and others are run as a CGI module. In both of these cases, the name of the process running the web server will be different. If you are unsure, contact your hosting service. Once you know the username of the web server, you can create the files directory Change the permissions so that the user is the web server and the group is a user group to which any of the developers working on your site will belong. I'll call the web server www-data and the users' group developers

Choosing Avatar Options

Permitting users to upload their avatar images to your server is by far the most convenient method for your users. In order for this option to work, you must make sure the upload directory you've specified (typically images avatars) is writable by the web server otherwise, your users will have problems uploading files. This option is less than desirable if your server is strapped for disk space. You can specify a hard limit on the size of files uploaded to your server under the Avatar Settings section in the Configuration page of the Administration panel.

Moving Your Existing Site to a Drupal Site

The first thing you may worry about is your domain name itself mycompany.com. This is normally yours, and you can move it from one web hosting company to another, so you do not have to worry if your Drupal move will also involve a hosting move. For many people, moving an existing site to Drupal can be done in either of two ways. You can do a full conversion so that, at a certain time (2 A.M. on a Sunday morning is a popular time for this), the old site is replaced by the new Drupal site. The other way is to do a progressive conversion. In a progressive conversion, you address each area (sometimes even each page) with one of two approaches

Deploying to Production

If you created your site on your desktop or laptop you'll need to copy the entire Drupal directory to your production web server, and you'll need to backup your database and restore the database on your hosting environment. For additional details on this process please see Chapter 13.

What you need for this book

To follow along with the examples in this book, you will need a computer which can run MySQL, PHP, and the Apache web server, which are all prerequisites for Drupal. Luckily, every major operating system can run these applications. You may want to create an account with a website hosting company to test your work although you can also use a regular desktop or a laptop computer.

Setting Up a Development Server

When developing a theme or tweaking a Drupal Web site, a local Web server is very handy to speed up the process of developing and testing. Several software distributions that come preconfigured with Apache, PHP, and MySQL are available their use largely simplifies the setup of a Web server. These packages usually have a straightforward installation routine download the package, extract the files, and click the Start server button. Of course, there are many ways to install a server only a few of them are presented here. If you already have a development Web server set up, you can most likely reuse it for running Drupal.

Troubleshooting Image Cache

The most common problem is that Clean URLs are not enabled (or not supported by the software on the web server). Visit Administers Site configurationsClean URLs (admin settings clean-urls), as shown in Figure 7-17. If you receive an error on the configuration form, see the handbook page for setting up Clean URLs (http drupal .org node 15365) for help configuring your server. Drupal's Clean URLs feature requires the Apache extension mod_rewrite. If running Drupal on a Microsoft IIS webserver, a third-party solution for rewriting URLs will be necessary to use ImageCache.

Managing Publishing Workflow

If you would like to participate in the hands-on exercises in this chapter, you should install Drupal using the Newspaper installation profile from the book's sample code, which creates the example website on your web server. The completed website's administration tools will look like the image pictured in Figure 6-1 and found at http newspaper.usingdrupal.com. For more information on using the book's sample code, see the Preface.

Assumptions This Book Makes

You'll need access to a computer or server running PHP, along with a web server (Apache preferred) and database (MySQL recommended). For local development, there are several all-in-one Apache MySQL PHP packages available such as WAMP for Windows (http www.wampserver.com) or MAMP for Macs (http www.mamp.info). Visit http drupal.org hosting for a list of Drupal-friendly web hosting companies, and visit http drupal.org requirements to read more about Drupal's system requirements.

Gathering Requirements

Ensure access to a web host or local development environment with the following a. A web server, such as Apache (http httpd.apache.org), which handles serving up Drupal's pages to the browser. Having access to Apache's mod rewrite extension also allows you to use Drupal's Clean URLs feature, which transforms URLs like to http www .example.com contact. 2. Write down the following information from your web host b. Your database server's details, including username, password, and database name, so that Drupal can connect to the database. Some web hosts also require additional information to access the database, such as specifying a remote hostname or a specific database port.

Autothrottling modules

To throttle modules, go to the module administration page on your site at administer configuration modules . Now, for any module that should be disabled when your site is under a severe load click the throttle checkbox. Deciding which modules to throttle can be more difficult than deciding which blocks to throttle. It is recommended that you experiment in your development environment, disabling modules and seeing how this affects your site. The more underpowered your webserver, the more modules you will want to throttle. Generally speaking, throttling modules will usually have a larger affect than throttling blocks.

Installing the PHP Scripting Language

HTML is a markup language, derived from typesetting principles, and therefore it doesn't offer features that enable interactive elements on web pages. To achieve these interactive elements, web developers use a scripting language, which is a programming language that doesn't need to be compiled before it's run. Many Free Software scripting languages are available, but one in particular has been widely adopted in Web 2.0 sites PHP (GNU Linux, Windows, Mac). Ubuntu users should install the php5-mysql package in Synaptic, which also downloads the php5-common and libapache2-mod-php5 packages as dependencies. (Don't worry if Synaptic suggests removing the apache2-mpm-worker package and installing the apache2-mpm-prefork package instead this is fine for your purposes.) You need all three of these PHP packages to run your CMS and connect it via PHP to the MySQL database and the Apache web server. Other GNU Linux distributions have similar packages. Windows and Mac users can download PHP from...

Setting File Permissions

Before you put away the FTP program, you need to check your permissions on certain files and directories. By default, files you upload to your server and directories you create on it are owned by you, or rather your account on the server. This is correct and as you might expect. However, the web server, Apache, usually runs as a different user, often apache, httpd, or nobody. This means that software running under Apache in this case, WordPress doesn't normally have permissions to modify or delete files, nor to create new ones. To fix this, you need to change the permissions of some of the WordPress files. You will most likely need to give full access to those files. You will also need to give write access to a couple of folders, so that WordPress can create new files.

Configuring File Uploads

The maximum size of the files that you will be able to upload is controlled by the PHP settings post_max_size and upload_max_filesize. You can adjust these values by explicitly setting them in your settings.php file, assuming your web server allows for this. Find the section of that file titled PHP Settings and add the following lines, adjusting the file size to suit your needs

Installing and Activating the PlugIn

On the web server, navigate to the wp-content folder. Create a directory here named backup and make it writable by the web server process. This normally involves setting the properties by right-clicking the directory in the FTP window, or by providing the instruction chmod g+w backup at the shell command line. If configured to store the generated backups on the web site, this directory is where the plug-in will store them, which is why it needs to be writable by the web server. However, by default, the plug-in will expect you to download the backups to your own local machine and not use this folder. Using a backup folder is the most secure way to handle your backups and is the approach I recommend.

Setting File Upload Options

The URI of this directory setting is the web-visible URI the server will expose this folder as. WordPress sometimes gets this wrong. The URI it guesses works, but not all the time, particularly in the administration pages, so you cannot see your images in preview mode. Change this to an absolute path on the server. For example, if your blog URI is http example.com myblog, set it to myblog wp-content. You can use a folder completely outside the WordPress folder if you like. For example, you may have an existing images folder you wish to use. Whichever folder you choose, it will need to be writable by the web server.

Backing Up Word Press Tables

The file that is generated and automatically downloaded is a compressed file containing a single .sql file of MySQL instructions. The size of the .sql file depends on the amount of information stored on your blog. Once you have a few hundred blog posts and a few thousand comments, the download file can become quite large. Thankfully, because it is text, it compresses to a manageable size for downloading, storing on your web server, or possibly being e-mailed to you. Given that there are e-mail providers giving away 2GB of storage space for free these days, you could even set up an account purely to receive and store your blog backups.

Transferring the Files

You are now ready to transfer the files onto your server. Using your FTP software, upload all the WordPress files to you web server, storing them in the folder you decided on earlier, as shown in Figure 14-4. This folder will be the one your hosting company told you is the place to put your web pages or a subfolder. You may need to create the folder first, if it does not already exist. Next, on the server, rename the dothtaccess.txt file you uploaded to .htaccess a leading period (or full stop), followed by the name htaccess with no extension. This is a special file that will be used later to give some special instructions to the Apache web server software. Figure 14-4. Uploading WordPress files to the web server Figure 14-4. Uploading WordPress files to the web server

Drupals Cost Versus Older Techniques

Drupal has benefited from the ideas that are current in today's software environment and that, in many cases, are hallmarks of open-source software. For example, Dru-pal contains a database abstraction layer so that it can function with a variety of databases. In the past, web server applications (which is, in some ways, what Drupal is) were often tied to proprietary databases. Companies bought into the proprietary web server application and the proprietary database, and that was the end of the matter. Getting their data out of the proprietary environment was another matter usually for other people.

Setting Up the Software

PHP and the web server are the primary software. PHP 5.2 or higher is required for Drupal 7 and recommended for Drupal 6. If you are using a shared hosting service, the versions they support are important as well as their upgrade policy. In many circumstances, Drupal will need to send email using PHP. Particularly on shared hosting servers, you might need to contact your vendor to enable this. Remember this is email sent from PHP and not the normal email application or web page you can usually access to send and receive email on your web server. As for a web server, Apache 1.3 or Apache 2.x on Mac OS X, Windows, or UNIX Linux is the recommended choice. Drupal also runs on Microsoft Internet Information Services (IIS) 6 or IIS 7.

Installing Memcached libraries and service

Memcached is an entire service similar to MySQL or PHP that runs on your web server and integrates with other applications like PHP and Drupal. We need to get Memcached installed first on our development server and then we need to integrate it with our PHP installation and environment. We're going to now install Memcached as a service on our web server. To do this, first create a new folder on your c drive called memcached. You should have a folder c memcached and in that folder move and extract the ZIP file you just downloaded. This will extract and create a file called memcached.exe. You should see something in your folder that looks like this

Installing the Flexinode Module

After perusing the README text, you can decide which of the contributed field types you would like to have available. These should also go into the modules flexinode folder on the web server. In the end, an installation of Flexinode with all available field types will look like Figure 4-7.

Search and Metadata Clean URLs

During installation Drupal tests for support of Clean URLs and automatically enables this option if it's available. If your server fails the test don't fret because you can still get it working. The first step is to determine the type of web server you are using. The Apache web server is the most common and is used by XAMPP MAMP. Microsoft's IIS web server is also used on some web hosts. If you are unsure, contact your web host. Based on the web server you are using, follow the appropriate instructions below.

Sharing a Database Among Multiple Sites

Drupal makes great efforts to allow you to run multiple sites from the same installation. Because each installation requires its own database, the number of sites you can run on some hosting plans would be limited by the number of databases the web hosting service allows you to make. Some hosting plans allow for only one database. How can people in this situation take advantage of Drupal's multisite configuration features Fortunately, there is a relatively simple solution. Through the use of table prefixes, you can load the tables for two or more Drupal sites into the same database and instruct each site which prefix to use, thus uniquely identifying the tables within a shared database.

Server and Network Vulnerabilities

Drupal is written in PHP and requires a database, typically MySQL or PostgreSQL. Those are the only real certainties about the environment. Most Drupal sites rely on the popular LAMP stack Linux, Apache, MySQL, PHP. That is far from a requirement, though. It can also run under any web server that can run PHP, including Microsoft's Internet Information Server, nginx, and lighttpd, or even under a Java servlet by using a PHP compiler that outputs Java bytecode. Similarly, there are ports of Drupal to run with Oracle's database, Microsoft's SQL Server, IBM DB2, and the open source SQLite. And, while GNU Linux is a common operating system, just about any flavor of Unix-like operating system will work. Drupal is also known to run quite well on Windows and Mac OS X.

Chapter Before you start

Drupal is a content management system. It is one component of a website architecture and relies on several other components to work properly and perform at it's best. If you are looking for a web host carefully review the requirements section when evaluating their services.

Upgrading Core The Detailed Version

These more-detailed directions expand on the short version, and provide step-by-step instructions on how to upgrade via the command line. In these detailed instructions, the new site is prepared on the web server. For people who don't want to work on the command line, the new site can be prepared on your local computer, and then uploaded to the web server via FTP.

Slashdotted

Even with the auto-throttle enabled and configured, you may find that your server chokes when an extremely busy site such as Slashdot links to your site. It may be that your shared webserver simply can't handle the load, however don't give up too quickly. Here are a few more tips Talk to your web host about how they can better tune your webserver

Mail Server

Many of Drupal's features, including user registration, depend on the server's ability to send email. Your web server needs to have a mail server available for these functions to work. Drupal uses PHP's mail() function to send e-mail (see http php.net mail). These two php.ini directives are needed to support mail

Configuring Drupal

The remainder of the Drupal configuration can be carried out using the web browser on your system. If you're installing on a remote web server, replace localhost in the following example URLs with the server's domain name (for instance, www.freesoftwarecreative.com) or IP address (such as 62.75.222.127). Below this is the field for the site's official e-mail address. On a production web server, which is permanently connected to the Internet and has a mail server running, this feature enables Drupal to send e-mail to new users when they register for membership on your site (if you decide to allow third-party registrations). This From address should normally be within the same domain as the web site, so that anti-spam programs don't get confused about which server the mail is coming from. In this example, I've used the address robot freesoftwarecreative.com so people realize the e-mail isn't from a human being (see Figure 12-12).

How Does Drupal Work

In the bottom layers, things like your operating system, web server, database, and PHP are running the show. The operating system handles the plumbing that keeps your website running low-level tasks such as handling network connections, files, and file permissions. Your web server enables that computer to be accessible over the Internet, and serves up the correct stuff when you go to http www.example.com. A database stores, well, data all of the website's content, user accounts, and configuration settings, in a central place for later retrieval. And PHP is a programming language that generates pages dynamically and shuffles information from the database to the web server. Web server (Apache, Light, IIS.)

Environment

Rather than allowing the public access to a work-in-progress, it is far better to set up a PHP-enabled web server on your home or office PC or some other platform if available. This server, along with PHP and the database, can then be used to design and build everything before deploying the final product to the live site. It should also be noted that because Drupal has been developed with flexibility in mind, it is possible to use it off IIS as an alternative web server, as well as utilize PostgreSQL as an alternative database because support for these are actively being developed. By far and away, however, the most popular combination is Apache, MySQL, and PHP, so this is what is covered here.

Redirecting the User

The return value of the function can be overridden by defining a redirect property in the form, such as form ' redirect' 'node 1' or form ' redirect' array('node 1', query_string, named_anchor). The actual redirection is carried out by drupal_goto(), which returns a Location header to the web server.

Static Publishing

Software that uses the static publishing method stores your content in some kind of database, but then generates static HTML pages in a publishing step. Your main blog page, individual story pages, archive pages, and category pages are generated as flat HTML files and stored on the server, or even on a different server. These files are then served by the web server with no further requirement from the blog software. Blogger, Movable Type, and Radio UserLand, among others, are of this type. The major advantage of publishing your blog to static HTML files is speed. All web servers serve static pages the fastest. If you have an extremely busy site, with an underpowered or an overloaded server, the difference will be quite apparent. With adequately powered servers, the speed increase is less significant. Another advantage of static publishing is that you don't need the content database on your web server. In practice, it may be located on the same machine, but that is not required.

Status Report

The Status Report provides a one-stop shop for information on your site's configuration, including the web server type and version, PHP version, common PHP configuration settings, and notices about any potential problems with your site. If you seek help with your site from Internet Relay Chat (IRC) channels, drupal.org's forum, or Drupal professionals, the information on this page will assist them in troubleshooting your issues.

Directory Structure

Drupal allows you to run different Web sites from a single instance of Drupal files on your Web server. You could, for example, run two Web sites example.com and mysite.org from the same code base, with each site having its own database. To create multiple sites, you simply create a subfolder within the Drupal folder sites. These site folders must have the same name as the domain names they represent. For example, the domain name example.com would have a folder named sites example, com. Each of your site-specific folders will contain a file named settings.php as well as a subdirectory to hold site-specific modules and site-specific themes. If you would like a module or theme to be available to all sites, use the folders sites all modules and sites all themes, respectively. Do not place downloaded modules and themes into the Drupal core directories. Keeping the Drupal core pristine will make it easier to perform security updates.

Principles

To ensure excellent performance, Drupal puts a premium on low-profile coding (for example, minimizing database queries). Drupal should also have minimal, widely-available server-side software requirements. Specifically, Drupal should be fully operational on a server with Apache web server, PHP, and either MySQL or PostgreSQL.

Relicensing

Massive Multiauthor Collaboration Site (or MMC Site ) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A Massive Multiauthor Collaboration (or MMC ) contained in the site means any set of copyrightable works thus published on the MMC site.

Troubleshooting

Load that file in your browser to find a wealth of useful information. Search for any occurances of the word 'MMCache'. If it's not there, then MMCache is not loaded. Double check your 'Configuration File (php.ini) Path' on that same page, and be sure that you modified the correct 'php.ini' file. Verify that you installed 'mmcache.so' into the directory specified by the 'extension_dir' directive. Also, try restarting your web browser to be sure the latest configuration changes have been made. Finally, be sure to look in your web server's error log to see if there are any hints there. (Note that the phpinfo() function call reveals a _lot_ of information about your system. For security reasons it is very unwise to make this information available to the general public. If you created 'phpinfo.php' in a public place, be sure to remove it when you're finished troubleshooting.)

CPU Utilization

The sar utility from the sysstat collection gathers system activity numbers over time. The following sar snapshot taken from a dedicated Drupal server shows how the installation of MMCache can help reduce system load on even a heavily-optimized web server (MMCache was installed around 12 00PM)

Scripting Languages

To create a Drupal template, you will also need to know a little bit of the scripting language PHP. This server-side language is never visible on the Web site, but rather is rendered by the Web server. When you use the PHP function, print , the PHP script will create a page that is built from one or a combination of the three previously described languages (XHTML, CSS, or JavaScript), which are in turn rendered by the browser for everyone to see. As a consequence, you can use PHP to completely hide content from Web site visitors. Unlike the other scripting languages, PHP produces hidden content that is truly hidden

Handling User Input

Security breaches can be caused when text entered by a user is executed inside your program. This can happen when you don't think about the full range of possibilities when you write your program. You might expect users to enter only standard characters, when in fact they could enter nonstandard strings, such as control characters. You might have seen URLs with the string 20 in them for example, http example.com my 20document. html. This is a space character that has been encoded in compliance with the URL specification (see http www.w3 .org Addressing URL url-spec.html). When someone saves a file named my document.html and it's served by a web server, the space is encoded. The denotes an encoded character, and the 20 shows that this is ASCII character 20. Tricky use of encoded characters by nefarious users can be problematic, as you'll see later in this chapter.

GNULinux Solutions

The part that confuses most people about using cron for your Drupal installation is that the cron program is responsible only for the scheduling. You need a second program to actually call the cron.php file. wget, lynx, and curl are three candidates for this second program, and you are free to choose which one works best for you. You need to configure the program to call the URL of the cron.php file via HTTP It is important to allow the web server to handle the request instead of calling cron.php from the PHP command line, because the web server provides key information, such as the host name, that will otherwise be missing.

Comment Closer

This module requires the simultaneous use of cron, Drupal's automated scheduling tool. To confirm that cron is running automatically, navigate to Administer, Reports, Status report. Look for the section on Cron maintenance tasks. If cron has not run recently, you will need to configure your Web server to trigger Drupal's scheduling tool. Chapter 2 of this book describes how to set up a cron job.

File Layout

The files folder doesn't ship with Drupal by default, but it is needed if you plan on using a custom logo, enabling user avatars, or uploading other media associated with your new site. This subdirectory requires read and write permissions by the web server that Drupal is running behind.

Using Clean URLs

When the web was first proposed, URLs were addresses of documents to be returned to the user. In most cases, they were HTML documents. Requests were handled by web servers that simply retrieved the given document and returned it to the user. In short order, web servers morphed into more complex software that were capable not just of locating the requested document and returning it, but also of interpreting variable data in the URL request and assembling a dynamic HTML document to be returned to the user. Sometimes, these were called application servers, although that term is used less frequently today. As the web evolved, the format of URLs evolved and in their evolving complexity, URLs became divided into two categories clean URLs and dirty URLs.

Third Party Images

Historically, this type of media sharing was discouraged, in part because of the strain on web servers when multiple sites might use the same image. Now, due to the increase of available bandwidth and the revenue available from advertising and other means, many sites actually encourage sharing images and media from their servers.

Database Bottlenecks

Experimenting with the size of the query cache is usually necessary. Too small a cache means cached queries will be invalidated too often. Too large a cache means a cache search may take a relatively long time also, the RAM used for the cache may be better used for other things, like more web server processes or the operating system's file cache.

File permissions

This means that Drupal needs write access to create (and later access) the files and files tmp directories. One way to solve this is to give the webserver write access in the directory. Another common solution seems to be granting everybody write access to the files directory. Both solutions has the drawback that somebody else is able to write files into that directory. if you know a better solution, please mention it here

Throttle

If your site gets linked to by a popular website, or otherwise comes under a Denial of Service (DoS) attack, your webserver might become overwhelmed. This module provides a congestion control throttling mechanism for automatically detecting a surge in incoming traffic. This mechanism is utilized by other Drupal modules to automatically optimize their performance by temporarily disabling CPU-intensive functionality.

Managing Media

Drupal core has two key features that assist with the integration of rich media, the Upload module and embedding. The Upload module allows users to attach different types of files to node types of your choosing. This feature allows for very basic integration with media files. There are two limitations that you will deal with when using the upload module. The size of file uploads may be limited by your web host which could limit what types of media you can upload to the site. If you are able to upload the file you want the upload function does not provide any post upload processing (like generating thumbnails for images or converting videos to flash) or embed the media within your posts. Directly integrating video in a Drupal site (or any type of site for that matter) is a tricky proposition for several reasons. First, video files tend to be larger than other forms of media. So unless your videos are short and small in viewing size you may have problems actually getting them uploaded...