Skip to main content

Your OwnCloud Server on your Hyper-V – scrap dropbox

Do you want to create your own owncloud server with LVM support and easy updates through packages? Here is an easy guide (Note that Azure VMs do not come with LVM preinstalled on Ubuntu, so this guide is only for on-premise Hyper-V as far as the extension of the disk goes):

Collect information :
External IP to be used :
Internal IP to be used : 192.168.x.x
Ports to be forwarded to the LAN : 80,443,10000 (10000 for webmin administration)
Certificate to be used for secure communication : owncloud.yourdomain.com
Subdomain to be used for access : owncloud.yourdomain.com
Username : adminusername
Password :
Mysql Root Password :
owncloud username : adminusername
owncloud password :
owncloud mariadb database : owncloud
owncloud mariadb username : adminusername
owncloud mariadb password :
Download Software :
http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso

Install :
Create a new HyperV Virtual Machine named : owncloud.yourdomain.com
Install Ubuntu using the above ISO and configuring networking and usernames/password as above using the installation
wizard. Make sure to select the OpenSSH server in the end. (all the other steps just hit enter)
Connect to port 22 (ssh) on the server using putty or similar.
Run the following commands :
+++++++++++++++++++++++++++++++++++++++
sudo -s
nano /etc/apt/sources.list

—————
#Add the following lines in the end of the file :
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
—————-
#Hit ctrl+O
#Hit ctrl+X
cd /root
wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
apt-get update
apt-get install webmin
cd /tmp
wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
sudo apt-key add – < Release.key
sudo sh -c “echo ‘deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /’ >>
/etc/apt/sources.list.d/owncloud.list”
apt-get update
apt-get install owncloud
apt-get install mariadb-server
mysql -u root -p

——————–
#On the mariadb prompt enter :
CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to ‘owncloud’@’localhost’ IDENTIFIED BY ‘ENTER REQUIRED PASSWORD HERE‘;
exit
——————–
sudo apt-get update && sudo apt-get upgrade
sudo apt-get update && sudo apt-get install owncloud
echo “<meta http-equiv=’refresh’ content=’0;url=/owncloud’ />” > /var/www/html/index.html

++++++++++++++++++++++++++++++++++++++
Go to http://ipaddress
Enter the credentials for the first user as chosen in the collection section of this article.
Where it says Storage and database, select : MySQL/MariaDB
Enter database user,password, and database name as above, leave localhost in the end.
Finish setup

You are done. Go login

 

Adding an extra 1 TB disk 

Extend the disk by attaching new VHDs
Shutdown the VM
Add an extra disk using hyperv manager (a new scsi disk of size : 1 TB)

#Login to ssh using putty
echo “- – -” > /sys/class/scsi_host/host0/scan
fdisk -l
#Identify the disk , for example it will be /dev/sdb. Then continue (this tutorial assumes sdb)
fdisk /dev/sdb
n
p
hit enter
hit enter
hit enter
t
8e
w
pvcreate /dev/sdb1
vgdisplay
#note the volume name thing. Mine looks like cloud-vg. use this for next steps
vgextend cloud-vg /dev/sdb1
pvscan
lvdisplay
lvextend /dev/cloud-vg/root /dev/sdb1
resize2fs /dev/cloud-vg/root

 

RTMP HLS nginx php Server – The easy way

Tired of paying for Wowza media server? Unreal media server?
Tired of trying to find a decent tutorial on how to build your own nginx rtmp server with php and hls support?
UPG.GR has the solution for you with a few easy steps (as usual)
*Note that a referral link to digital ocean is included in this article that will grant you 10$ of credit to try for free with no obligations

If you are an advanced linux user and have your own linux box, just run the following command on any Ubuntu and your done! : curl -sL https://raw.githubusercontent.com/upggr/UPG.GR-MEDIA-SERVER/master/nginx.sh | sudo bash –

Step 1
Go to digital ocean and get a free account with 10$ credits (to use for a month)

1

Step 2

Enter your email and select a password

2

 

Step 3

Activate your account and login to get your free credit

3

 

Step 4

Create a new droplet

4

Step 5

Select the 10$ a month droplet. This will be enough for testing and for about 100 concurrent users. Enter the subdomain of a domain you control For example if you have a domain upg.gr enter “streamer.upg.gr”. If you do not have domain just enter there whatever and you will access your server with the ip you will be provided.

5

Step 6

Select a country near you.

6

Step 7

Select your favorite UBUNTU distro. Watch this space for a Centos tutorial – request it in the comments and I ll do it for you.

7

Step 8

Create droplet :

8

Step 9

Wait for your droplet to be created

9

Step 10

Check your email for your login credentials

10

Step 11

In the meantime go your registra or dns server to map the subdomain you chose to the ip of the server you got in your email. In my example I am using the free tier of cloudflare to manage my dns (http://cloudflare.com)

11

Step 12

Go back to digital ocean and start the console (or just putty to the ip on port 22 and authenticate)

12

 

13

 

Step 13

Login using the credentials you are provided in your email

14

Step 14

Enter “sudo -s”

15

Step 15

Enter “sudo apt-get install curl -y”

Enter “curl -sL https://raw.githubusercontent.com/upggr/UPG.GR-MEDIA-SERVER/master/nginx.sh | sudo bash -”

16

Step 16

Your server is up! you can test it on the address you specified. Port 80 and 1935 is open. port 80 for the player port 1935 for the streaming. You may stream using Adobe Media Encoder (free). Remember to use the h.264 codec and not the default VP6 !

17

Connect and start streaming

Step 17

Test your streamer by visiting the main interface on the subdomain you defined or the ip address you were provided. I have prepared 5 streams. stream1,stream2,stream3,stream4,stream518

Step 18

Review my github projects where you can find all the source code for this project.

There are 3 projects :

https://github.com/upggr/UPG.GR-MEDIA-SERVER   –  Automation

https://github.com/upggr/nginx – Fork of the latest working nginx server (1.9.2)

https://github.com/upggr/nginx-rtmp-module – Latest fork of the rtmp module for nginx

You can edit the nginx.conf to suit you needs at : /usr/local/nginx/conf/nginx.conf

You can find the html files that show the web interface at : /usr/local/nginx/html

 

To do :

Web administration for nginx.conf options
Ftp server to edit the php files

Please comment here to encourage me to continue with this project.