Duplicate LoadModule php5

floyd

Verified User
Joined
Mar 29, 2005
Messages
6,171
After using custombuild on a new install I have this line in /etc/httpd/conf/extra/httpd-phpmodules.conf and /etc/httpd/conf/httpd.conf:

LoadModule php5_module /usr/lib/apache/libphp5.so

This causes apache to give warning.

Also apache fails to start. I do not think its because of the line above. I have this in the error_log:

[Tue Apr 8 08:42:02 2008] [error] mod_ssl: Init: Unable to read server certificate from file /etc/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Tue Apr 8 08:42:02 2008] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Tue Apr 8 08:42:12 2008] [error] mod_ssl: Init: Unable to read server certificate from file /etc/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Tue Apr 8 08:42:12 2008] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data
[Tue Apr 8 08:43:01 2008] [error] mod_ssl: Init: Unable to read server certificate from file /etc/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Tue Apr 8 08:43:01 2008] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data

So my first attempt at using custombuild has not gone so well.
 
Here are the setup questions and answers for custombuild:

Code:
You now have 2 options for your apache/php setup.

1: customapache: older, more tested. Includes Apache 1.3, php 4 and frontpage.
2: custombuild 1.1:  newer, less tested. Includes any Apache version, php 4, 5, or both in cli and/or suphp. Frontpage not available with Apache 2.x.
                 Post any issues with custombuild to the forum: http://www.directadmin.com/forum/forumdisplay.php?f=61

Enter your choice (1 or 2): 2
You have chosen custombuild 1.1.

Would you like the default settings of apache 2.2 and php 5 cli? (y/n): n
You have chosen to customize the custombuild options.  Please wait while options configurator is downloaded... 

--08:46:24--  http://files.directadmin.com/services/custombuild/options-1.1
Resolving files.directadmin.com... 72.35.85.222
Connecting to files.directadmin.com|72.35.85.222|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9231 (9.0K) [text/plain]
Saving to: `/usr/local/directadmin/custombuild/options'

100%[=========================================================================================================================================>] 9,231       --.-K/s   in 0.06s  

08:46:24 (159 KB/s) - `/usr/local/directadmin/custombuild/options' saved [9231/9231]

Do you want to have PHP4 or PHP5 as default? (4/5): 5
Do you want to have PHP5? (yes/no): yes
Do you want to have PHP5 as CLI or CGI? (cli/cgi): cli
Do you want to have PHP4? (yes/no): no
Do you want to have the php.ini (PHP configuration file) rewritten? (yes/no): yes
For the next question, the usual file is the dist (distribution) version.What type of php.ini (PHP configuration file) do you want to have? (dist/recommended): dist
Do you want to have Zend Optimizer? (yes/no): yes
Do you want to be able to update/instal MySQL using CustomBuild? (yes/no): yes
Which version of MySQL do you want to have? (4.1/5.0: 5.0
Which version of Apache do you want to have? (1.3/2.0/2.2): 1.3
Do you want to be able to install/update phpMyAdmin using CustomBuild? (yes/no): yes
Do you want to be able to install/update SquirrelMail webmail using CustomBuild? (yes/no): yes
Do you want to be able to install/update RoundCube webmail using CustomBuild? (yes/no): yes
Do you want to install PHP mail() header patch together with PHP? (yes/no): yes
Do you want to install Dovecot? (yes/no): no
Do you want to be able to update Exim configuration file (exim.conf) using CustomBuild? (yes/no): yes
Do you want to be able to install/update ProFTPD using CustomBuild? (yes/no): yes
Do you want to clean everything (run './build clean' every time) running CustomBuild? (yes/no): yes
Which fileserver do you want to use (1 is located in USA, 2 - Europe)? (1/2): 1
Options.conf has been installed successfully
beginning pre-checks, please wait...

OS CentOS 5.1
 
Just been there - after a custom build on CENTOS 5.1 the LoadModule for php5_module appears in both:

/etc/httpd/conf/httpd.conf
/etc/httpd/conf/extra/httpd-phpmodules.conf

Since the 2nd of those is included in a section with a "changed by DirectAdmin" note, comment out the extra load module at the top of httpd.conf . Since that file is at a pretty high level, changes at that level can easily be restored even if overwritten by DA. And there lots you might want to change. My choices included trimming the long list of DirectoryIndex choices, setting OverrideAll to none (overriden with custom httpd only where needed), drop DAV, drop fancy indexing, etc........
 
Sorry, had to deal with something.

Apache probably is not starting because of an SSL prompt. My centos box came with the "Snake Oil" certs installed and it took a fair amount of messing around to generate a self-signed cert that would work. The SSL stuff is found at

/usr/local/directadmin/customapache/mod_ssl*

I got so cross-eyed trying to follow the abominable docs, that I ended up modifying pkg.contrib/sign.sh to create the self-signed files for me. Note that even if you get the files in the right places, if you don't have everything right, apache will hang on a SSL prompt.

I still have a "Server Name does not match Common Name" bark when apache restarts, and I am pretty sure it is the result of using localhost as the server name in /etc/httpd/conf/extra/http-vhosts.conf but that is another of those files open to DA modification, and the bark seems benign, so I decided to live with it.
 
Hello,

This error:

[Tue Apr 8 08:42:02 2008] [error] mod_ssl: Init: Unable to read server certificate from file /etc/httpd/conf/ssl.crt/server.crt (OpenSSL library error follows)
[Tue Apr 8 08:42:02 2008] [error] OpenSSL: error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data

Usually means that your server.crt is empty or has yet to be filled.
You can recreate it with this:
http://help.directadmin.com/item.php?id=192

We'll look into the duplicate phpmodule issue.

John
 
Why do I have to recreate server.crt when using custombuild but when I use customapache everything works?

Also why is apache not starting after using custombuild using the options I quoted above?

This is a fresh install on CentOS 5. I have installed many using customapache with no problem.
 
I'm not too sure at this time. Possibly the certificate files existed before DA was installed, perhaps another install of apache. Custombuild won't create new certificates unless they're not there, since we wouldn't want to overwrite others that you already have setup. I'm currently in talks with smtalk about doing content checks of the certificates to be sure about having valid ones.

John
 
This was a new minimal install of CentOS. No apache stuff was there previously. Every time I tried to start apache it failed with the errors above about the php module and the errors above in the error_log.
 
floyd, thank you for the report :) In cooperation with John we added few more checks into the CustomBuild script and it will be available soon :) Have a good day!
 
It's fixed now. You can run "./build rewrite_confs" to fix your problems :)
 
I'm new to DA:

./build rewrite_confs

where am i supposed to run this ? and what is it fixing ? SSL or the extra line in the conf?

Thanks

Edit: Ran it from the custombuilds dir and get:

Starting httpd: Syntax error on line 1 of /etc/httpd/conf/extra/httpd-phpmodules.conf:
Cannot load /usr/lib/apache/mod_suphp.so into server: /usr/lib/apache/mod_suphp.so: cannot open shared object file: No such file or directory

So I commented out the first and only line in /etc/httpd/conf/extra/httpd-phpmodules.conf and apache started.

Is this fixed and i have an old install script?
 
Last edited:
Back
Top