LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2008, 08:26 PM   #1
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Rep: Reputation: 15
Having trouble starting Apache


I recently installed Apache on my linux machine (Fedora Core 8). When I went to start it up for the first time I got an error. Here is the command I used to start it:

#/usr/local/apache2/bin/apachectl start

Here is the error message I got.

httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/apache2/modules/libphp4.so: cannot open shared object file: No such file or directory


I changed into the /usr/local/apache2/modules directory and instead of libphp4.so I have libphp5.so. So that's probably why it says "No such file or directory"

I don't know how to fix the problem though.

Any help would would be appreciated. Thank you.




Jason
 
Old 07-07-2008, 11:04 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
This might be a case of loading stuff in an unfortunate order. It could be that you loaded php(5) first, and then the apache stuff (which looks like it wrote over anything that php5 might have left you. In my versions of these, though, that LoadModule stuff is not in httpd.conf at all; for a while now, each subsystem puts a configuration file in /etc/httpd/conf.d. So check if you have /etc/httpd.conf.d/php.conf, and if that looks like it refers to php5, not 4.

If that is the case, you might be able to get off with just deleting the offending line in httpd.conf, since the config lines in all the conf.d/*.conf files get included (also check if you have such a line in your main httpd.conf file
Code:
Include conf.d/*.conf
The versions I quote are php-5.2.4-1 and httpd-2.2.8-1. If your are much older, you might consider a newer package.
 
Old 07-08-2008, 12:41 AM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
No such file or directory means there is no such file or directory.

This is a remnant from a php4 -> php5 update.

Just remove the LoadModule that refers to php4, or any include on a conf.d or other subdirectory.
 
Old 07-08-2008, 12:51 PM   #4
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
My httpd.conf file points to the correct spot. That is not the problem.

The order in which I installed things is as follows:

Apache
MySQL
PHP

Mr. C--how do I know which LoadModule to remove? I went into /usr/local/apache2/modules and tried to view the contents of the files, but it says they aren't text files so I can't view them.
 
Old 07-08-2008, 02:08 PM   #5
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
If you have the file /etc/httpd/conf.d/php5.conf, then you can try to delete php4 references from the main configuration file /etc/httpd/conf/httpd.conf. To do so, you will need to use a text editor. The files are actually text, even though they do not have the file extension .txt.

In your favorite text editor, search for the line that produced the complaint in your message log. It will be on line 54, and should read something like this: "LoadModule php4_module modules/libphp4.so". Delete this line (or put a comment symbol in front of it [#] to make it inactive).

Once you have saved the configuration file, you can check for obvious errors with the command
Code:
# httpd -t
This will either produce a single line "Syntax OK" or some complaints about things that are wrong with your configuration. Once the syntax is acceptable, you can then restart the server to make the new configuration active.
 
Old 07-08-2008, 04:57 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Apache tells you the line number of the file:

httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf:
 
Old 07-08-2008, 07:44 PM   #7
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
Alright. So that worked. I commented out line 54.

I tried it again and now I have a syntax error on line 119.

Syntax error on line 119 of /usr/local/apache2/conf/httpd.conf:
Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

I opened the file and found line 119 and sure enough, 'Order' is there. But how do I know if it is misspelled? lol Here is the code from the file.

Code:
<Directory />
  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Deny from all
</Directory>
I am using Vim with the syntax enabled, so it highlights everything. The words 'Options' and 'AllowOverride" are green and give me no problems. The words 'Order' and 'Deny from' are purple, so I am assuming this means they aren't the correct "keywords" or whatever (not the proper syntax). So, if you have any suggestions, I would appreciate them.

Thanks in advance for helping me out guys. I really appreciate it.

Jason
 
Old 07-08-2008, 08:07 PM   #8
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
Kind of curious...how did you install apache?

Might wanna check if mod_authz_host is loaded or not. Within vi just hit "/" then type mod_authz_host and press enter.

Hope this helps.
 
Old 07-09-2008, 08:03 AM   #9
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
I am at work right now. But tonight I will provide a post telling how I installed Apache.
 
Old 07-09-2008, 07:19 PM   #10
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
Alright, so this is how I installed Apache, MySQL, and PHP.

Apache
Code:
#tar -zxf httpd-2.2.9.tar.gz
#cd httpd-2.2.9
#./buildconf
#./configure --prefix=/usr/local/apache2 --enable-mods-shared=most 
#make
#make install
Then I used vim to edit the following file:
#vim /usr/local/apache2/conf/httpd.conf

I found the DirectoryIndex line and made it look like the following:
DirectoryIndex index.html index.html.var index.php

Then I found the AddType application section and made it look like the following:
AddType application/x-httpd-php .php

That was it for Apache.

MySQL
Code:
#tar -zxf mysql-5.0.51b.tar.gz 
#cd mysql-5.0.51b
#./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-maintainer-mode --with-mysqld-user=mysql --enable-large-files-without-debug
#make
#make install
#/usr/sbin/groupadd mysql
#/usr/sbin/useradd -g mysql mysql
#./scripts/mysql_install_db
#chown -R root:mysql /usr/local/mysql 
# chown -R mysql:mysql /usr/local/mysql/data
Then I edited the following file:
#vim /etc/ld.so.conf

And added the following line:
/usr/local/mysql/lib/mysql

PHP
Code:
#tar -xjf php-5.2.6.tar.bz2 
#cd php-5.2.6
/configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
#make
#make install
#cp php.ini-recommended /usr/local/php/lib/php.ini
Then edited some files:
#vi /usr/local/php/lib/php.ini

Found the doc_root section and made this change:
doc_root= "/usr/local/apache2/htdocs/"

Found the file_uploads section and made this change:
file_uploads=Off

And then I was done. That is how I installed everything.
 
Old 07-09-2008, 07:22 PM   #11
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kenoshi View Post
Kind of curious...how did you install apache?

Might wanna check if mod_authz_host is loaded or not. Within vi just hit "/" then type mod_authz_host and press enter.

Hope this helps.
I searched my httpd.conf file for mod_authz_host and it wasn't found.
 
Old 07-09-2008, 07:45 PM   #12
hubbruch
LQ Newbie
 
Registered: Apr 2007
Location: Europe
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
Read the installation documentation and do it again!
 
Old 07-09-2008, 08:47 PM   #13
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
mod_authz_host is part of the base system, so it will be available with modules_share=most. It should be in:

Look in /usr/local/apache2/modules for mod_authz_host.so

modules_shared specifies how the modules are built (monolithic vs. module-based).

In your httpd.conf file, there should be a line like:

LoadModule authz_host_module modules/mod_authz_host.so

Example:
Code:
$ ./configure --prefix=/usr/local/apache2 --enable-mods-shared=most ; sudo make install
$ pwd
/usr/local/apache2
$ find . -name mod_authz_host.so -print
./modules/mod_authz_host.so
$ grep mod_authz_host conf/httpd.conf
LoadModule authz_host_module modules/mod_authz_host.so
 
Old 07-10-2008, 08:04 PM   #14
JasonC10203
Member
 
Registered: Sep 2007
Distribution: GRML 1.1
Posts: 59

Original Poster
Rep: Reputation: 15
Alright, so in my httpd.conf file there is only one LoadModule line.
Code:
LoadModule php5_module   modules/libphp5.so
So should I manually add it to the httpd.conf file myself or simply reinstall the whole thing?
 
Old 07-10-2008, 08:13 PM   #15
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
If you want php5, then you need the php5 module loaded,
so you can add that to your httpd.conf.

Some distros place extra module loading into included .conf files,
for example, httpd-php.conf, but you are free to do as you please.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble starting x noobpenguin Slackware 3 02-03-2008 02:40 PM
Trouble starting mysqld koodoo Linux - Newbie 4 08-16-2005 10:09 AM
Trouble starting Proftp kaidoggy Linux - Software 6 04-01-2004 12:12 PM
Trouble starting apache Belize Linux - Software 8 12-23-2003 09:30 AM
trouble starting X and KDE mcsquare Linux - Newbie 1 10-28-2003 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration