{{indexmenu_n>20}}
====== 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: [[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) // --> treated: [[http://planmatrix.de|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:
- It asks in which subfolder the installation should go
- It automatically downloads the (latest) phpwcms 1.4.1 version from google code
- It unpacks phpwcms into the subfolder
- It sets all the necessary file and folder rights
- It deletes the downloaded package
#!/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: =====
- Copy script to a file called **phpwcms_install.sh**
- Upload to the users root
- Set the script to 777 and execute via shell using this command **./phpwcms_install.sh**
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**