Vill du veta mer?

 

Magnus K Karlsson
Senior System Developer
+46 (0)70-218 00 84
magnus.k.karlsson@msc.se magnus-k-karlsson.blogspot.com

Magnus är en erfaren systemutvecklare.
 
Magnus K Karlsson

Våra medarbetares bloggar

2014-08-17 2av Magnus K Karlsson

Helpful CSS Cheat Sheets


Very good comprehensive CSS cheat sheets summarized on one single page http://slodive.com/freebies/css-cheat-sheets/.


2014-08-12 2av Magnus K Karlsson

RHEL 6 Synchronize Time Using Other NTP Peers


Introduction

In this blog will I show how to setup a NTP server and perform NTP synchronizing on remote server.

Server Installation

Server Configuration

The server IP is 192.168.1.240 and is located in 192.168.1.0/24 subnet.

Server Firewall

Server Start

Client Installation

Client Start

Client Test

Query your NTP server, but NOT set time. If query return higher stratum than 16, just wait a little and then requery.

Client Set NTP Server

And finally you need to restart ntpd service.


2014-08-10 2av Magnus K Karlsson

RHEL 6 Configure an MTA to Forward (Relay) Email Through a Smart Host.


Introduction

A relay mail server (MTA) is a intermediate server that forwards email to the final delivery mail server (MDA), i.e. writes message to default store /var/spool/mail/${USER}.

Remote Client --> Mail Transfer Agent, MTA (192.168.1.11) --> Mail Delivery Agent, MDA (192.168.1.12)

Configuration MTA

If you want MTA to ONLY transfer mail then set 'mydestination = '. With the above configuration the MTA will delivers local users email from remote client.

Restart service to let configuration take effects.

Check that SMTP port 25 (TCP) is open in iptables. If you need to update the configuration, don't forget to restart iptables service.

Configuration MDA

Do not forget to restart postfix service after configuration changes.

Create ordinary unix user for test, via command adduser mail2.

Check iptables SMTP port 25 (tcp) is open. Update if needed and restart iptables service.

If SELinux is active (default), check that default SELinux boolean for postfix is on.

Test

Now we are ready to test by sending mail from a remote client.

Now verify that mail was delivered on MDA (192.168.1.12).


2014-08-08 2av Magnus K Karlsson

RHEL 6 Postfix Aliases


Introduction

In my previos blog I described to configure and run MTA with postfix. Here I will describe how to make aliases.

Configuration

Start

Create alias

Now to let this take effect you must run the program newaliases.

Test

On remote client send mail to root@san.magnuskkarlsson.com.

And to verify on server.


2014-08-08 2av Magnus K Karlsson

RHEL 6 Configure a Mail Transfer Agent (MTA) to Accept Inbound Email From Other Systems


Installation

Configuration

Start

Firewall

Add TCP port 25 for SMTP.

Then restart firewall, to let new configuration take effect.

Test

First create a test user on server.

Then on remote client, we use telnet to send mail. For details see http://magnus-k-karlsson.blogspot.se/2014/06/how-to-send-mail-from-command-line-with.html.Here follows a summary.

Now check mail on server.

Reference

  • man 5 postconf

2014-08-07 2av Magnus K Karlsson

RHEL 6 FTP Configure Anonymous-Only Download.


Installation

Configuration

Start

Firewall

Test

Create test data.

And download it from remote host.


2014-08-07 2av Magnus K Karlsson

RHEL 6 Configure a Caching-Only Name Server to Forward DNS Queries


Installation

Configuration

Start

Test

Firewall


2014-06-30 2av Magnus K Karlsson

Packt is offering all of its eBooks and Videos at just $10 each for 10 days


Packt is celebrating 10 years anniversary and is celebrating that with offering all of its eBooks and Videos at just $10 each for 10 days.
http://bit.ly/1k5EUYD


2014-06-30 2av Magnus K Karlsson

How to Send Mail from the Command Line with Telnet


You can easily test your mail configuration from a linux server with telnet.


$ telnet rhel1 25
Trying 172.168.1.1...
Connected to rhel1.
Escape character is '^]'.
220 rhel1.localdomain ESMTP Postfix
HELO rhel1 # Note that "HELO" is not a misspelled. It is the command for telnet services.
250-rhel1.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: ivan@rhel2
250 2.1.0 Ok
RCPT TO: david@rhel1
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: Subject goes here.
Body goes here.
. # End body with '.' and Enter
250 2.0.0 Ok: queued as 5C3E5E12EA
# Quite interactive mail session with ctrl + ']'
quit
221 2.0.0 Bye
Connection closed by foreign host.

For a more detail description, please see http://www.ehow.com/how_5209651_use-sendmail-command-line.html.


2014-06-30 2av Magnus K Karlsson

Server Comaparison between RHEL and Windows


An interesting comparison (in swedish) between RHEL server and Windows server.

Windows vs Linux

Source:http://techworld.idg.se/2.2524/1.498006/windows-vs-linux---nu-avgors-kampen


2014-06-30 2av Magnus K Karlsson

How to Install KVM on Ubuntu 14.04 LTS (Trusty)


Prerequisite

Verify that you have enabled virtualization in BIOS. For detail see Virtualization with KVM on RHEL 6

Install

Install required packages.

Run

Now you ready to run virt-manager and install new virtual guests.

If you are new to kvm, please read Virtualization with KVM on RHEL 6 for a detailed description.


2014-06-21 2av Magnus K Karlsson

Tweak Unity in Ubuntu 14.04


The preferred way to tweak the user interface (Unity) in Ubuntu 14.04 is via the unity-tweak-tool. You can also use ccsm - CompizConfig Settings Manager, but I would recommend to stick with the recommended unity-tweak-tool, since settings can be messed up, when manipulating settings with different tools.

To install:

And if you have got lost when configure, you can always get back to original configuration with:


2014-06-21 2av Magnus K Karlsson

Static Routes with RHEL 6


The new way to add static routes in RHEL 6 is

Or alternative via the old ip command style.

And to set the default gateway.


2014-06-21 2av Magnus K Karlsson

How to Install Minecraft in Ubuntu 14.04


Kids go crazy over the swedish developed game Minecraft. Below is a link how to install it on Ubuntu 14.04.

http://ubuntuhandbook.org/index.php/2014/04/install-minecraft-in-ubuntu-14-04/


2014-06-21 2av Magnus K Karlsson

How to Merge Multiple PDF Files in Ubuntu


You can easily merge several pdf files into on file with 'pdftk - A handy tool for manipulating PDF'

Example how to merge file1.pdf and file2.pdf to mergedfile.pdf.


2014-06-12 2av Magnus K Karlsson

Convert MP4 to MP3 on Ubuntu 14.04 Trusty


There is a program available on Ubuntu youtube-dl, that can download videos from youtube.com or other video platforms. But it stores the file in mp4, since it contains video. But sometimes you do not want the video and only the audio. To extract only the audio part, you can use the pacpl comamnd line tool.


2014-06-09 2av Magnus K Karlsson

Bash Programming Documentation in RHEL 6


I'm not a bash script guru, so I need documentation. Here I will show you how to get/install that for RHEL 6.

All the BASH documentation is available via the bash-doc RPM, but it is not located in the RHEL base channel (rhel-x86_64-server-6), but in the RHEL Server Optional channel (rhel-x86_64-server-optional-6).

To add or remove channels from the command line you use the rhn-channel.

Now you are ready to install the bash-doc package.

And to list the installed files.

And the most interesting file is the BASH Reference Manual, as highlighted above.


2014-05-20 2av Magnus K Karlsson

Configure RHEL 6 as Router


Introduction

In this blog I will show you how to configure a RHEL 6 server as router for LAN (eth1) and WAN (eth0).

Enable IP forwarding

First we need to enable IP forwarding.

And to verify.

To make it permanent, you need to edit /etc/sysctl.conf.

Configure Router Server Network

Before we begin, we disable NetworkManager.

Then we manually edit our network configuration files.

We begin with our WAN (eth0) card.

And continue with our LAN (eth1) card.

The above HWADDR is different for your environment. To get yours use ifconfig.

Finally restart network service and check new ip addresses are set, via ip or ifconfig command.

iptables

Now we are ready to configure iptables. First flush existing rules.

Then add the MASQUERADE roule to the WAN (eth0) card

Finally save iptables configuration.

Test

I have connected a separate machine on LAN and configure it manually with static IP.

Now we can ping 192.168.2.100 (gateway), 192.168.1.100 (rhel 6 router), 192.168.1.1 (WAN GATEWAY) and finally www.google.com.


2014-04-22 2av Magnus K Karlsson

How To Install and Configure SAMBA Server on RHEL 6


Installation

Configuration

The default configuration works just fine.

Security

Having 'security = user' means we need a UNIX account. Lets create one.

And set samba password for account.

Firewall

Test

Now lets test it from a remote client. First lets list all shares on host.

And to mount it.

Finally lets test to write to winuser1 home directory.

This did not go well. The missing configuration is SELinux.

SELinux

On the SAMBA server, run the following command, if you want to share home directories via samba.

Now lets get back to client and un mount and the remount and write and read and that should be successful.


2014-04-22 2av Magnus K Karlsson

Different Way to Mount NFS in RHEL6


Automounting

The below will auto mount the user 'ldapuser1' home directory with rw permission on nfs.server.com.

Manual

You can manually mount a nfs exported directory to a local directory /remote.

Mount at boot


2014-04-22 2av Magnus K Karlsson

How to Install and Configure NFS Sharing on RHEL 6


Installation

To get nfs to work we need to install and start rpcbind and nfslock. Double check that is done.

Now we are ready to start NFS.

Finally lets test our new NFS server.

This will return a empty export list, without error.

Firewall

To be able to access NFS exports remotely, we need to open certain ports in the firewall. To investigate which one, we use the command rpcinfo.

This will return quite some ports. To lock down which port that are used please uncomment all ports in NFS conf file.

Now restart NFS service and lets start open ports.

And after opening all ports the iptables should look like.

Test your new firewall configuration by from remote client execute command.

Configuration

After we have successfully configured the firewall, lets back to our server and configure NFS export directories. We start with creating a new directory, that we will exports.

Now configure NFS to export it.

To apply the new changes run

And to list current exports

Test

From a second machine on the same LAN, test connectivity to NFS server (192.168.1.15).

The simplest way to test read and write is to use the automounting functionality.


2014-04-21 2av Magnus K Karlsson

How to Install Chrome on Ubuntu 14.04 LTS (Trusty)


Open a Terminal and run the commands.

Add the public key for the Google repo.

Add the Google repo for the chome package.

Update and install chrome web browser.


2014-04-14 2av Magnus K Karlsson

How To Configure KVM Virtual Machine Network


Background

Here I will configure a KVM host with virtual machines to be accessible from a local network.

This can be achieved in two ways by configure on KVM host machine:

  • A network bridge
  • Configure iptables as a router, which will forward traffic to virtual machines.

The easiest way is to use a network bridge, since then both desktop and virtual machines will be on the same subnet.

Prerequisite

Here we will configure the KVM host machine network configuration, manually, so we start by disable the NetworkManager

KVM Host Network Bridge Configuration

/etc/sysconfig/network-scripts/ifcfg-eth0

Above we have disabled NetworkManager (NM_CONTROLLED=no) and is using a Bridge.

/etc/sysconfig/network-scripts/ifcfg-br0

Above have we configured a static IP (BOOTPROTO=none) and assigned IP, Gateway and DNS.

KVM Host iptables

Since we are not using the second alternative with routing, the KVM host machines iptables configuration is the same as default.

After editing/creating files you might need to restore SELinux security contexts.

And finally restart network on KVM host

Virtual Macines Network Configuration

The last part is to configure the virtual machine network. This is easiest achieved with the virt-manager.

For an existing virtual machine.

And for a new.

Inside the Virtual Machine

Inside the virtual machine you can configure either a static IP or a dynamic one. The easiest way is to use the tool system-config-network-tui.

Test

And finally test to ping the virtual machine (virtual1) from the desktop.

Reference


2014-03-27 2av Magnus K Karlsson

Fedora 20 Better Theme


The default theme (Adwaita) that Fedora 20 is shipped is not the best. And beside it has a large window border at the top of each window. A better theme that exists in default rpm repo is greybird. To install

and to change use gnome-tweak-tool (rpm package gnome-tweak-tool)


2014-03-26 2av Magnus K Karlsson

Fedora 20 Install MySQL Server 5.5 and Workbench 6


MySQL Server 5.5

The MySQL packages has been renamed. The now official open source version of MySQL is MariaDB. To install the same version of MySQL on Fedora as in Enterprise Linux, such as RHEL, install these packages.

To start the mysqld.

Set MySQL root password to 'root'.

Finally login and test password.

MySQL Workbench 6

The workbench rpm is orphan, so you need to download and install it manually. http://dev.mysql.com/downloads/tools/workbench/

Little bit of searching for installing dependeny packages, with 'yum provides', e.g.

And finally ending up with all required packages.

Then run install of workbench again and start workbench and connect to you localhost.


2013-10-01 2av MSC Blogg

Som Red Hat Ready Partner besöker MSC Redhat EMEA Partner Conference i Madrid!


Jag besöker just nu Redhat EMEA Partner Conference i Madrid.
Heta ämnen är Open Hybrid Cloud, Red Hat Openstack, Red Hat Openshift och JBOSS Middleware.
/Magnus Eriksson



https://twitter.com/RHTPartnersEMEA