Results 1 to 4 of 4

Thread: Moving Contao to different Server

  1. #1
    New user
    Join Date
    11-26-15.
    Posts
    3

    Default Moving Contao to different Server

    Hi,

    I'm new to Contao and have 'inherited' a few Contao websites to manage. I had to move one website to a different Server (from Centos 6.7 to another Centos 6.7), and since this is a highly customised site I thought it would be easiest to migrate the whole Contao directory, including DB, as explained in the 'Moving an installation' section of the installation guide. Since testing the site on the new server, the site works, but not it's customised site layout. I check all the necessary environment stuff, PHP , nginx etc. can't see a problem there, nor is there anny problem in the logs.
    I ran the Contao check tool, and it tells me something about 'safe hack mode'. I have not been using ftp, and do not want to use it. What is this safe hack mode, and which directories does Contao needs to write to? I already gave 777 permissions to
    assets/images
    assets/images/*
    system/logs
    system/tmp

    This is the output of the check:
    ~~~~~~
    PHP 5.3.3
    You can install Contao 2.x
    You can install Contao 3.x
    Requirements
    You can use the Extension Repository. More information …
    You can use the Live Update. More information …
    You do need the Safe Mode Hack. More information …
    ~~~~~~

    More Information:
    ~~~~~~
    php.ini settings
    The PHP safe_mode is not enabled.
    Creating a test folder
    The test folder could not be created.
    It seems that the PHP process does not have enough permissions to create folders on your server.
    Creating a test file
    The test file could not be created.
    It seems that the PHP process does not have enough permissions to create files on your server.
    You do need the Safe Mode Hack on this server.
    ~~~~~~

    So which exact test folder and file could not be created, and which permissions need changing? Is there any other reason why the custom layout isn't working on the new server?
    Any help with this would be greatly appreciated!

    Chris

    BTW this is Contao 3.2.4

  2. #2
    New user
    Join Date
    11-26-15.
    Posts
    3

    Default

    Ok I made some progress. I solved the safe mode hack thing by giving the permissions to the correct user (user 'apache' is being used, but this is nginx!)
    I then realised that the reason for the layout problems are missing css files. After solving the permissions issues though, the correct css fies were created in the assets/css directory, and the layout problems are solved.
    However, now all links on the site do not work, for example if I go from the main page to Contact. Instead the page comes up with 'No input file specified.'
    Don't know much about php. Any ideas anyone why this might be happening? On the old server this all works fine.

  3. #3
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,300

    Default

    Hi,

    try to switch to PHP-FPM (PHP FastCGI Process Manager) and run the PHP process through FastCGI in the context of an (FTP) user. That should fix the problems with the write permissions.

    https://kirsten-roschanski.de/files/...onferenz-2014/
    Contao Community Moderator
    → Support options

  4. #4
    New user
    Join Date
    11-26-15.
    Posts
    3

    Default

    Hi xchs, many thanks for your reply! I am running php fpm, and managed to sort out the write permission issues. New CSS files are now being written and the landing page of the site is working correctlly now.
    But when I try to access a different part of my site, I get a simple text page 'No input file specified.' . I know this has to do with the path of the php files not being properly passed to php-fpm. When I set cgi.fix_pathinfo=1 in php.ini, it works (which I don't want to have permanently). I can't figure out how to make this work, my current nginx config is like this:

    server {
    listen *:80;
    server_name contao.blahblah.eu;

    location / {
    root /var/www/html/core-3.2.4/;
    index index.php;
    location ~ ^/.*\.html$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    }
    location ~ ^/.*\.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    }
    }
    }

    I tried adding stuff to the fastcgi_param line, for example: 'fastcgi_param SCRIPT_FILENAME $document_root$request_filename;' , but then even the landing page doesn't work anymore.
    Any ideas anyone where I'm going wrong here?

    Thanks,
    Chris

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •