0
edits
Changes
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:
=== Limitations ===
When i finished this project, i tested the system performance making some tests. After this i did the next conclusions:
= 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 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 cable.<br>
= Software Used =
I used the following software:
= Installing Linaro Headless =
'''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 the fileit.
<pre>[kernel]
; Kernel load address, NOT Modify
;init=/bin/bash
</pre>
NOTE: I recomend change Check MAC adressaddress is not used for avoid conflicts.<br>
= Set up internet connection =
Login as root via serie, we and use "vi" editor to add the following lines to<span class="st"> the bottom of </span>/etc/network/interfaces
<pre>auto eth0
iface eth0 inet dhcp
gateway <where send Dhcp request>
</pre>
Save changes and restart the system with via "reboot" command. <br> After reboot,if you don't know private ip of your server, find it typing:
<pre>ifconfig
</pre>
Test your server connection sending a ping request:
= Installing Open SSH Server =
<pre>apt-get install openssh-server
</pre>
<pre>passwd root
</pre>
Enter new password, i recommend use letterletters, numbers and symbols like:?¿!...
Search in eth0: inet addr:X.X.X.X, where X.X.X.X is the server private IP. We are going to prove it login as root via ssh:
<pre>ssh root@X.X.X.X
</pre>
The next steps are not necessary use serial communication .
= Creating and editing Server Users =
Using root user can be dangerous, for this reason we are going to create a new user named adminserver to access server. Create new user typing:<br>
<pre>adduser adminserver
The next steps are not necessary use serial communication . </pre>
Follow the assistant entering a password and your user data.
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 =
=== Apache ===
The Apache HTTP Server is an open-source HTTP server for modern operating systems including UNIX, Microsoft Windows, Mac OS/X and Netware. We are going to install Apache HTTP Serverit:
<pre>sudo apt-get install apache2 apache2-mpm-prefork</pre>
After installation, we are going to make some configurations:
<pre>mkdir /home/<user>adminserver/web/</pre>
We create that folder called web to store all the web files.
Replace by:
<pre>DocumentRoot /home/<user>/web/</pre>
DocumentRoot is the root folder that contains our web pages.
Search line:
<pre>Directory /var/www/
Options FollowSymLinks</pre>
For security reasons, we are going to hide our files and folders.
Search line:
<pre>AllowOverride None</pre>
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>
When we are installing MySQL, we configure it entering password for root MySQL database. Also when we are installing phpmyadmin we should choose: configure database for phpmyadmin with dbconfig-common, type root MySQL password again, type phpmyadmin password database, and choose apache2 confiuration .<br>
Restart Apache:
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 if you for Owncloud or another program than uses MySQL.<br>
= Enabling Automatic Updates =
Automatic updates can be used to automatically install updated packages. You can configure it to update all packages or just security packages. Install the following package:<br>
<pre>sudo apt-get install unattended-upgrades</pre>
To configure <span class="application">unattended-upgrades</span>, edit:/etc/apt/apt.conf.d/50unattended-upgrades and adjust the following to fit your needs: <br>
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 =
Format your HD with a EXT3 Filesystem.
Create the following script: /etc/udev/rules.d/50-mount-external.rules, and paste this:
<pre>KERNEL!= "sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"
/dev/sda1 on /media/usbhd-sda1 type ext3 (rw,relatime)
</pre>
Where our HD si isi mounted in media folder, and its name is usbhdu"sbhd-sda1"
= Set up Owncloud.org Software =
=== Installing Owncloud.org ===
Owncloud software need some extra packages:<br>
For improved scanning of music files:
<pre>cd /home/adminserver/web/
sudo chown -R www-data:www-data owncloud-owncloud/
</pre>
=== Configuring Apache and PHP for Owncloud ===
PHP and Apache have a standard configuration, we need to change it to improve performance of our project and server.<br>
<pre>LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
ServerTokens Prod
</pre>
I edit myreduce the number of clients and increased the persistent connection time. Edit: /etc/php5/apache2/php.ini.<br>
<pre>max_file_uploads = 20 max_file_uploads = 100
upload_max_filesize = 2M upload_max_filesize = 750M
max_input_time = 60 max_input_time = 600
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: <pre>php_value upload_max_filesize 512Mphp_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 easyly, but is not release yet. Although we can set up a WebDAV protocol to solve it. I tested with a Ubuntu 10.04 laptop, but can be 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><code>sudo dpkg-reconfigure davfs2</code></pre> Select ''Yes'' when prompted