Category Archives: linux

Problem connecting to KVM with Virt-Manager

Recently I have had some issues with connecting from my laptop running Linux OS (Fedora 30, Xubuntu 19.04) from virt-manager to server running KVM. Virt-Manager keeps asking me for root password, which was very annoying.

The solution was simple – first I had to create ssh keys which then I needed to send to my CentOS(7) server running KVM

After that I was able to use Virt-Manager without any asking for password.

How-to install cockpit on CentOS 7

Here is a quick install guide how I setup Cockpit on my CentOS 7 servers:

  1. First update CentOS 7 server
  2. Install cockpit
  3. Change firewall settings
  4. Access CentOS 7 server via Cockpit webpage

And that’s all 😉

Apache UserDir in CentOS 7

Quick steps to set it up (I assume you have apache installed):

  1. login as root
  2. edit userdir.conf

  3. restart Apache
  4. setup your directory
    as normal user enter:
  5. if you use SELinux as root enter:
  6. create simple html page

    enter this:
  7. change ownership of file
  8. start your browser and enter this address:

     

    and voila! 😉

HP Proliant ML 110 G5, CentOS 7 and Smart Array P400

Recently i had to reinstall my old (but still working) server. I have bought Smart Array P400 instead of my old Smart Array E200, added new harddrives (WD Caviar Black 1TB x 2). And there was an issue regarding that on CentOS 7.x (RHEL 7.x) there is no more drivers for that controller. This was bad for me.

I have started to google the internet and have found a solution for this:
https://www.centos.org/forums/viewtopic.php?f=49&t=47011&start=20
and
https://www.centos.org/forums/viewtopic.php?f=49&t=51302&sid=850e80707bfb3db598f2c5be00ae5e51&start=10

Solution was simple:

  1. Download drivers from here http://elrepo.org/people/akemi/testing/el7/isos/
  2. Add above driver for CentOS 7 during boot process
  3. Install CentOS 7

Continue reading

ClearOS OpenVPN routing problem

I have a two routers based on ClearOS. On both of them i have OpenVPN service running. One of them connects with no problem but on the second one a cannot ping any device/server/printer on “the other side”.

I executed route command and got this:

So i figured out that there is no route to the remote place. As root I executed this command:

And finally i could access servers from “the other side”. The problem was in router/server which was running openvpn service.

I have had to edit /etc/openvpn/clients.conf and /etc/openvpn/clients-tcp.conf files and add this line at the end of both files:

After restarting the OpenVPN service on the server and connecting to the remote place via openvpn command everything goes right

The route command gave me this output:

which was good and everything was working as it was planned.

CentOS 6.x and Microsoft SQL Server ODBC Linux driver

Some days ago in my company someone asked me if we can access to our ERP software which is using Microsoft SQL Server. They want to get data to program which is writing by me using PHP and MySQL. I started to googling the net but I only found that Microsoft is providing drivers for ODBC connection. Those drivers can be found here.

Here is what i have done: (I assume that you have LAMP server setup on your CentOS 6.x)

Next step was to download proper driver: For CentOS 5.x

For CentOS 6.x

Next I have to untar it

and then build it

After that:

And the last

Now I have to setup ODBC, so we have to edit /etc/odbc.ini file and setup proper DSNName values

To test it I have to use the isql command

I have seen something like this below

OK, now it’s time to test PHP connection – because this is what my cooworkers wanted. So let’s wrote some PHP code:

I save it under odbctest.php file. Now it’s time to test it in the linux terminal:

I have seen something like:

Which was good. Now it’s time to test it under Apache, so a I copied this odbctest.php file under /var/www/html

After that i run

the download seems not working. The problem was in selinux permissions. If I do

then wget command will work and my webpage was accessible – until next reboot. Another way was to change the semanage context

Now after reboot it was working 🙂

Important information!

In CentOS 7 all steps will work until →# php odbctest.php. The problem is that Microsoft does’nt provide driver for RHEL/CentOS 7 branch. It only works with PHP up to 5.4 🙁

CentOS 6.x Apache, MySQL and PHP Installation

Installing LAMP (Linux, Apache, MySQL, PHP) is very easy on CentOS 6.x. You should only do something like:

Don’t forget to open port 80 in /etc/sysconfig/iptables by adding

That’s all folks!

[Edit]

I forgot to write one thing – you have to start & enable httpd service to start during restarts 😉

CentOS 7 EPEL and RepoForge repositories

Steps to add EPEL and RepoForge repositories to CentOS 7

That’s all 🙂