Shell-script: Installation in 10 sec.

Hi there, since I was recently introduced into all the benefits from shell access, I wrote a little shell script that sets up a fresh phpwcms v 1.4.1 within seconds :) Of course you still need to run the online-setup routine afterwards since it creates the admin user and sets some basic variables. But if you have shell access, this script might spare you approx. 20 minutes!! :-) :-) :-)

Docu: –
Forum: (Shell) Script: Installation in under 10 seconds

Autor: phalancs (08.05.09) –> treated: K.Heermann (flip-flop) (08.05.09)
CMS-version: >= V1.4.1
Script-version: V1.0 (08.05.09)

fileiname: phpwcms_install.sh

Location: user root

Condition: → You need a account with executable shell scripting




This what the script does in detail:

  1. It asks in which subfolder the installation should go
  2. It automatically downloads the (latest) phpwcms 1.4.1 version from google code
  3. It unpacks phpwcms into the subfolder
  4. It sets all the necessary file and folder rights
  5. It deletes the downloaded package

Shell Skript

    #!/bin/sh

    clear
    echo "================================================="
    echo "THIS WILL INSTALL PHPWCMS V.1.4.1"
    echo ""
    echo "Be sure to have the p7zip package installed"
    echo "Otherwise use this command as root: apt-get install p7zip"
    echo "================================================="
    echo ""
    echo "press any key to continue"
    read
    echo ""
    echo "TYPE SUBFOLDER NAME (no quotes or slashes):"
    echo "Installation will start immediately afterwards"
    echo "=============================================="
    read SUBF
 
    clear
    echo "======================================"
    echo "DOWNLOADING PHPWCMS VERSION 1.4.1 r307"
    echo "======================================"
    echo ""
 
    mkdir $SUBF
    cd $SUBF
    wget http://phpwcms.googlecode.com/files/phpwcms_r307.7z
    p7zip -d phpwcms_r307.7z
    mv phpwcms_r307/* .
    rm phpwcms_r307 -r
 
    clear
    echo "==============================="
    echo "SETTING FILE- AND FOLDER-RIGHTS"
    echo "==============================="
    echo ""
    echo "This might take a moment..."
 
    find . -type d -exec chmod 0755 {} \;
    find . -type f -exec chmod 0644 {} \;
 
    cd ..
 
    chmod 777 $SUBF/upload
    chmod 777 $SUBF/filearchive
    chmod 777 $SUBF/filearchive/can_be_deleted
    chmod 777 $SUBF/template
    chmod 777 $SUBF/content
    chmod 777 $SUBF/content/images
    chmod 777 $SUBF/content/gt
    chmod 777 $SUBF/content/form
    chmod 777 $SUBF/content/rss
    chmod 777 $SUBF/content/tmp
    chmod 777 $SUBF/content/pages
    chmod 777 $SUBF/template/template_lang
    chmod 666 $SUBF/setup/setup.conf.inc.php
    chmod 666 $SUBF/template/inc_css/frontend.css
    chmod 666 $SUBF/config/phpwcms/conf.indexpage.inc.php
    chmod 666 $SUBF/template/inc_default/startup.php
 
    clear
    echo "==================================="
    echo "SUCCESS! SETUP DONE!"
    echo ""
    echo "NOW CONTINUE USING THE WEBINSTALLER:"
    echo "yourdomain.tld/$SUBF/setup/setup.php"
    echo "==================================="
    echo ""

How to use:

  1. Copy script to a file called phpwcms_install.sh
  2. Upload to the users root
  3. Set the script to 777 and execute via shell using this command ./phpwcms_install.sh

<note>Since there might issues if you upload a shell script edited on a windows system to a linux server you might sometimes get the following error: bad interpreter: No such file or directory
See this hint for a quick remedy :-D
http://www.devdaily.com/blog/post/linux-unix/shell-script-error-bad-interpreter-no-such-file/ </note>

<note>You need a 7zip extractor to extract the package, use this command as root to get one: apt-get install p7zip </note>

english/other-enhancements/installation/installation-with-shell-script.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0