Auto Installer Apache + PHP + MySql + Webmin | By your self

Posted by Abonk on Mon, 07/30/2012 - 06:51

menghilangkan kejenuhan, menjadi junker capek juga ternyata.. hehe
berikut ini adalah sebuag bash script sederhana untuk installasi vps sehingga ga repot2 ngetik perintah installasi ketika reload OSnya vps (terutama yang rajin utak-atik vps hehe).

simpanlah dengan nama sembarang.sh,
untuk menjalankannya di chmod 777 sembarang.sh
eksekusi dengan perintah ./sembarang.sh

baiklah ini dia scriptnya :

 

#!/bin/bash
# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: anda harus login sebagai  root untuk menjalankan script ini"
    exit 1
fi

clear
echo "=============================================================="
echo "hehe script for CentOS/RadHat Linux VPS  Written by Abonk"
echo "=============================================================="
echo "Script sederhana installasi Apache+MySQL+PHP di Linux         "
echo ""
echo "=============================================================="
cur_dir=$(pwd)

if [ "$1" != "--help" ]; then

rpm -qa|grep  httpd
rpm -e httpd
rpm -qa|grep mysql
rpm -e mysql
rpm -qa|grep php
rpm -e php

yum -y remove httpd*
yum -y remove mysql*
yum -y remove php*

yum -y install yum-fastestmirror
yum -y remove httpd
cat >/etc/yum.repos.d/webmin.repo<<eof
[Webmin]
name=Webmin Distribution Neutral
baseurl=http://download.webmin.com/download/yum
enabled=1
eof
cat >/etc/yum.repos.d/centos-testing.repo<<eof
[CentALT]
name=CentALT Packages for Enterprise Linux 5 - $basearch
baseurl=http://centos.alt.ru/repository/centos/5/$basearch/
enabled=1
gpgcheck=0
eof

rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarc...
rpm --import http://www.webmin.com/jcameron-key.asc
yum -y update

yum -y install httpd mod_ssl
yum -y install php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
yum -y install mysql mysql-server mysql-devel
yum -y install webmin

cat >/var/www/html/abonk.php<<eof
<?php
phpinfo();
?>
eof
service httpd start
service mysqld start

echo "========================== Check install ================================"
echo "Install Apache+php+webmin completed! enjoy it."
echo "========================================================================="
echo "hehe script for CentOS/RadHat Linux VPS  Written by Abonk"
echo "========================================================================="
echo ""
echo "For more visit http://www.kaskus.co.id/forumdisplay.php?f=13"
echo ""
echo "phpinfo        : http://yourip/abonk.php"
echo "webmin address : http://yourip:10000/"
echo "web dir        : /var/www/html/"
echo ""
echo "========================================================================="
fi
 
 

Sekian Terimauang
 

 

Kategory: