Jump to content

Recommended Posts

Posted (edited)

Why not writing a script for LAMP.
Why not writing a script for VPN
Why not writing a script for iptables
Why not writing a script for whatever
simple copy & paste, the UNIX way, one task, one program
 
The LAMP script I modded a bit does work for the Kernel 3.4.108 - it runs smoothly on the R1.

#!/bin/bash

# author: Martin Clauß - mc@informatik.uni-leipzig.de
# created: July 14 2013

# This script is based on this tutorial: http://community.linuxmint.com/tutorial/view/486

# cd into the directory where you saved it, make it executable by:
# chmod +x LAMP_install.sh
# start it with: sudo ./LAMP_install.sh

echo "********************************"
echo "    LAMP installation script"
echo "********************************"


if [[ $UID -ne 0 ]];
then
	echo "You must be root to run this script. Exiting..."
	exit 1
fi

echo "********************************"
echo "    install Apache"
echo "********************************"

apt-get install apache2

if ! wget -q "http://localhost"
then
	echo "Apache not running. Exiting..."
	exit 1
fi

echo "********************************"
echo "    install PHP"
echo "********************************"

apt-get install php5 libapache2-mod-php5

/etc/init.d/apache2 restart

# this few lines will test if PHP and Apache is running

echo "<?php phpinfo(); ?>" > /var/www/testphp.php

if ! wget -q "http://localhost/testphp.php"
then
	echo "Cannot open testphp.php. Exiting..."
	rm /var/www/testphp.php
	exit 1
else
	if [[ $(wget -q -O - "http://localhost/testphp.php" | grep -i php) == "" ]]
	then
		echo "PHP is not running correctly. Exiting..."
		# rm /var/www/testphp.php
		exit 1
	fi
fi
# uncomment this if you want to remove the testfile
# rm /var/www/testphp.php

echo "********************************"
echo "    install mySQL Server"
echo "********************************"

apt-get install mysql-server

# password will be set during the mysql-server installation

echo "********************************"
echo "    install phpMyAdmin  "
echo "********************************"

apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

sed -i "s/;extension=mysql.so/extension=mysql.so/" /etc/php5/apache2/php.ini

/etc/init.d/apache2 restart

if [[ $(grep -i "Include /etc/phpmyadmin/apache.conf" /etc/apache2/apache2.conf) == "" ]]
then
	echo -e "\nInclude /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
fi

if ! wget -q "http://localhost/phpmyadmin"
then
	echo "phpmyadmin is not running. Exiting..."
	exit 1
fi

echo "Installation complete :)"
Edited by Tido
Posted

I setup an IPsec VPN on the lamobo, but now I cannot see DLNA on my iphone while remote, only in the local network. Out of curiosity, has anyone managed to setup minidlna working at the same time, but in the local and in the VPN network? I will give it a try again later on.

Posted

Yep tkaiser, it is LAN-only, some people claim that they got it to work in VPNs, however maybe they are confused while using the VPN service in their home network. I might make the multimedia files available in the VPN through HTTP

Posted

it is LAN-only, some people claim that they got it to work in VPNs, however maybe they are confused while using the VPN service in their home network. I might make the multimedia files available in the VPN through HTTP

 

Protocols relying on link local addresses and multicast shouldn't work over VPN connections by design.

 

I recently searched for a way to announce 5 camera live streams and a bunch of videos encoded before via UPnP and ended up with something called 'xupnpd' (runs on ARMv7/A20). I use the following code to provide one playlist containing the 5 livestreams:

	PlayList=/usr/local/xupnpd/src/playlists/playlist.m3u
	StartPort=8551
	StreamFolder="${StreamBase}/$(date "+%Y-%m-%d")"
	
	echo -e "#EXTM3U name=\"Live\"" >"${PlayList}"
	sleep 1
	
	grep -v "#" /var/run/pispy.lst | while read ; do
		set $REPLY
		Hostname=$1
		Address=$2
		
		# create playlist entry
		echo -e "#EXTINF:0 type=h264 ,${Hostname}\nrtsp://${MyAddress}:${StartPort}/${Hostname}" >>"${PlayList}"
		
		# create stream file
		if [ ! -d "${StreamFolder}" ]; then
			mkdir -p -m2777 "${StreamFolder}"
		fi
		StreamName="${TimeNow}-${Hostname}.h264"
		StreamFile="${StreamFolder}/${StreamName}"
		
		/usr/local/pispy/record-and-transcode-stream.sh ${Hostname} ${Address} "${StreamFile}" ${StartPort} &
		
		StartPort=$(( ${StartPort} + 1 ))
	done

All previous recordings are converted to .mp4 files and then I let another script also create playlist for all these files. The skeleton looks like this (just to give you an idea how the .m3u files should look like since this took me some time):

	PlayList="${TempDir}/record-${i}.m3u"
	((i++))
	# check whether it's today
	Today="$(date "+%Y-%m-%d")"
	if [ "X$FolderName" = "X${Today}" ]; then
		echo -e "#EXTM3U name=\"Aufzeichnungen Heute\"" >"${PlayList}"
	else
		echo -e "#EXTM3U name=\"Aufzeichnungen ${FolderName}\"" >"${PlayList}"
	fi
	find "${StreamBase}/${FolderName}" -name "*.mp4" | sort | while read ; do
            ...
            echo -e "#EXTINF:0 event=reload ,${ClipName}\nfile://${StreamBase}/${FolderName}/${FileName}" >>"${PlayList}"
	done

Maybe you can use xupnpd as some sort of proxy providing SSDP multicast announcements at the other side of the VPN connection?

Posted

I am actually wrote a very basic script to generate HTML5 and some srt conversion to vtt to stream films via a browser. I will later try to read with more attention your post, thanks for the ideas.

Posted

Hello,

 

I test it and When I install apache, php ... I've got this error :

 

"E: Package 'libapache2-mod-suphp' has no installation candidate"

 

Thanks

Posted

I setup an IPsec VPN on the lamobo, but now I cannot see DLNA on my iphone while remote, only in the local network. Out of curiosity, has anyone managed to setup minidlna working at the same time, but in the local and in the VPN network? I will give it a try again later on.

Isn't DLNA device discovery based on SSDP and works therefore only with link local addresses in the LAN?

Protocols relying on link local addresses and multicast shouldn't work over VPN connections by design.

Hm - maybe I misconfigured something somewhere, but I am using minidlna on my banana pi via VPN when I am not at home for quite a while now without any problems. IPsec VPN is not setup on the banana pi, but on my Router (it is a fritz.box 7390).

Service-discovery works only when I am at home in my LAN but once the client (I use iPhone and iPad with an app called nPlayer) is configured - I can access my media files via dlna when I am physically not at home but connected via VPN.

I don't think I did anything special in configuring minidlna and I am willing to share the settings of my /etc/mindlna.conf if someone is interested...

Posted

Where did you install this? Debian Jessie, Wheezy, Trusty, ... ? arm, arm64, amd64, x86 ?

 

Hello,

 

I install in Jessie, in my arm board....

Posted

i want to load a script at boot time using the instructions provided at this site: http://tutos.readthedocs.io/en/latest/source/ndg.html

If it is working, it’s great! Now we’ll daemonize it by using systemd. Of course you can use another init system (like Ubuntu upstart. Just search for “how to run script after bootâ€.

Create new service file /usr/lib/systemd/system/gunicorn_ourcase.service and insert this:

[Unit]
Description=Ourcase gunicorn daemon

[Service]
Type=simple
User=nginx
ExecStart=/var/www/test/gunicorn_start.sh

[Install]
WantedBy=multi-user.target

now enable it as with other units:

systemctl enable gunicorn_ourcase


but when i want to run the command systemctl enable gunicorn_ourcase it prompts:

Failed to execute operation: No such file or directory

when i add the --user switch, this error will occure: Failed to get D-Bus connection: Connection refused
 

what is the problem with the command and what can i do?

Posted

This install script was originally designed for Debian Wheezy, while I do use it on Debian Jessie but ... with nginx so I could not notice this problem. Xenial ... don't know. 

Do you use Jessie or Xenial base?

 

BTW: this module is optional, so let's remove it.
https://www.howtoforge.com/tutorial/perfect-server-debian-8-jessie-apache-bind-dovecot-ispconfig-3/2/

 

Exits only in wheezy

https://packages.debian.org/search?keywords=libapache2-mod-suphp

I am not sure if it's safe to restart the installation ... clean install is better way, after fix ... or simply use ngix. It's working. This forum is a working example :)

Posted

This install script was originally designed for Debian Wheezy, while I do use it on Debian Jessie but ... with nginx so I could not notice this problem. Xenial ... don't know. 

 

Do you use Jessie or Xenial base?

 

BTW: this module is optional, so let's remove it.

https://www.howtoforge.com/tutorial/perfect-server-debian-8-jessie-apache-bind-dovecot-ispconfig-3/2/

 

Exits only in wheezy

https://packages.debian.org/search?keywords=libapache2-mod-suphp

I am not sure if it's safe to restart the installation ... clean install is better way, after fix ... or simply use ngix. It's working. This forum is a working example :)

I use Jessie I try to make server with an orange pi zero 256mb, is that possible. I dont use never nginx  (only apache :D ) well I try to 'clean install'  how can I do it? If I would like to create a wordpress blog, is this viable with orange pi zero?

 

thanks

Posted

This script install Ispconfig which is a powerful and complex tool. It's not just web server. It would be better it you start with some generic Debian / Ubuntu how to. It's exactly the same. If you are running our Debian Jessie, google for "Debian Jessie webserver howto" "Debian Jessie apache howto" or similar.

Posted

I there i can install ispconfig in orangepi zero 512mb ram but after that i can´t reach it i use x.x.x.x:4000 and nothing heapend

Any help?

 

Last time I was installing it to Debian Jessie - few months ago, it was working normally.

 

In case of troubles - check logs and read documentations. There are no quick solutions: 

 

Note that ISPconfig is a complex and powerful tool. I also need to read manual if things broke: http://www.ispconfig.org/get-support/

 

If you need just a web server wih php and perhaps sql, check those tutorials: https://www.digitalocean.com/community/tutorials

Posted

Added to nightly builds from tomorrow. 

 

login and type 

armbian-config

 

Need testing and ideas. 

Posted
58 minutes ago, Igor said:

Need testing and ideas. 

In the future - merge armbianmonitor, h3disp, sunxi-musb (if it is still actual) into this tool and implement similar tasks (switching host/OTG mode, switching display resolution) where it is possible (i.e. with mainline u-boot environment can be edited from the OS using fw_setenv) . Backwards compatibility can be achieved by using symlinks with names for older tools and using basename $0 to check how the tool was executed.

Posted
9 hours ago, Superkoning said:

https://github.com/igorpecovnik/Debian-micro-home-server/tree/dev does not contain armbian-config, but debian-config (which contains the same code). So ... how should I send a Pull Request?


This is it. It's only renamed upon install. The idea behind is to develop generic architecture independent installer and config with build in special things for Armbian, when used within.

Yes, there are typos and bugs to hunt down and it's better if this is done by somebody else but me. I can overlook even most obvious one at this stage :) 

 

Edit: If someone has time - we could move up a little. Instead of toggling we could provide adjusted text related to reality:

Wireless - connect to your router / Wireless - disconnect from your router

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines