2

I would like to run a LAMP server with a webmin interface on my raspberry pi.

I am running the latest Raspbian. I have found some packages useful for parts of this, such as:

sudo apt-get install apache2 php5 mysql-server

...but I'm sure there should be more involved than that.

As for webmin, I tried the obvious:

sudo apt-get install webmin

..but it did not appear to find a package. I see that sourceforge has a .deb package up here:

http://sourceforge.net/projects/webadmin/files/webmin/1.720/

Can I install webmin on the Pi from the .deb package? And can I do it from the command line and completely from the Pi from SSH?

I would like it to be easy to install this entire LAMP / webmin setup on a fresh Raspberry Pi at will, as I like to experiment a lot. So, how can I write a bash shell script to automatically install the LAMP stack and webmin into a functional state? What is required?

NOTE: I have discovered how to do this and am going to share by answering my own question, below.

ChrisPrime
  • 458
  • 1
  • 6
  • 13

2 Answers2

2

In case anyone was interested, I've gotten this install script from my friend to work on my current vanilla Raspbian install. Plus, ascii art!:

echo $"
        _________
       d         b
      d           b
     d             b
    d               b
   d                 b
    ''':::.....:::'''
           fff
         .'   '.
        ^       ^.'--.
        b       d     ,
         czzzzzd       ..oOo

LAMP (Top-of-Stack) Installer by Circuit
"
sudo groupadd -f -g33 www-data
sudo apt-get -y update
sudo apt-get -y install apache2 php5 libapache2-mod-php5
sudo apt-get -y install mysql-server mysql-client php5-mysql
sudo apt-get -y install phpmyadmin
sudo apt-get -y install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python libapt-pkg-perl
wget http://downloads.sourceforge.net/project/webadmin/webmin/1.720/webmin_1.720_all.deb
sudo dpkg --install webmin_1.720_all.deb

Then I can access the interface by going to any web browser on my wifi network and typing:

https://raspberrypi.local:10000

Then log in with the default raspberry pi credentials (or whatever you changed them to):

user: pi 
password: raspberry

Enjoy webmin awesomeness! Be warned, it eats up a fair amount of CPU cycles when you access various pages in webmin :)

ChrisPrime
  • 458
  • 1
  • 6
  • 13
2

I had a similar script that actually does the same as yours but on RHEL6 (Red Had Linux 6)

In addition there are prompts for if you want to install Ruby on Rails and Java JDK 1.7. Now with LAMP ASCII art header. (for fun)

#!/bin/bash

echo $"
         _________
        d         b
       d           b
      d             b
     d               b
    d                 b
     ''':::.....:::'''
            fff
          .'   '.
         ^       ^.'--.
         b       d     ,
          czzzzzd       ..oOo

LAMP (Top-of-Stack) Installer by Circuit
" 

echo "
Installing Apache Server
"
sudo yum install httpd

echo "
Starting Apache Server
"
sudo service httpd start

echo "
Opening Port :80 on Apache Firewall
"
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo /sbin/service iptables save

echo "
Restarting Firewall for Changes to Take Effect
"
sudo service iptables restart

echo "
Installing MySQL
"
sudo yum install mysql

echo "
Installing PHP
"
sudo yum install php php-mysql

# Above Ends L(AMP) install. This section is additional common Linux Server Programs

selection=
until [ "$selection" = "0" ]; do
    echo ""
    echo "LAMP INSTALLED. CONTINUE WITH ADDITIONAL SOFTWARE?"
    echo "1 - Yes, Continue with Additional Install"
    echo "2 - No, Exit Installer"
    echo ""
    echo -n "Enter selection: "
    read selection
    echo ""
    case $selection in
        1 ) 
echo "Installing Ruby on Rails"
sudo yum install ruby
sudo yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel
sudo yum install ruby-rdoc ruby-devel
sudo gem update
sudo gem update --system
sudo gem install rails

#Install Java JDK (1.7)
sudo yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel 

# Set Java Home
export JAVA_HOME=/opt/java/jdk_1.7.0/
export PATH= ${PATH}:{JAVA_HOME}/bin
;;
        2 ) exit ;;
        * ) echo "Please enter 1, or 2"
    esac
done
  • 2
    Ooh, that's fancy! I might just use this on my laptop Linux... thank you! – ChrisPrime Dec 13 '14 at 09:55
  • 1
    I just realized my script doesn't have the install for Webmin on RHEL6, so I will try to add that next time I have a good test machine. Glad it worked for you –  Dec 13 '14 at 17:04