LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Cannot start Apache as non-root anymore: missing libaprutil-1.so.0 ?? (https://www.linuxquestions.org/questions/linux-server-73/cannot-start-apache-as-non-root-anymore-missing-libaprutil-1-so-0-a-805779/)

Kreshna 05-04-2010 02:08 AM

Cannot start Apache as non-root anymore: missing libaprutil-1.so.0 ??
 
I have a web application running on a production server. The production server already has its own Apache. My web application runs on its own Apache, which runs on port 8000, and mapped to the "primary" Apache through reverse proxy (my Apache www root is seen as a sub-folder in the primary Apache).

The primary Apache resides in /usr/sbin, while my Apache resides in /home/user1/fgs/www/bin/. I always start my Apache using user1 instead of root, and never had problem with such thing before. Anyway, I start my Apache with the following command:
Code:

/home/user1/fgs/www/bin/httpd -d /home/user1/fgs/www -f /home/user1/fgs/www/conf/live.httpd.conf -k start
Like I said, I've never had problem with such thing before.

Lately, my web application just stopped working. After some investigation, I discovered my Apache just won't start anymore. Everytime I start my Apache using user1 account, I always get the following error:
Code:

/home/user1/fgs/www/bin/httpd: error while loading shared libraries: libaprutil-1.so.0: cannot open shared object file: No such file or directory
Oddly enough, I can start my Apache using the root account (the pid shows when I use ps aux | grep httpd command. However, the browser always shows a "Forbidden" error if I start my Apache using root account.
Quote:

Forbidden

You don't have permission to access / on this server.
What happened? The server technicians said that they deleted some files prior to the malfunctioning of my web applications. What file is missing, and what should I do to restore it?

Many thanks,
-Kresh

bathory 05-04-2010 04:02 AM

Hi,

You can run
Code:

ldd /home/user1/fgs/www/bin/httpd
to see where httpd is looking for the missing library (probably in /home/user1/fgs/www/lib).
Since root can start apache, I guess the library exists in the system library path, so you can make a symlink to it:
Code:

ln -s /usr/lib/libaprutil-1.so /home/user1/fgs/www/lib

Kreshna 05-05-2010 02:48 AM

Quote:

Originally Posted by bathory (Post 3956570)
Hi,

You can run
Code:

ldd /home/user1/fgs/www/bin/httpd
to see where httpd is looking for the missing library (probably in /home/user1/fgs/www/lib).
Since root can start apache, I guess the library exists in the system library path, so you can make a symlink to it:
Code:

ln -s /usr/lib/libaprutil-1.so /home/user1/fgs/www/lib

Thanks! I'll definitely try it.

By the way, I just wonder: what made the library missing on the first place? I don't really know what happened to the server (and nor do the 'systems engineers', by the way). All I know is that they have removed the email service from the server and moved it somewhere else. Is it possible they erase the symlink by accident?

bathory 05-05-2010 03:06 AM

No, I don't think so. Unless they removed the system libarputil.
Most likely someone deleted the aprutil library that came with the apache you installed in your homedir

Regards

Kreshna 05-27-2010 03:26 AM

Sorry for thread necro, but....

I don't understand. libaprutil-1.so.0 does exist in my Apache installation.
Quote:

[user1@server fgs]$ find /home/user1/fgs/ -name libaprutil*
/home/user1/fgs/www/lib/libaprutil-1.so.0.2.12
/home/user1/fgs/www/lib/libaprutil-1.so.0
/home/user1/fgs/www/lib/libaprutil-1.a
/home/user1/fgs/www/lib/libaprutil-1.la
/home/user1/fgs/www/lib/libaprutil-1.so
[user1@server fgs]$
Yet the error persists:
Quote:

/home/user1/fgs/www/bin/httpd: error while loading shared libraries: libaprutil-1.so.0: cannot open shared object file: No such file or directory
The libaprutil-1.so.0 is apparently a symlink to libaprutil-1.so.0.2.12.
Quote:

[user1@server fgs]$ ls -al /home/user1/fgs/www/lib/libaprutil-1.so.0
lrwxrwxrwx 1 user1 user1 22 Nov 28 13:52 /home/user1/fgs/www/lib/libaprutil-1.so.0 -> libaprutil-1.so.0.2.12
But libaprutil-1.so.0.2.12 does exist in /home/user1/fgs/www/lib/ directory, as shown above.

What happens? Help.

bathory 05-27-2010 04:09 AM

Hi,

You didn't post the output of
Code:

ldd /home/user1/fgs/www/bin/httpd
but I guess httpd searches for libaprutil in the wrong place.
Anyway to make apache use the aprutil library installed in /home/user1/fgs/www/lib, you can use LD_LIBRARY_PATH, before running "apachectl start"
Code:

export LD_LIBRARY_PATH=/home/user1/fgs/www/lib:$LD_LIBRARY_PATH
/home/user1/fgs/www/bin/apachectl start



All times are GMT -5. The time now is 07:00 AM.