Linux: Difference between revisions

From Objectif Client Inc
Jump to navigation Jump to search
No edit summary
Line 213: Line 213:
<syntaxhighlight lang="bash">svn co --username $user_name https://localhost/svn/$REPOS</syntaxhighlight>
<syntaxhighlight lang="bash">svn co --username $user_name https://localhost/svn/$REPOS</syntaxhighlight>


=== Server Setup ===
== Server Setup ==
==== Template Server ====
=== Template Server ===
===== Install Ubuntu Server =====
==== Install Ubuntu Server ====
# Download ubuntu lts server version
# Download ubuntu lts server version
## Only install open ssh sever  
## Only install open ssh sever  
# Update package : apt-get update
# Update package : apt-get update
# Update system : apt-get upgrade
# Update system : apt-get upgrade
===== Install Minimum Desktop =====
==== Install Minimum Desktop ====
# Install minimal desktop : apt-get install --no-install-recommends xubuntu-desktop
# Install minimal desktop : apt-get install --no-install-recommends xubuntu-desktop
===== Install other Software =====
==== Install other Software ====
# Install other tools : apt-get install firefox synaptic gkrellm gkrellmd gnome-terminal nfs-common
# Install other tools : apt-get install firefox synaptic gkrellm gkrellmd gnome-terminal nfs-common


===== Install WebMin =====
==== Install WebMin ====
# Download  Webmin : wget http://prdownloads.sourceforge.net/webadmin/webmin_1.791_all.deb
# Download  Webmin : wget http://prdownloads.sourceforge.net/webadmin/webmin_1.791_all.deb
# Install Dependencies : apt-get apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
# Install Dependencies : apt-get apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
# Install Webmin : dpkg --install webmin_1.791_all.deb
# Install Webmin : dpkg --install webmin_1.791_all.deb
==== Open DKIM ====
=== Open DKIM ===
Web site [http://http://www.opendkim.org]
Web site [http://http://www.opendkim.org]
For each domain:
For each domain:
Line 238: Line 238:
* Copy the key (mail.txt) into the dns record.
* Copy the key (mail.txt) into the dns record.


==== Mail Server ====
=== Mail Server ===
[[Mail Server|Mail Server]]
[[Mail Server|Mail Server]]


== Video File Manipulation ==
== Video File Manipulation ==
[[video_file_converter |Convert Video file]]
[[video_file_converter |Convert Video file]]

Revision as of 16:49, 5 June 2016

Command Line

Usefull Linux Command

Vi

Vi commands

Java

  • in case of error message "wrong ELF class: ELFCLASS64"
  • Install 32bit jdk package
apt-get install openjdk-7-jdk:i386

Configuration

Php

PHP Module

VirtualBox

  • Increase Virtual Disk space
    • VBoxManage modifyhd <absolute path to file> --resize <size in MB>
VBoxManage modifyhd wim.vdi --resize 20000

VNC

  • Fixing the tab key in VNC
xfconf-query -c xfce4-keyboard-shortcuts -p /xfwm4/custom/'<'Super'>'Tab -r

Container Docker

Install Docker

  • Install
 apt-get install docker.io

Network Configuration

  • Configuration to share the same network
  • Edit /etc/network/interfaces to add a "bridge" you may have to reconfigure your firewall
  • Add br0 to auto
  • Remove ip assignement or dhcp of eth0
  • Add br0 bridged to eth0
Ip Address assigned by dhcp
# Interfaces(5) file used by ifup(8) and ifdown(8)
auto lo br0 eth0
iface lo inet loopback

iface eth0 inet manual

iface br0 inet dhcp
        bridge_ports eth0
Ip Address Fix
# Interfaces(5) file used by ifup(8) and ifdown(8)
auto lo br0 eth0
iface lo inet loopback

iface br0 inet static
        address 10.1.1.1
        netmask 255.255.255.0
        broadcast 10.1.1.255
        network 10.1.1.0
        bridge_ports eth0
Update Docker Configuration to use the bridge
  • Edit /etc/default/docker.io
  • Add private dns (--dns 192.168.1.1) and bridge (-b br0) to Docker Option line
 DOCKER_OPTS="--dns 8.8.8.8 --dns 10.10.1.1 -b br0"
Howto manage container

See Container Howto for the usage

Owncloud

  • Add the repository
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
  • Add Key
wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
sudo apt-key add - < Release.key
  • Install
sudo apt-get update
sudo apt-get install owncloud

Apache Svn Server

1: Install Apache HTTP server and required modules:

sudo apt-get install libapache2-svn apache2

2: Enable SSL

sudo a2enmod ssl
sudo vi /etc/apache2/ports.conf

Add or check that the following is in the file:

<IfModule mod_ssl.c>
    Listen 443
</IfModule>

3: Generate an SSL certificate:

sudo apt-get install ssl-cert
sudo mkdir /etc/apache2/ssl
sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

4: Create virtual host

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/svnserver
sudo kate /etc/apache2/sites-available/svnserver

Change (in ports.conf):

"NameVirtualHost *" to "NameVirtualHost *:443"

and (in svnserver)

<VirtualHost *> to <VirtualHost *:443>

Add, under ServerAdmin (also in file svnserver):

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM

5: Enable the site:

sudo a2ensite svnserver
sudo /etc/init.d/apache2 restart

To overcome warnings:

sudo vi /etc/apache2/apache2.conf

Add: "ServerName $your_server_name"

Add, under ServerAdmin (also in file svnserver):

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM

6: Adding repository(ies): The following setup assumes we want to host multiple repositories. Run this for creating the first repository:

sudo mkdir /var/svn
sudo svnadmin create /var/svn/mysvnrepository
sudo chown -R www-data:www-data /var/svn/mysvnrepository
sudo chmod -R g+ws /var/svn/mysvnrepository<

6.a. For more repositories: do step 6 again (changing mysvnrepository Name)

7: Add an authenticated user

sudo htpasswd -c -m /etc/apache2/dav_svn.passwd $user_name

8: Enable and configure WebDAV and SVN:

sudo vi /etc/apache2/mods-available/dav_svn.conf

Add or uncomment:

<Location /svn>
DAV svn

# for multiple repositories - see comments in file
SVNParentPath /var/svn

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
SSLRequireSSL
</Location>

9: Restart apache server:

sudo /etc/init.d/apache2 restart

10: Validation:

Fired up a browser:

http://localhost/svn/$REPOS https://localhost/svn/$REPOS

Commit something:

svn import --username $user_name anyfile.txt https://localhost/svn/$REPOS/anyfile.txt -m “Testing”

Accept the certificate and enter password. Check out what you've just committed:

svn co --username $user_name https://localhost/svn/$REPOS

Server Setup

Template Server

Install Ubuntu Server

  1. Download ubuntu lts server version
    1. Only install open ssh sever
  2. Update package : apt-get update
  3. Update system : apt-get upgrade

Install Minimum Desktop

  1. Install minimal desktop : apt-get install --no-install-recommends xubuntu-desktop

Install other Software

  1. Install other tools : apt-get install firefox synaptic gkrellm gkrellmd gnome-terminal nfs-common

Install WebMin

  1. Download Webmin : wget http://prdownloads.sourceforge.net/webadmin/webmin_1.791_all.deb
  2. Install Dependencies : apt-get apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
  3. Install Webmin : dpkg --install webmin_1.791_all.deb

Open DKIM

Web site [1] For each domain:

  • Create folder
    mkdir /etc/opendkim/keys/domain_name 
  • Update configuration file /etc/opendkim/KeyTable
  • Generate Key
    opendkim-genkey -s mail -d domain_name
  • Change Owner
    chown opendkim: /etc/opendkim/KeyTable/domaine_name/mail.private
  • Copy the key (mail.txt) into the dns record.

Mail Server

Mail Server

Video File Manipulation

Convert Video file