Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

FixPermissionsSh

Oliver Salzburg edited this page Mar 14, 2013 · 1 revision

Introduction

The main purpose of fixPermissions.sh is to fix access permissions to files of a TYPO3 installation.

Arguments

$ ./fixPermissions.sh --help
  Usage: ./fixPermissions.sh [OPTIONS]

  Core:
  --help              Display this help and exit.
  --verbose           Display more detailed messages.
  --quiet             Do not display anything.
  --force             Perform actions that would otherwise abort the script.
  --update            Tries to update the script to the latest version.
  --update-check      Checks if a newer version of the script is available.
  --export-config     Prints the default configuration of this script.
  --extract-config    Extracts configuration parameters from TYPO3.
  --base=PATH         The name of the base path where TYPO3 is
                      installed. If no base is supplied, "typo3" is used.

  Options:
  --owner=OWNER       The name of the user that owns the installation.
  --httpd-group=GROUP The user group the local HTTP daemon is running as.
  --fix-indexphp      Replaces the index.php symlink with the actual file.

Overview

For general information regarding the configuration of scripts in the typo3scripts suite, please see the article about Configuration.

Command Line Parameters

  • --help

    Prints the output seen above, giving an overview of available command line parameters.

  • --verbose

    Enable verbose (more detailed) output.

  • --quiet

    Reduced verbosity (less detailed) output.

  • --force

    Perform actions that would otherwise stop execution.

  • --update

    Invokes the self-updating mechanism in this script. This will download the latest release version from the official source code repository and replace your current script.

    Note: To perform a quick check if a new version is available, run fixPermissions.sh with the --update-check parameter. If a new version is found online, the following message will be printed to the standard output:

    NOTE: New version available!
    

    In previous versions, this check would be performed every time you run the script.

  • --export-config

    Print the default configuration of the script to the standard output.

    This allows for easy generation of a default config file, like so:

      $ ./fixPermissions.sh --export-config > typo3scripts.conf
    
  • --extract-config

    Tries to read the database-related parameters out of the TYPO3 configuration file.

    This allows for easy generation of a base config file for other typo3scripts after you have completed your TYPO3 installation.

      $ ./fixPermissions.sh --extract-config > typo3scripts.conf
    

    In case you're using a non-default TYPO3 installation directory, make sure to supply the --base parameter before the --extract-config parameter.

      $ ./fixPermissions.sh --base=myt3site --extract-config > typo3scripts.conf
    

    Note: This functionality is currently not compatible with TYPO3 6.0 configuration file format.

  • --base / BASE

    By default, it is assumed that the TYPO3 installation is located in a sub-folder relative to the current working directory, named typo3. Use --base if the installation is placed in a differently named sub-folder.

      $ ./fixPermissions.sh --base=myt3site
    
  • --owner / OWNER

    The new file owner of the files inside the TYPO3 installation. By default, the user who invoked the script is used for this value.

      $ ./fixPermissions.sh --owner=oliver
    
  • --httpd-group / HTTPD_GROUP

    The is intended to be the group of the web server. For example, under Debian, Apache HTTPD would be running under the group www-data. Thus, it would be preferable to have certain files accessible to that group. www-data is also the default value for this setting.

      $ ./fixPermissions.sh --httpd-group=apache
    

Examples

Installation

/var/www$ cd t3site/
/var/www/t3site$ wget https://raw.github.com/oliversalzburg/typo3scripts/master/fixPermissions.sh
/var/www/t3site$ chmod 700 fixPermissions.sh

Fixing permissions of an installation

oliver@t3s$ sudo ./fixPermissions.sh
Checking dependencies...Succeeded.
Changing ownership of 'typo3' to 'oliver'...Done
Changing owning group of essential TYPO3 folders to 'www-data'...Done
Changing access permissions for essential TYPO3 folders...Done
Fixing access to common files...Done
Fixing access to TYPO3 source packages...Done

This example assumes that you previously created a configuration file typo3scripts.conf to share between scripts. Please see the article about Configuration for more information.