{{indexmenu_n>20}}
====== Shell-Script: Installation in 10 Sek. ======
Hallo,
Seit ich vor kurzem die Möglichkeiten der Shell Programmierung kennengelernt habe, schrieb ich ein kleines Shell-Skript mit dem innerhalb von Sekunden eine neue phpwcms V 1.4.1/2 Installation durchgeführt werden kann. :-)
Selbstverständlich muss danach noch das Setup ausgeführt werden, da hier der admin-Benutzer und einige Grundeinstellungen erzeugt werden. Wenn ein Shellzugang vothanden ist lassen sich etwa 20 Minuten Zeit sparen!! :-) :-) :-)
Docu: -- \\
Forum: [[http://forum.phpwcms.org/viewtopic.php?f=8&t=18791|(Shell) Script: Installation in under 10 seconds]]
**Autor:** [[http://www.enym.com/|phalancs]] (08.05.09) -> // aufbereitet: [[http://planmatrix.de|K.Heermann]] (flip-flop) (05.05.09)// \\
**CMS-Version:** >= V1.4.1 \\
**Version:** V1.0 //(08.05.09)// \\
Dateiname: **phpwcms_install.sh**
Ort: **user root **
**Bedingung:** -> Shell Skripte müssen ausführbar sein \\
----
----
\\
===== Das tut das Skript im Detail: =====
- Es fragt nach, in welchem Unterordner die Installation geschehen soll
- Es lädt automatisch die (letzte) phpwcms 1.4.1 Version fon google code
- Es entpackt phpwcms in den Underordner
- Es setzt alle notwendigen Datei- und Verzeichnisrechte
- Es löscht das heruntergeladene Paket
#!/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 ""
\\
===== Wie wird es genutzt: =====
- Kopiere das Skript in eine Datei mit dem Namen **phpwcms_install.sh**
- Heraufladen (upload) in user root
- Setze die Rechte des Skript auf 777 und führe es via Shell command **./phpwcms_install.sh**
FIXME translate
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/]]
You need a 7zip extractor to extract the package, use this command as root to get one:
**apt-get install p7zip**