Before we start anything else, we need to set up a web server. The most common setup for TYPO3 is based on a LAMP stack (Linux, Apache, MySQL, and PHP), although other setups are supported as well. Next, we will install all the components required by TYPO3 on a Debian Linux server.
Setting up a Debian server is very easy, because all the packages you need are available through APT (Advanced Packaging Tool). Make sure that the package lists are up-to-date by running:
Shell> apt-get update
Issue the following command while logged in as root:
Shell> apt-get install apache2-mpm-prefork libapache2-mod-php5 php5-gd php5-mysql mysql-server-5.0
APT makes software maintenance easy, as all packages can be upgraded or removed through simple commands. You could install the packages from source, but it would make subsequent upgrades difficult. With APT, you can run the following to update the package cache information and upgrade your system:
Shell> apt-get update Shell> apt-get upgrade
We can also install some other components to add additional functionality to our system.
Shell> apt-get install imagemagick
This installs ImageMagick—a powerful graphic processing program. TYPO3 works with GD and ImageMagick, and you can enable the use of ImageMagick in the Install Tool. As ImageMagick is an external program (unlike GD, which is a PHP extension), it is more efficient and feature-rich when it comes to image processing. Therefore, it's highly recommended that you install and enable it.
An alternative to ImageMagick is GraphicsMagick—a fork of ImageMagick with a more stable API. GraphicsMagick is also more efficient, and performs better than ImageMagick, especially on multi-core processors. No changes to TYPO3 are required to work with GraphicsMagick, and it can be utilized as soon as it is installed by using the following command:
Shell> apt-get install graphicsmagick
To verify that everything is functioning correctly, you can go into TYPO3 Install Tool (available when you install TYPO3 as described in recipe Setting up TYPO3), and select Image Processing to check the configuration, then run some tests, as shown on the following screenshot:
Shell> a2enmod module_name Shell> a2dismod module_name
The first command line (shown above) enables a module while the second command line disables a module (example:
Shell> a2ensite site_name Shell> a2dissite site_name
The first command line enables a website configuration file while the second command line disables a website configuration file (example:
Always put different site configurations in separate files. This way you can be sure that disabling a site configuration will only disable that website, and will not have any adverse effects on the other sites hosted on the server.
Shell> apache2ctl start Shell> apache2ctl stop Shell> apache2ctl restart
The commands you just saw are used to start, stop, or restart the server respectively. Make sure to restart the server after configuration changes, as they will not take effect (alternatively, you can reload the server).
There are many other resources online to help you set up and optimize the web server. One such resource that also gives some information specific to TYPO3 is http://www.installationwiki.org/Typo3.