1. About
Now we're ready to install the Typo3 content management system. We are going to make a special installation, since you may have defined virtual hosts in the Apache configuration section of this tutorial. We won't put the «source» directory of Typo3 (aka the core) in a specific server's document root. We'll put it outside, so it will be available from any server, just by creating a symbolic link to that directory. It means that you'll have only one Typo3 source directory for all your servers . So when you will need to update Typo3, all you will have to do is to update that directory, and all your sites will be updated.
2. Getting the source
The first thing to do is to download a package. Go to http://typo3.org/download/packages/. You'll see three different packages, plus the source. You can already download the Typo3 source. Choose the tar.gz distribution, as it preserves the symbolic links inside the archive.
Now decide which package you'll use. The first one is called «Dummy». It's a complete and empty Typo3 site, so it's perfect to start a new project. However, if you want some examples, you may want to download an other one, like «QuickStart», which is a premade Typo3 website, to help you understand how the system works. The last package, «TestSite», is another example site, but for users who knows Typo3 already a bit.
It doesn't matter which package you download. In this tutorial, I'm using the dummy package, but the installation steps are exactly the same for each one.
3. Installing the files
Decompress the source and the package you have chosen. Put the source directory into /Library/Servers/ and the files of the package into the documents directory of the server you'll use (eg. /Library/Servers/Server-1/Documents/). We need now to fix the permissions for those directories:
sudo chown -R your_username:www /Library/Servers/
sudo chmod -R g+w /Library/Servers/
That's it. As you will see below, it's very important that the www user has write access to the Typo3 files. The final step is to recreate the link to the Typo3 source in the server's document directory. First of all, in the documents directory, delete the old link:
rm typo3_src
Then create the new one:
ln -s /Library/Servers/typo3_src_3.x.x typo3_src
All the other links of the package will follow the typo3_src link. So if this one is correct, all the others will also be.
The next parts of the installation are web based. It means that you will access Typo3 through your web browser. In order to do that properly, you should really consider to use a Mozilla based browser. As you will see, the «backend» of Typo3 is a very huge place, with a lot of features. If you browser doesn't respect the web standards, your experience with Typo3 will become a nightmare.
The standards on the web are very important. They ensure that the user will get a correct output. Unfortunately, there's no way to force someone to respect those standards. On OS X, there's a lot of web browsers, with eye-candy features, and all the stuff. But most of them are just incompatible with the web standards. Some of them even pretends to respect the standards, like Apple's Safari, or MS Internet Explorer, but it's all wrong.
The browsers which use the Gecko engine (from Mozilla), are compliant with the standards. So in order to work with Typo3, you have to use one of them. It can be Firefox, Mozilla or Netscape. Personally, my favorite is Firefox. It has everything you need, it's faster than Netscape or even Mozilla, and it has a smooth and intuitive interface, like most of the OS X programs you know. You'll find below the links for downloading those browsers:
Firefox http://www.mozilla.org/products/firefox/
Mozilla http://www.mozilla.org/products/mozilla1.x/
Netscape http://channels.netscape.com/ns/browsers/download.jsp
1. Accessing Typo3
Now that you have a working web browser, you can access your Typo3 installation. Just go to that address:
http://localhost/
If you're on a virtual host, add the port number after localhost (eg. http://localhost:9000). You should see that:
In the main source distribution of TYPO3, the install script is disabled by a die() function call. Open the file typo3/install/index.php and remove/out-comment the line that outputs this message!
For security reasons, the installer is disabled. To activate it, open typo3_src/typo3/install/index.php, and deactivate the lines below by adding a // sign before each one:
Line: | Correct code: |
|---|---|
44 45 46 | //if (1==1 || (substr($HTTP_SERVER_VARS['REMOTE_ADDR'],0,7)!='192.168' && $HTTP_SERVER_VARS['REMOTE_ADDR']!='127.0.0.1')) {//die("In the main source distribution of TYPO3, the install script is disabled by a die() function call.<BR>Open the file typo3/install/index.php and remove/out-comment the line that outputs this message!");//} |
Now save the file and reload your browser's window.
2. 1-2-3 GO!
You should now have a screen like this:
Just type the username and the password of the MySQL user you defined previously, and click the submit button. Then, in the next page, select the database you created, and in the last step, import the database (just click the submit button).
Congratulations. You now just have a working Typo3 content management system on your Macintosh.
3. Advanced configuration
Now, let's configure a bit more. Click the «Continue to configure Typo3» link. You will first have to enter a new password, to secure the Install Tool. When it's done, head to the «All Configuration» section:
This page controls all the core configuration of Typo3. Change the settings as below:
[GFX]
[thumbnails_png] 1
[gdlib_png] 1
[gdlib_2] 1
[im_path] /usr/local/bin/
[im_path_lzw] /usr/local/bin/
[im_version_5] 1
[im_imvMaskState] 1
[im_no_effects] 1
[im_v5effects] 1
[im_mask_temp_ext_gif] 1
[im_combine_filename] composite
[TTFdpi] 96
[SYS]
[sitename] The name of your website
[encryptionKey] Just enter some random text
[curlUse] 1
[binPath] /usr/bin/,/usr/local/bin/
[BE]
[unzip_path] /usr/bin/
[lockRootPath] Your server's document directory
(eg. /Library/Servers/Server-1/Documents)
[FE]
[simulateStaticDocuments] 1
When your'e done, validate to form to write these new values. Then you can go to the «Basic Configuration», or «Image Processing» sections, to check if everything is ok.
To get additional informations about the other options, please refer to the documentation section of this chapter.
4. URL rewriting
Now we have a last step to do. In the configuration process, we have set the [simulateStaticDocuments] option to 1. This is really a nice feature of Typo3. All your future pages will be generated by the index.php file. So for any page, the URL will be something like this:
http://localhost/index.php?id=1&type=0
Not very cool for your visitors. So the option we just set will transform the URL to simulate a HTML file, for every page of your site, by using the name of the page. This is done through the Apache module «mod_rewrite», which we have activated previously.
We've got to configure that module, by placing a .htaccess file in the server's document root. To create this file, you must type something like this, in the terminal:
pico /Library/Servers/Server-1/Documents/.htaccess
And here's the content of the file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^[^/]*\.html$ index.php
RewriteRule ^[^/]*\.pdf$ index.php
That's it. Save and close the file, restart Apache, and we're done. You can know begin to enjoy the best content management system on your favorite platform.
Now, you have achieved every step of this tutorial. You have a working web server, with a bunch of features, and a working Typo3 installation. So you should now take a look at the documentation section of the Typo3 web site (http://typo3.org/documentation/document-library/Matrix/), where you will find everything you need to know about Typo3.
If you never used that system before, you should get the «Getting Started» tutorial, which is based on the QuickStart package. It will lead you through the basic functionalities of the CMS.
If you have other questions about that tutorial, you can always find me on the Typo3 France forums (http://www.typo3.fr/forum/).