On this page, you get informations about configuring your web server, etc. for hosting Typo3.
There are two ways of installing Typo3 and managing an installation: via composer or in the traditional way. Composer is officially recommended, so you should probably use it. I have seen extensions that can only be installed by composer, so the days of the traditional way are counted. Mixed installations are not possible, if you use composer for the base installation, you have to use it for installing extensions, too.
I do not use composer. There is a simple reason: Shared hosting. Command line access gets extra charged, ready-to-use packages come without composer. On my develpoment machine at home, I do not want to have options that are missing in the production environment.
So to the drawbacks: To use the command line typo3, you have to have the package cms-cli installed. This requires composer. Fortunately, there is the package typo3_console that can be installed via the extension manager. It runs crawler queues (after adjusting file permissions), so anything is fine, at first.
Transferring data from one Typo3 installation to another
When you get a testing installation at home and a production installation on the internet, you sometimes have to sync them. The best technique is surely to use git. You should also create a sitepackage.
When you want to transfer a complete site, you can pack all the files, dump the database, and, on the destination computer, unpack the files and undump the database. I had to recreate the site entry, and it was done. Here is one description using phpMyAdmin, there is another using mysqldump. By the way, you can of course use these methods to backup your Typo3 instance, too. It is helpful to do some cleanup before dumping the database. This cleanup does not only save bandwidth, it also avoids problems, as tables about cached data contain absolute path names. Do it this way:
- Flush all caches (top menu, also Admin Tools/Maintainance)
- Clear persistent tables (Admin Tools, Maintainance)
- Remove temporary assets (Admin Tools, Maintainance)
There exists a phpmyadmin plugin for Typo3. You may even use it to read in a dump of your database (this is uncool, but I had to do it once because a provider's (before you ask: not at Serverprofis; here anything runs fine) other phpmyadmin was broken. But then you should log out immediately after the restore is done.
For transferring part of the page tree, there is XML import and export (right-click the page, click More Options, and there you are. You may transfer a single page or subpages too. Watch the preview report carefully so that you do not miss what will not work. Here is a list of things that do not work and have to be repaired by hand:
- Categories will not get copied, you have to set them again (and, eventually, to create them).
- Links get broken. Create them again.
- When you copy a subtree without checking Update, the pages get numers appended to their names, so home becomes home-1. Needless to say that this ruins your navigation. So either check Update or delete the pages that will get imported.
Running Multiple Sites with Typo3
A single Typo3 installation is capable of managing multiple sites. But you also have to configure your system accordingly. The following description is for OpenSuSE Leap 15.2.
Configuring the System for Multiple Servers
Let me confess in advance that I do not run a DNS server any more. I created two virtual hosts for my locally running apache, made thema ccessible and told Typo3 about them. These are the steps I took.
- Edit /etc/hosts. I appended the new host names to the line 127.0.0.1 localhost so that it looked like this:
127.0.0.1 localhost phasenumkehr.peter.local homepage.peter.local
(all in one line).
- Edit /etc/nsswitch.conf. Oh, I have to confess that I deeplay hate zeroconf, uPnP and similiar stuff. I had to change the line reading
hosts: files mdns4_minimal [NOTFOUND=return] dns
hosts: files dns
because the zeroconf guys could not imagine that anybody else but them would ever use the top level domain .local.
- Go to the directory /etc/apache2/vhosts.d. Copy vhost.template to phasenumkehr.conf.
- edit phasenumkehr.conf. I will only show lines that had to be changed:
Options Indexes SymLinksIfOwnerMatch
You may also set ErrorLog and CustomLog.
- Create and edit homepage.conf the same way.
- Restart Apache2.
- Log in to the Typo3 admin panel.
- Go to Site Management/Sites, edit site configuration.
- On page General, set useful site identifier, e.g. phasenumkehr, set usefule title, set the etnry point to http://phasenumkehr.peter.local/ (watch for the railing slash).
- Choose an apropriate language for your site.
Getting Typo3 running on OpenSuSE Leap
Installing Typo3 should be straight and easy, but there are some details I had to touch.
- Be warned: The Typo3 installation routine does some checks, but you will not get error reporting for every possible error. You should at least check your (Apache) error log.
- The www root and any files therein should be writable for your Webserver.
- During Typo3 configuration, some values for PHP have to be changed. I had to encrease limits for memory and open files in /etc/php7/apache2/php.ini. As the installation script checks for it, there should be no problem.
- You have to check that all required apache modules get loaded. You find the list within /etc/sysconfig/apache2. I had to add
deflate rewrite filter headers to APACHE_MODULES=.
- For your server, you have to say
I edited /etc/apache2/default-server.conf for this.
- I changed ownership of the www root and the typo3 distribution accordingly to wwwrun.
- Of course, you should reload your apache after these edits.
- For some reason unknown to me, the default .htaccess file for Typo3 did not get copied to the document root, I had to issue
(issued from /srv/www, all in one line with no space between Resources/ and Private, but with space before htdocs).