PHP version...

Discussion in 'Installation/Configuration' started by ctroyp, Oct 9, 2005.

Thread Status:
Not open for further replies.
  1. falko

    falko Super Moderator

    There's one Apache tto much on your system... :D Try to find out which configuration files belong to your main Apache, and make sure that ISPConfig is writing to these files, not the ones of the other Apache.
     
  2. ctroyp

    ctroyp HowtoForge Supporter

    Yeah, I messed up by adding the third one when I was trying to install PHP4. The only install instructions I could find was with Apache as well. But, I understand how to do it now without Apache. Oh well, I will uninstall the third Apache.

    To remove the third Apache, would it be best to just delete all the associated files?
    *****
    I just ssh'd in to my server to rename the third apache directory to _apache2 and then restart my main apache. When I did it came back with:
    Code:
    [root@server1 init.d]# /etc/init.d/httpd restart
    Stopping httpd:                                            [  OK  ]
    Starting httpd: [Mon Oct 17 11:04:52 2005] [warn] module php4_module is already loaded, skipping
    [Mon Oct 17 11:04:52 2005] [warn] NameVirtualHost 192.168.2.50:80 has no VirtualHosts
                                                               [  OK  ]
    
     
  3. ctroyp

    ctroyp HowtoForge Supporter

    Why would I get the message, "NameVirtualHost 192.168.2.50:80 has no VirtualHosts". The main Apache loads the Vhosts_ISPConfig.conf file.

    This is what is in the main Apache config file for Virtual Hosts:
    Code:
    ### Section 3: Virtual Hosts
    #
    # VirtualHost: If you want to maintain multiple domains/hostnames on your
    # machine you can setup VirtualHost containers for them. Most configurations
    # use only name-based virtual hosts so the server doesn't need to worry about
    # IP addresses. This is indicated by the asterisks in the directives below.
    #
    # Please see the documentation at 
    # <URL:http://httpd.apache.org/docs-2.0/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your virtual host
    # configuration.
    
    #
    # Use name-based virtual hosting.
    #
    #NameVirtualHost *:80
    #
    # NOTE: NameVirtualHost cannot be used without a port specifier 
    # (e.g. :80) if mod_ssl is being used, due to the nature of the
    # SSL protocol.
    #
    
    #
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for requests without a known
    # server name.
    #
    #<VirtualHost *:80>
    #    ServerAdmin webmaster@dummy-host.example.com
    #    DocumentRoot /www/docs/dummy-host.example.com
    #    ServerName dummy-host.example.com
    #    ErrorLog logs/dummy-host.example.com-error_log
    #    CustomLog logs/dummy-host.example.com-access_log common
    #</VirtualHost>
    
    ###############ispconfig_log###############
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig
    
    <Directory /home/www/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    <Directory /home/www/*/user/*/web>
        Options +Includes -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    <Directory /home/www/*/cgi-bin>
        Options ExecCGI -Indexes
        AllowOverride None
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
        </Files>
    </Directory>
    
    Include /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf
    
    
     
  4. falko

    falko Super Moderator

    It's only a warning, nothing serious.

    What's in /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf?
     
  5. ctroyp

    ctroyp HowtoForge Supporter

    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.2.50:80
    NameVirtualHost 192.168.2.50:80
    #
    #
    ######################################
    # Vhost: www.mydomain1.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.50:80>
    ServerName www.mydomain1.com:80
    ServerAdmin webmaster@mydomain1.com
    DocumentRoot /home/www/web1/web
    ServerAlias mydomain1.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web1/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web1/phptmp/
    php_admin_value session.save_path /home/www/web1/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/home/www/web1/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: www.mydomain2.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.50:80>
    ServerName www.mydomain2.com:80
    ServerAdmin webmaster@mydomain2.com
    DocumentRoot /home/www/web2/web
    ServerAlias ftp.mydomain2.com mydomain2.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web2/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web2/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web2/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web2/phptmp/
    php_admin_value session.save_path /home/www/web2/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/home/www/web2/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web2/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web2/user/$1/web/$3
    RewriteEngine on
    RewriteCond %{HTTP_HOST}   ^ftp\.mydomain2\.com [NC]
    RewriteRule   ^/(.*)$  http://www.mydomain2.com/ftp/$1  [R]
    </VirtualHost>
    #
    #
    #
     
  6. falko

    falko Super Moderator

    Is it possible the you have the IP address 192.168.2.50 twice under Management -> Server -> Settings? Once in "IP Address" and once in "IP List"? If so, remove it from "IP List".
     
  7. ctroyp

    ctroyp HowtoForge Supporter

    192.168.2.50 was in both places. I removed the one from the IP List and restarted the Apache. Still no luck though.
     
  8. falko

    falko Super Moderator

    I know, this was only the first step. :)
    Now you have to change something in ISPConfig for a web site, e.g. switch on/off SSI for a web site, so that ISPConfig sees that there's a change for a web site and rewrites the Apache configuration.
     
  9. ctroyp

    ctroyp HowtoForge Supporter

    I thought we were on to something there, but it didn't help. I restarted apache too...

    Under each website in ISPConfig, should they both be using the same IP? 192.168.2.50?

    Also, I deleted the third Apache directories I had installed hoping this would help.

    I noticed one thing when rebooting my server. When it was booting back up I saw a message error for named ...something like pri.mydomain1.com and pri.mydomain2.com ...
    but it went too fast to record what it was actually saying.

    Any idea what that would mean??
     
    Last edited: Oct 18, 2005
  10. ctroyp

    ctroyp HowtoForge Supporter

    This wouldn't be a BIND issue would it?
     
  11. falko

    falko Super Moderator

    I have no idea. :confused: Did you have a look at /var/log/messages and /var/log/syslog?
     
  12. ctroyp

    ctroyp HowtoForge Supporter

    Here is what I found in the /var/log/messages file. Nothing looks too peculiar beyond this:

    Code:
    Oct 17 18:06:33 server1 named: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
    Oct 17 18:06:33 server1 named: zone 2.168.192.in-addr.arpa/IN: loaded serial 2005092901
    Oct 17 18:06:33 server1 named: dns_master_load: pri.mydomain1.com:22: server1.mydomain1.com: CNAME and other data
    Oct 17 18:06:33 server1 named: zone mydomain1.com/IN: loading master file pri.mydomain1.com: CNAME and other data
    Oct 17 18:06:33 server1 named: _default/mydomain1.com/IN: CNAME and other data
    Oct 17 18:06:33 server1 named: zone mydomain2.com/IN: loaded serial 2005100301
    
    I also looked in the other logs and didn't see any relevant error messages.

    Some final questions before I jump into a reinstall:
    1) How can I confirm that ISPConfig is writing to my main Apache?

    2) Would you happen to have a copy of a basic FC4 Apache conf file w/ISPConfig installed that I could compare to? If you have it readily available...I am just hoping I haven't overlloked the simple stuff...

    3) This obviouly happened when I installed the third Apache with PHP4 support. Can you think of anything that could have caused this corruption. Here is a link that I used to install the PHP4 and Apache.

    4) I have two sites configured in ISPConfig. Should they both be using the 192.168.2.50? I presume, yes, but where does the 192.168.2.51 and eth0:0 fall in? Is that just to run the ISPConfig interface?

    Well, that's all I can think of. If I cannot clue in to anything from the above questions, I guess I will dive into a complete reinstall--eeeek!

    Thanks Falko and Till for any additional help...
     
    Last edited: Oct 18, 2005
  13. falko

    falko Super Moderator

    I think you should consider a complete re-install of the whole system. The current one seems to be pretty messed up...

    I guess this happened because you didn't use Fedora packages, but instead installed PHP4 manually.

    No, you can run all on just one IP address. I guess you're referring to the section "Configure Additional IP Addresses" on http://www.howtoforge.com/perfect_setup_fedora_core_4_p3. This is just to demonstrate how to add additional IP addresses if you need them. E.g., if you have multiple SSL web sites, then you need one IP address per SSL web site.
     
  14. ctroyp

    ctroyp HowtoForge Supporter

    You have confirmed my fate... :(
    At least I have learned a couple things not to do.

    I will look up info on how to use the packages next time. Can I select PHP4 during the Fedora install?

    Makes sense now...thanks for explaining.
     
  15. falko

    falko Super Moderator

    You can search for PHP packages with
    Code:
    yum search php
     
  16. ctroyp

    ctroyp HowtoForge Supporter

    Thanks Falko...I won't bore you with my ignorance any longer.

    I will read up on Yum.

    Thanks again for all the help.

    I will let you know how things turn out...
     
  17. ctroyp

    ctroyp HowtoForge Supporter

    Falko,
    I am in the process of reinstalling my server. I am at the point in the FC4 perfect setup where it directs me to install Apache with PHP5.
    Code:
    Apache With PHP5
    
    apt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick
    
    Now edit /etc/httpd/conf.d/php.conf and comment out the AddHandler and AddType lines:
    [CODE]
    #
    # PHP is an HTML-embedded scripting language which attempts to make it
    # easy for developers to write dynamically generated webpages.
    #
    
    LoadModule php5_module modules/libphp5.so
    
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    #AddHandler php5-script .php
    #AddType text/html .php
    
    #
    # Add index.php to the list of files that will be served as directory
    # indexes.
    #
    DirectoryIndex index.php
    
    #
    # Uncomment the following line to allow PHP to pretty-print .phps
    # files as PHP source code:
    #
    #AddType application/x-httpd-php-source .phps
    [/CODE]

    How do I need to change these commands to install PHP4.4.0? I don't want to get into the mess I did last time with PHP5 on my main Apache, although the ISPConfig Apache PHP5 will still be installed after the main Apache.

    Thanks,
    Troy
     
  18. till

    till Super Moderator

    I'am not sure if FC4 comes with php4 at all. Did you get any results if you run:

    yum search php4
     
  19. ctroyp

    ctroyp HowtoForge Supporter

    Here are the results:
    Code:
    [root@server1 ~]# yum search php4
    Searching Packages:
    Setting up repositories
    updates-released          100% |=========================|  951 B    00:00
    extras                    100% |=========================| 1.1 kB    00:00
    base                      100% |=========================| 1.1 kB    00:00
    Reading repository metadata in from local files
    primary.xml.gz            100% |=========================| 343 kB    00:02
    updates-re: ################################################## 967/967
    Added 35 new packages, deleted 23 old in 3.06 seconds
    primary.xml.gz            100% |=========================| 877 kB    00:05
    extras    : ################################################## 2440/2440
    Added 2 new packages, deleted 204 old in 6.00 seconds
    
    
    squirrelmail.noarch                      1.4.4-2                base
    Matched from:
    SquirrelMail is a standards-based webmail package written in PHP4. It
    includes built-in pure PHP support for the IMAP and SMTP protocols, and
    all pages render in pure HTML 4.0 (with no Javascript) for maximum
    compatibility across browsers.  It has very few requirements and is very
    easy to configure and install. SquirrelMail has all the functionality
    you would want from an email client, including strong MIME support,
    address books, and folder manipulation.
    
    
    squirrelmail.noarch                      1.4.6-0.cvs20050812.1. updates-released
    Matched from:
    SquirrelMail is a standards-based webmail package written in PHP4. It
    includes built-in pure PHP support for the IMAP and SMTP protocols, and
    all pages render in pure HTML 4.0 (with no Javascript) for maximum
    compatibility across browsers.  It has very few requirements and is very
    easy to configure and install. SquirrelMail has all the functionality
    you would want from an email client, including strong MIME support,
    address books, and folder manipulation.
    [root@server1 ~]# updatedb
    [root@server1 ~]# locate php4
    /usr/share/swig/1.3.24/php4
    /usr/share/swig/1.3.24/php4/std_pair.i
    /usr/share/swig/1.3.24/php4/typemaps.i
    /usr/share/swig/1.3.24/php4/std_map.i
    /usr/share/swig/1.3.24/php4/php4kw.swg
    /usr/share/swig/1.3.24/php4/php4.swg
    /usr/share/swig/1.3.24/php4/php4run.swg
    /usr/share/swig/1.3.24/php4/std_string.i
    /usr/share/swig/1.3.24/php4/std_vector.i
    /usr/share/swig/1.3.24/php4/std_common.i
    /usr/share/swig/1.3.24/php4/utils.i
    [root@server1 ~]#
    
     
  20. till

    till Super Moderator

    It looks like there are no PHP4 packages available for Fedora Core 4. So you have to use the PHP5 packages or compile and install PHP manually, which I can not recommend.
     
Thread Status:
Not open for further replies.

Share This Page