Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search
no edit summary
=== Objectives ===
This project aims to create a local file system server using ARM Platform. It is very useful for this purpose for the next reasons:
-*ARM is designed for low power consumption. This server should be connected to power supply all the day, if you use this architecture, you can lower your electric bill. -*ARM-Embedded is usually cheaper than a X86-Embedded processor. -*If you have a good internet broadband connection, is not difficult to configure your server to accept external http requests. -*Your data are 100% under your control, other services you don't know where are your files. -*Commercial services offer premium accounts with extra hard disk space, in this project you can use all the space as your HD or SD supports.
<br> When you finish this how-to, you will have your own local web service similar than Dropbox and SugarSync. Your service will powered by [http://www.owncloud.org Owncloud.org] software. I used for this tutorial Owncloud 3 alpha 1 release to prove all new characteristics, but you can follow this tutorial using the stable version, there characteristics are: File management, WebDAV access, sharing, music streaming, calendar, contacts, users &amp; groups, image gallery, online text editor, online task manager and bookmarks. For more information go to [http://www.owncloud.org Owncloud.org] page.
When i finished this project, i tested the system performance making some tests. After this i did the next conclusions:
- *If you upload a folder with more than 100 files, i recommend that you compress it before the upload.  - *Don't compress via Web a folder large than 100 MB, use WebDAV for download it.  - *Don't upload more than 750 MB via Web, use WebDAV for this purpose.<br>  - *The Web uses HTML5 technology, it tested with Firefox 7, Google Chrome 14 browser and mobile phone with IOS 4.3.3. Older browsers maybe have problems.
= Hardware Used =
The hardware used for this project is:
*[https://www.isee.biz/products/igep- processor-boards/igepv2-dm3730 IGEPv2 Board Revision C with 1 GHz DM3730 Processor and 512MB Ram. ]- *5 V power supply.  - *MicroSD card 2GB at least with SD card adapter.  - *IGEPv2 Serial Debug cable, (it isn't necessary later)- *Ethernet cable. - *Switch or Router.<br> - *External USB Hard Disk with USB&nbsp;cable.<br>
= Software Used =
I used the following software:
- *[http://releases.linaro.org/platform/linaro-m/headless/final/linaro-m-headless-tar-20101108-2.tar.gz Linaro Headless]  - *[http://gparted.sourceforge.net/ Gparted]  - *[http://downloads.igepisee.esbiz/pub/filesreleases/IGEP_xloader/igep-x-loader-2.14.0-32.tar.bz2 Igepigep-x-loader-2.14.0-32.tar.bz2]  - *[http://gitorioussoftware.opensuse.org/ownclouddownload/package?project=isv:ownCloud:community&package=owncloud/archive-tarball/master Owncloud software]  - *[http://labs.igep.es/index.php/Linux_Kernel_2.6.35.y Kernel 2.6.35.y]  - *[http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29 LAMP]  - *[http://www.openssh.com/ OpenSSH Server]<br>'''NOTE:''' Tested using Owncloud version 2
= Installing Linaro Headless =
Use this [http://labs.igep.es/index.php/How_to_boot_from_MicroSD_Card tutorial](microSD) and this [http://labs.igep.es/index.php/The_IGEP_X-loader other](IGEPxloader) to install Linaro Headless in your SD card. It runs well with the software detailed above.&nbsp; You can compile the IGEPxloader and Kernel, but is not necessary.
'''NOTE: '''Use FAT16 for boot partition and EXT3 for rootfs partition.'''
Create a new plan text file into the boot partition named igep.ini with these content and save it.
<pre>ping X.X.X.X
</pre>
After this, upgrade your system via "apt-get".
= Installing Open SSH Server =
<pre>ssh root@X.X.X.X
</pre>
Now we be able to connect to server via SSH, using the password typed above.
The next steps are not necessary use serial communication .
= Creating and editing Server Users =
The first line says that adminserver user can access like root with sudo command.
The second line, configure some paremetres to adminserver sudo access: adminserver needs root's password to run sudo (runaspw), the password will not be remembered (timestamp_timeout) and he gets only one chance to enter it (passwd_tries).<br>NOTE: Is important use visudo editor because it can detect spelling errors before write sudoers file.<br>
= Installing LAMP =
Replace by:
<pre>DocumentRoot /home/&lt;user&gt;/web/</pre>
DocumentRoot is the root folder that contains our web pages.
Search line:
Options FollowSymLinks</pre>
For security reasons, we are going to hide our files and folders.
Search line:
Replace by:
<pre>AllowOverride all</pre>
Allows a file .htaccess to override the options for the respective directory
Save and exit.
<pre>ServerSignature Off
ServerTokens Prod</pre>
For security reasons, this lines hide the version of Apache and Linux Distro.
Restart Apache:
<pre>sudo /etc/init.d/apache2 restart</pre>
Now we have a Apache with basic improved configuration.<br>
=== PHP ===
</pre>
Restart Apache:
<pre>sudo /etc/init.d/apache2 restart</pre> 
=== MySQL + PHPmyAdmin ===
<pre>sudo apt-get install mysql-server mysql-client phpmyadmin</pre>
Make a simbolic link to phpmyadmin:<br>
<pre>sudo ln -s /usr/share/phpmyadmin /home/adminserver/web/phpmyadmin</pre>
With phpmyadmin you can handle your mysql databases (managing databases, tables, fields, relations, indexes, users, permissions, etc) via web browser. It is useful for Owncloud or another program than uses MySQL.<br>
= Enabling Automatic Updates =
The above configuration updates the package list, downloads, and installs available upgrades every day. The local download archive is cleaned every week.
For more information go to [https://help.ubuntu.com/1012.1004/serverguide/C/automatic-updates.html here.]
= Set up a External HD =
/dev/sda1 on /media/usbhd-sda1 type ext3 (rw,relatime)
</pre>
Where our HD isi mounted in media folder, and its name is u"sbhd-sda1"
= Set up Owncloud.org Software =
</pre>
The estable version, the folder is named owncloud. Open your web browser and finish your Owncloud installation. Go to[[Image: http://&lt;IP PRIVATE SERVER&gt;/owncloud-owncloud/ Put your personal information and select MySQL Database. once finish, click Finish SetupPreviewowncloudinstallation1. png|right|331px]]
[[ImageOpen your web browser and finish your Owncloud installation. Go to:Previewowncloudinstallation1http://&lt;IP PRIVATE SERVER&gt;/owncloud-owncloud/ Put your personal information and select MySQL Database. once finish, click Finish Setup.png|thumb|center]] <br><br><br><br><br><br><br>
=== Configuring Apache and PHP for Owncloud ===
PHP and Apache have a standard configuration, we need to change it to improve performance&nbsp; of our project and server.<br>
Edit <&lt;span style="font-family: monospace;" />&gt;/etc/apache2/apache2.conf
<pre>LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
ServerTokens Prod
</pre>
I reduce the number of clients and increased the persistent connection time.
Edit: /etc/php5/apache2/php.ini.<br>
memory_limit = 128M memory_limit = 1025M
mysql.connect_timeout = 60 mysql.connect_timeout = 600</pre>
I configure it for a local connection.
Edit Owncloud .htaccess and erase the following lines:
php_value post_max_size 512M
</pre>
Now .htacces don't limit the upload filesize and post size.
Restart Apache service:
<pre>sudo /etc/init.d/apache2 restart
</pre> 
=== Configuring WebDAV for Owncloud ===
Owncloud development team are creating a native client to manage files more easylieasyly, but is not release yet. But Although we can set up a WebDAV protocol to solve it. I tested with a Ubuntu 10.04 laptop, but can be aesyli use in other paltforms, see this [http://owncloud.org/use/webdav/ page] for more information.<br>
Install the WebDAV support:
<pre>sudo apt-get install davfs2
</pre>
Reconfigure davfs2 to allow access to normal users:
<pre><&lt;code>&gt;sudo dpkg-reconfigure davfs2<&lt;/code>&gt;</pre>Select ''Yes'' when prompted Add the users you want to be able to mount the share to the <code></code>davfs2 group: <pre>sudo usermod -aG davfs2 &lt;userclient&gt;</pre> Edit /etc/fstab, and add the following line for each user who wants to mount the folder (with your details where appropriate) <pre>http://&lt;IPPRIVATE&gt;/owncloud-owncloud/files/webdav.php /home/&lt;username&gt;/owncloud davfs user,rw,noauto 0 0</pre> Create the folders owncloud &amp; .davfs2 in your home directory Create the file named secrets inside .davfs2 folder, fill it with the following (with your credentials where appropriate) <pre>http://&lt;IPPRIVATE&gt;/owncloud-owncloud/files/webdav.php &lt;yourowncloudusername&gt; &lt;yourowncloudpassword&gt;</pre> Ensure the file is only writable by you either through the file manager: <pre>chmod 600 ~/.davfs2/secrets</pre> Mount your Virtual Owncloud Hardrive with the command: mount ~/owncloud You can automatically mount the folder on login, add the last command to ~/.bashrc
Add the users you want to be able to mount the share to the <code>davfs2</code> group[[Category:<pre>sudo usermod -aG davfs2 <userclient></pre>Edit /etc/fstab, and add the following line for each user who wants to mount the folder (with your details where appropriate)<pre>http://<IPPRIVATE>/owncloud-owncloud/files/webdav.php /home/<username>/owncloud davfs user,rw,noauto 0 0</pre>Create the folders owncloud & .davfs2 in your home directoryCreate the file named secrets inside .davfs2 folder, fill it with the following (with your credentials where appropriate) <pre>http://<IPPRIVATE>/owncloud-owncloud/files/webdav.php <yourowncloudusername> <yourowncloudpassword></pre>Ensure the file is only writable by you either through the file manager:<pre>chmod 600 ~/.davfs2/secrets</pre>Mount your Virtual Owncloud Hardrive with the command: mount ~/owncloudYou can automatically mount the folder on login, add the last command to ~/.bashrcTutorials]]
0
edits