PrivacyIdea on RedHat

69 views
Skip to first unread message

Andrei Burn

unread,
Nov 16, 2015, 6:54:58 AM11/16/15
to privacyidea
Hi there, I am trying to install and configure PrivacyIdea and FreeRADIUS in a RedHat AWS instance... I would like to know if the installation differs too much from the CentOS documentation available at the moment, because I am having few issues following the current howTo!

Many thanks!

Cornelius Kölbel

unread,
Nov 16, 2015, 6:56:37 AM11/16/15
to priva...@googlegroups.com
...it might depend on which RHEL version you are installing.
There should(TM) be not much differences.

Shoot.

What is your version?
What have you done so far?
What are your problems?

Kind regards
Cornelius
> --
> You received this message because you are subscribed to the Google
> Groups "privacyidea" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to privacyidea...@googlegroups.com.
> To post to this group, send email to priva...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/privacyidea/cfbf4af2-4f94-42d0-ba80-ed8b0936fff3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
Cornelius Kölbel
corneliu...@netknights.it
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel


signature.asc

Andrei Burn

unread,
Nov 16, 2015, 8:54:54 AM11/16/15
to privacyidea
Hi thank you for the prompt reply!

here is my RHEL version 
My progress so far and the Error that I am getting... Everything worked perfectly till this point.

Red Hat Enterprise Linux Server release 7.1 (Maipo)


privacyIDEA Apache config

mkdir -p /var/run/wsgi 
cp /etc/privacyidea/privacyideaapp.wsgi /etc/privacyidea
mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.disabled

ERROR:

(privacyIDEA)[ec2-user@ip-172-31-25-216 privacyIDEA]$ sudo mkdir -p /var/run/wsgi

(privacyIDEA)[ec2-user@ip-172-31-25-216 privacyIDEA]$ sudo cp /opt/privacyIDEA/etc/privacyidea/privacyideaapp.wsgi /etc/privacyidea

cp: cannot stat ‘/opt/privacyIDEA/etc/privacyidea/privacyideaapp.wsgi’: No such file or directory

Cornelius Kölbel

unread,
Nov 16, 2015, 9:51:22 AM11/16/15
to priva...@googlegroups.com
Did you enter the virtualenv when running pip install?

What does the directory /opt/privacyIDEA/etc/privacyidea look like?

Does a directory /etc/privacyidea exist?

Probably you ran

pip install privacyidea

outside your python virtualenv.
You need to enter the virtualenv via

source /opt/privacyIDEA/bin/activate
and then you need to run

pip install privacyidea

Then there will be a file in this directory.

Kind regards
Cornelius
> --
> You received this message because you are subscribed to the Google
> Groups "privacyidea" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to privacyidea...@googlegroups.com.
> To post to this group, send email to priva...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/privacyidea/37baa0d0-6895-4ca0-9307-4f47c766933e%40googlegroups.com.
signature.asc

Andrei Burn

unread,
Nov 18, 2015, 11:49:58 AM11/18/15
to privacyidea
#I've created the virtualenv as described ....

virtualenv /opt/privacyIDEA

#then....

cd /opt/privacyIDEA

#then...

source bin/activate

#which lead me to this...

(privacyIDEA)[ec2-user@ip-172-31-23-75 privacyIDEA]$

#So then I downloaded and install the requirements and all the rest below

pip install -r requirements.txt
pip install MySQL-python
pip install privacyidea
mkdir /etc/privacyidea
mkdir /var/log/privacyidea

#PrivacyIDEA is definitely installed and active on the virtualenv, I've double checked with yolk

privacyIDEA     - 2.7.1        - active 

#But when it comes to Fix rights PricacyIDEA and PrivacyIDEA apache config, it doesn't work because the diretory etc/privacyidea is not found


#the location of /etc/privacyidea

(privacyIDEA)[ec2-user@ip-172-31-23-75 ~]$ whereis /etc/privacyidea
privacyidea: /usr/lib/privacyidea /etc/privacyidea

#and as you can see the privacyidea directory hasn't got the directory

(privacyIDEA)[ec2-user@ip-172-31-23-75 privacyIDEA]$ ls
bin  include  lib  lib64  requirements.txt


I appreciate all the help, it's very kind of you and I'm sorry, I feel that I am being annoying ... I am just a bit anxious to get this project done. 
I don't have much experience in this area and when I follow the HowTo and yet I get stuck it's a bit frustrating!

Many Thanks

Andrei

Cornelius Kölbel

unread,
Nov 18, 2015, 11:54:19 AM11/18/15
to priva...@googlegroups.com
Hello Andrei,

you are totally right!
A Howto should work.

I will look into this and come back to you later!

Kind regards
Cornelius
> https://groups.google.com/d/msgid/privacyidea/47a4d0a2-a6de-4d23-9c0a-5de877275e10%40googlegroups.com.
signature.asc

Cornelius Kölbel

unread,
Nov 18, 2015, 12:31:10 PM11/18/15
to priva...@googlegroups.com
Hi Andrei,

you need run the "pip install" commands from within the virtualenv.
I think you have done so, otherwise I guess "pip" would not be found.

But if you run it from within virtualenv you should not create
directories outside of virutalenv.

And if you ran this as user "ec2-user", how did the
directory /usr/lib/privacyidea came into life, as this user probably has
no write access.

So make sure, that you run "pip install" from within virtualenv.
- i.e. after doing "source bin/activate".

Please check:
* Does a directory /opt/privacyIDEA/lib/privacyidea/ exist?
* Does a directory /usr/lib/privacyidea/
and /usr/lib/python2.7/site-packages/privacyidea/ exist?

If you answer 1. NO and 2. YES, then you ran the "pip install" outside
of the python virtualenv. ;-)

Kind regards
Cornelius

Am Mittwoch, den 18.11.2015, 08:49 -0800 schrieb Andrei Burn:
> https://groups.google.com/d/msgid/privacyidea/47a4d0a2-a6de-4d23-9c0a-5de877275e10%40googlegroups.com.
signature.asc

Andrei Burn

unread,
Nov 20, 2015, 5:48:33 AM11/20/15
to privacyidea
Hi Cornelius

Yes you were right, it was installed outside the virtualenv... how did that happened I don't know ....
So I decided to restart with a fresh RedHat installation.... then I've noticed that when I give the command virtualenv /opt/privacyIDEA it automatically install Pip

[ec2-user@ip-172-31-27-9 ~]$ sudo virtualenv /opt/privacyIDEA
New python executable in /opt/privacyIDEA/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.

Then after that it comes to the same problem, even after activate the source /bin/privacyidea..... /etc/privacyidea is not there....it is again outside of the virtualenv
So I've tried to cancel the pip installation using --no-pip, and then I installed pip after activate source /opt/privacyIDEA/bin/activate
But when it comes to create the directories, it always create outside of the virtualenv on /usr/lib.
Any suggestions?

Many Thanks

Andrei

Cornelius Kölbel

unread,
Nov 20, 2015, 6:12:04 AM11/20/15
to priva...@googlegroups.com
What virtualenv version is available on RHEL7?

Older versions had parameters to use system libs or not...
But nevertheless I never saw installing things from within the system
installing outside.

One hint:

Use a normal user. This user will not be allowed to install to /usr/

Create the virtualenv in the users home directory and see what happens.

Kind regards
Cornelius
> https://groups.google.com/d/msgid/privacyidea/35bf1805-a7d0-4258-bf41-40681a04ec11%40googlegroups.com.
signature.asc

Andrei Burn

unread,
Nov 20, 2015, 10:56:06 AM11/20/15
to privacyidea
The virtualenv version is 13.1.2
I have created a normal user and I did the whole process again just to get to the same result... it creates the directory on /usr/lib ...
Anyway I will continue investigating why this is happening.

Thank you very much for your help Cornelius!

Andrei 

Cornelius Kölbel

unread,
Nov 20, 2015, 11:04:33 AM11/20/15
to priva...@googlegroups.com
Hi Andrei,

A normal user should have no write access to /usr/lib...
So calling virtualenv as normal user (without sudo!!!!), can not result
in this.
I recommend this as a starting point for further investigations.

Kind regards
Cornelius
> https://groups.google.com/d/msgid/privacyidea/8cd85d49-3f8a-4ea5-8d67-ba6aabafef45%40googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages