Giter Site home page Giter Site logo

Comments (10)

vielhuber avatar vielhuber commented on May 27, 2024 1

wow, thank you!

solution:

# unset exported perl variables
whoami # root
nano ~/.bashrc
comment/disable all export PERL lines at the bottom
logout/login again

# install as root, but not in /root but in /usr/local
whoami # root
cpan -i Email::Outlook::Message
which msgconvert # /usr/local/bin/msgconvert

# test as apache
su -s /bin/bash apache
msgconvert

from email-outlook-message-perl.

mvz avatar mvz commented on May 27, 2024

Hi @vielhuber,

In general, msgconvert should run as non-root just fine. In fact, I would never run it as root. Here's what I would advise:

  1. Please check if you can run other programs form your web application.
  2. If running other programs works, but running msgconvert doesn't, please post more information here, such as
  • Where is msgconvert installed?
  • Where are the programs that you can run installed?
  • How are you executing the programs?
  • What failure messages do you get?
  1. If running other programs does not work: Please ask your question on a general-purpose forum like stack-overflow. You should probably include most of the points above in your question.

Good luck debugging!

from email-outlook-message-perl.

vielhuber avatar vielhuber commented on May 27, 2024

Please check if you can run other programs form your web application.

Yes, other programs run.

Where is msgconvert installed?
Where are the programs that you can run installed?
How are you executing the programs?
What failure messages do you get?

They are usually installed unter /usr/local/bin/.

Can you give me some small hints what's the correct / usual way to run msgconvert as apache (as a non root user)?

  • Use cpanm(?)
  • Use local::lib(?)

Thanks in advance.

from email-outlook-message-perl.

mvz avatar mvz commented on May 27, 2024

Where is msgconvert installed?
Where are the programs that you can run installed?
How are you executing the programs?
What failure messages do you get?

They are usually installed unter /usr/local/bin/.

How can I help you if you don't answer any of my questions?

from email-outlook-message-perl.

vielhuber avatar vielhuber commented on May 27, 2024

Where is msgconvert installed?

which msgconvert
/root/perl5/bin/msgconvert

Where are the programs that you can run installed?

/usr/local/bin/

How are you executing the programs?

su -s /bin/bash apache
/root/perl5/bin/msgconvert

What failure messages do you get?

Permission denied

from email-outlook-message-perl.

mvz avatar mvz commented on May 27, 2024

Yes, that makes sense. The way you installed msgconvert makes it only available to the root user. Other users can't access files inside /root.

As I understand it, cpan should only install modules in /root/perl5 if you run cpan -I Email::Outlook::Message. That's -I with a capital I. You should user the lower-case -i instead. If that doesn't work there's something wrong with your CPAN configuration.

from email-outlook-message-perl.

vielhuber avatar vielhuber commented on May 27, 2024

Hello, thanks for your answer.

This is what I further tried (I think I'm close):

whoami # root
mkdir /usr/share/httpd/.cpan
chown apache:apache /usr/share/httpd/.cpan
su -s /bin/bash apache
cpan -i Email::Outlook::Message

Now It installs lots of stuff but reaches finally the point:

...
Running make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/root/perl5/bin'
mkdir /root/perl5: Permission denied at /usr/share/perl5/ExtUtils/Install.pm line 494.

I just tested out the procedure on another machine and it's exacly the same.

from email-outlook-message-perl.

mvz avatar mvz commented on May 27, 2024

I have no idea why CPAN would try to install to /root/perl5/bin even when running as the apache user. Maybe that's a centos thing? I suggest asking on StackOverflow because I'm all out of ideas.

from email-outlook-message-perl.

vielhuber avatar vielhuber commented on May 27, 2024

Thanks, can you give me another hint:

Why are there so many threads/tutorials out there when this should work out of the box?

https://stackoverflow.com/questions/11367399/installing-cpan-modules-without-root
https://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user
https://www.perlmonks.org/?node_id=1053274
http://alumni.soe.ucsc.edu/~you/notes/perl-module-install.html

from email-outlook-message-perl.

mvz avatar mvz commented on May 27, 2024

Those are all about installing as a non-root user. I don't know what's going on. It used to be that non-root users could just do cpan -i.

These solutions all seem totally over-the-top.

However, they do give a hint: Perhaps the PERL5LIB variable is set to something like /root/perl5. This won't be reset if you use su without --login.

But anyway, you need to look for answers for system-wide installation of cpan modules, since you actually have root access. This means those non-root solutions do not apply to you.

from email-outlook-message-perl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.