- Joined
- Feb 2, 2011
- Messages
- 382
- Reaction score
- 200
Not really a tut but not a release either I guess.
I got bored today so I wrote a script that installs the server on either 32 / 64 ubuntu.
It will edit the table.xml and config.php for you!! so just follow on screen instructions
save as install.sh or whatever upload to / chmod it to 755 and run
or just download it.
It will install all needed files + pwAdmin and simple register page using lynx
Server files (MrKiller)
protocols used from iweb (Bola).
pwAdmin based off (DaMadBoy) fixed version.
make your own gshops I'm not doing everything....
could have made the code better but why bother, might even help the noobs Think!..... doubt it!! :/:
I got bored today so I wrote a script that installs the server on either 32 / 64 ubuntu.
It will edit the table.xml and config.php for you!! so just follow on screen instructions
save as install.sh or whatever upload to / chmod it to 755 and run
Code:
#!/bin/bash
installer32() {
ip=`/sbin/ifconfig|grep inet|head -1|sed 's/\:/ /'|awk '{print $3}'`
echo "INSTALLING FOR 32bit OS"
apt-get update
apt-get install -y openjdk-6-jre apache2 mysql-server php5 php5-mysql php5-curl phpmyadmin unzip lynx tomcat7
sleep 1
cd /
wget http://venom-games.com/downloads/PWServerFiles1.5.1v101.tar.gz
sleep 1
wget http://venom-games.com/downloads/reg.zip
tar xvzf PWServerFiles1.5.1v101.tar.gz
rm -R /var/www
unzip reg.zip
sleep 1
cd var/lib/tomcat7/webapps/
service tomcat7 stop
wget http://venom-games.com/downloads/pwadmin1.5.1.zip
unzip -o pwadmin1.5.1.zip
service tomcat7 start
echo "pwAdmin Access = http://"$ip":8080/pwAdmin/"
#CREATE AND IMPORT SQL DATABASE
rootpw=$(whiptail --title "Server Setup" --passwordbox "Enter the MySQL root password:" 8 78 3>&1 1>&2 2>&3)
dbname="pw"
dbuser=$(whiptail --title "Server Setup" --inputbox "Enter MySQL username:" 8 78 3>&1 1>&2 2>&3)
sleep 1
cd /home/SQL
mysql -h127.0.0.1 -u$dbuser -p$rootpw --force < pw.sql
if [ $? != "0" ]; then
echo "Error Database creation failed"
echo "Please manually insert DB from /home/SQL"
echo "Installer will now exit"
exit 1
else
sed -i 's/="PasswdForMySQL"/="'$rootpw'"/g' /etc/table.xml
sed -i 's/$DBName = "ZZZZZZ"/$DBName = "'$dbname'"/g' /var/www/conf.php
sed -i 's/$DBPassword = "YYYYYY"/$DBPassword = "'$rootpw'"/g' /var/www/conf.php
whiptail --title "Server Setup" --msgbox "Database has been created successfully" 8 78
fi
cd /home
chmod 755 chmod.sh
./chmod.sh
sleep 1
lynx http://localhost/index.php
echo "START SERVER? y/n "
read START
if [ "$START" == "y" ]; then
echo "starting"
./server start
else
exit
fi
}
export -f installer32
installer64() {
ip=`/sbin/ifconfig|grep inet|head -1|sed 's/\:/ /'|awk '{print $3}'`
echo "INSTALLING FOR 64Bit OS"
apt-get update
apt-get install -y openjdk-6-jre apache2 mysql-server php5 php5-mysql php5-curl phpmyadmin unzip lynx tomcat7
sleep 1
dpkg --add-architecture i386
apt-get update
apt-get install -y ia32-libs
cd /
wget http://venom-games.com/downloads/PWServerFiles1.5.1v101.tar.gz
sleep 1
wget http://venom-games.com/downloads/reg.zip
tar xvzf PWServerFiles1.5.1v101.tar.gz
rm -R /var/www
unzip reg.zip
cd var/lib/tomcat7/webapps/
service tomcat7 stop
wget http://venom-games.com/downloads/pwadmin1.5.1.zip
unzip -o pwadmin1.5.1.zip
service tomcat7 start
echo "pwAdmin Access = http://"$ip":8080/pwAdmin/"
sleep 1
#CREATE AND IMPORT SQL DATABASE
rootpw=$(whiptail --title "Server Setup" --passwordbox "Enter the MySQL root password:" 8 78 3>&1 1>&2 2>&3)
dbname="pw"
dbuser=$(whiptail --title "Server Setup" --inputbox "Enter MySQL username:" 8 78 3>&1 1>&2 2>&3)
sleep 1
cd /home/SQL
mysql -h127.0.0.1 -u$dbuser -p$rootpw --force < pw.sql
if [ $? != "0" ]; then
echo "Error Database creation failed"
echo "Please manually insert DB from /home/SQL"
echo "Installer will now exit"
exit 1
else
sed -i 's/="PasswdForMySQL"/="'$rootpw'"/g' /etc/table.xml
sed -i 's/$DBName = "ZZZZZZ"/$DBName = "'$dbname'"/g' /var/www/conf.php
sed -i 's/$DBPassword = "YYYYYY"/$DBPassword = "'$rootpw'"/g' /var/www/conf.php
whiptail --title "Server Setup" --msgbox "Database has been created successfully" 8 78
fi
cd /home
chmod 755 chmod.sh
./chmod.sh
sleep 1
lynx http://localhost/index.php
echo "START SERVER? y/n "
read START
if [ "$START" == "y" ]; then
echo "starting"
./server start
else
exit
fi
}
export -f installer64
oIFS="$IFS";
IFS="/"
LIST="32Bit/Ubuntu/64Bit/Ubuntu"
while true; do
RESULT=$(whiptail --title "Server Setup" --menu "Select OS" 10 30 2 --cancel-button Quit $LIST 3>&1 1>&2 2>&3)
RET=$?
if [ $RET -eq 1 ]; then
echo "Cancel"
exit 0
elif [ $RET -eq 0 ]; then
if [ "$RESULT" == "32Bit" ]; then
installer32
exit 0
fi
if [ "$RESULT" == "64Bit" ]; then
installer64
exit 0
fi
elif [ $RET -eq -1 ]; then
exit 0
fi
done
IFS=$oIFS
or just download it.
You must be registered to see links
It will install all needed files + pwAdmin and simple register page using lynx
Server files (MrKiller)
protocols used from iweb (Bola).
pwAdmin based off (DaMadBoy) fixed version.
make your own gshops I'm not doing everything....
could have made the code better but why bother, might even help the noobs Think!..... doubt it!! :/: