SDB:Apache 2 FAQ (Frequently Asked Questions)

Şuraya atla: kullan, ara



İçindekiler

Apache 2? What's new?

See the documentation on the Apache site. Good starting points are: http://httpd.apache.org/
http://httpd.apache.org/docs-2.0/
See http://httpd.apache.org/docs-2.0/new_features_2_0.html for new features of Apache 2.


Where can I find the latest packages?

ftp://ftp.suse.com/pub/projects/apache/
http://ftp.gwdg.de/pub/linux/suse/ftp.suse.com/projects/apache/
ftp://ftp.leo.org/pub/comp/os/unix/linux/suse/people/poeml/ These packages are unsupported and provided as-is. Read ftp://ftp.suse.com/pub/projects/apache/README.


I'm unsure whether I should upgrade to apache2 or stick to apache1.

Apache 2 itself is stable, but it is missing (at the time of this writing) some modules that are in common use (most notably, mod_perl and mod_php4). Those apache 2 modules are under development and it seems like a question of time when they appear. apache 1 and apache 2 can be installed on the same system. This facilitates evalation of the new version and allows for performance comparisons. The two versions can even be run in parallel. However, there is only one port 80 on your system. If you really need both versions of apache on one system, run one of them on another port and use mod_proxy with the port 80 server to map it into the URL space. Reasons to upgrade:

    • You want Ipv6 support
    • You want to run a Subversion server so need the mod_dav_svn module

Reasons not to upgrade:

    • You need an apache module that is not yet available or not stable (e.g., mod_perl or mod_php4) and you cannot take the risk to try out new software
    • You need another certain module that is only available for Apache 1

Apache 2, if built from the sources available from the apache site with the usual 'configure; make; make install' sequence, installs everything cleanly below one directory. Even the logs will be inside the server root. This is a very safe way of trying out Apache 2 without breaking anything on a running system which is maintained with RPM.


My apache2 will not start. No error_logs. Any hints?

The apache2 start script as of 8.1 quits silently when no "multiprocessing module" (MPM) package was installed, like the apache2-prefork.rpm. The same symptom could occur when only another MPM than the default one was installed. Have a look at the APACHE_MPM setting in /etc/sysconfig/apache2. Put an MPM name there that corresponds with the MPM installed that you want to use. In later packages, this is fixed.


When installing apache2 in SuSE 8.1, the server will not start because the APACHE_MODULES line /etc/sysconfig/apache2 has an error. The list of modules is enclosed in parentheses and apache complains about not being able to find "mod_(access". Removing the parentheses allows apache2 to start.

That happened in 8.1 when the YaST2 sysconfig editor had been used together with the original apache2 packages from 8.1. Those packages used a shell array for the APACHE_MODULES variable, but the accompanying syntax was disturbed by the quotes that YaST2 added around the parentheses. Upgrading to the apache2 packages (see SDB:Apache 2 FAQ (Frequently Asked Questions)#latest above) will fix this. Alternatively, remove the double quotes around the parentheses after using the YaST2 sysconfig editor.


When I try to upgrade Apache I see: error: failed dependencies: apache2-MPM is needed by apache2-2.0.48-0. Where to find apache2-MPM ??

apache2-MPM is is not the actual name of a package but a "capability" that is provided by some other packages, for example by the package apache2-prefork. Multi-processing modules (MPM) are the core of apache2, see http://httpd.apache.org/docs-2.0/mpm.html for more info about them.


1. apache2-2.0.43-6.i586.rpm can be installed only if an MPM package is installed. 2. I have tried to install the MPM apache2-perchild-2.0.43-6.i586.rpm, but I get the error apache2-perchild requires apache_mmn_20020903_0

The base package (apache2-2.0.43-6.i586.rpm) and the MPM packages (e.g., apache2-prefork-2.0.43-6.i586.rpm) do mutually require each other --- they need to be installed in one run to make the package manager happy. (Like rpm -Uhv a.rpm b.rpm)


Can I use Comanche to configure Apache 2?

Comanche (http://www.comanche.org) has not been updated since Apr 11, 2001 (at the time this is written). It *might* work with apache2, but it seems unlikely. Unfortunately, comanche is broken as of 8.1, because it became incompatible with the current Tcl version. [If you happen to know how to fix this, please contact us. Thanks.]


How do I configure Apache 2 for SSL?

For 8.1: by hand, following the apache and mod_ssl documentation. With later packages:

    1. place your server certificates in /etc/apache2/ssl*/ so the locations match up with /etc/apache2/ssl.conf or run /usr/bin/gensslcert2 to create dummy certs
    2. add "ssl" to APACHE_MODULES and "SSL" to APACHE_SERVER_FLAGS in /etc/sysconfig/apache2

There is no mod_ssl RPM for apache2: The module is no longer a problem with regard to export restrictions and, in addition, mod_ssl has been included into the Apache base distribution. It is no longer a source code patch as it used to be with Apache 1. Some additional information can be found here:
http://www.ornl.gov/~jar/Apache/SSL_in_Apache_2.html
(kindly provided by James Rome)


apache2 just shows the default apache start page rather than the SuSEhelp (or system status information) screen, which apache1 on 8.0 did.

I believe that apache2 was not configured for susehelp on 8.1 (or vice versa). The system status page is not shown with Apache 2.


apache2 as well as subversion just show their usage information when I try to start them.

This is a typical symptom for an incompatibility between the apache2 and subversion package and the apr package. It can be resolved by updating the apr package, too.


Tried to review doc on apache.org for the start script and not sure how to start.

On apache.org, you will find 'apachectl' referenced as the standard tool to start apache2. Although this tool is available on SuSE Linux (named "apache2ctl"), using our slightly more powerful (and better integrated) tool named "rcapache2" is recommended. (That's actually the shell script /etc/init.d/apache2.) Enter "rcapache2 help" as user root to see what it can do. To start apache2, either enter "rcapache2 start" as root or use the YaST Runlevel Editor to activate the starting of apache2 at boot time. As a command line alternative to the Runlevel Editor, you could run the command "chkconfig -a apache2" to make sure that apache2 is started at system boot time.


Apache/1.3.27 (Linux/SuSE 8.2) fails to start while the system boots for some reason , i am starting SuSE in init 3 mode . Please help , thank you.

My crystal ball says that your machine has an nvidia graphics card, you have run the nvidia installer and since then apache doesn't start at boot any longer -- and you use PHP4. Cause: The libGL is replaced by the nvidia installer and it is broken in some regard... mod_php4 is linked against libGL... A workaround is to modify the apache start script as follows:

--- apache.init.orig    2003-07-29 16:28:25.000000000 +0200
+++ apache.init 2003-07-29 16:29:39.000000000 +0200
@@ -127,8 +127,8 @@
        check_modules yes ;
        echo -n "]"
        rm -f /var/lib/httpd/mod_bandwidth/link/* &>/dev/null
-       if $HTTPD_BIN $INET6 -t -f /etc/httpd/httpd.conf $MODULES > /var/log/httpd/rcapache.out 2>&1 ; then
-               startproc -t $HTTPD_START_TIMEOUT $HTTPD_BIN $INET6 -f /etc/httpd/httpd.conf $MODULES
+       if LD_PRELOAD=/usr/lib/GL/libGL.so.1.4.mesasoft $HTTPD_BIN $INET6 -t -f /etc/httpd/httpd.conf $MODULES > /var/log/httpd/rcapache.out 2>&1 ; then
+               LD_PRELOAD=/usr/lib/GL/libGL.so.1.4.mesasoft $HTTPD_BIN $INET6 -f /etc/httpd/httpd.conf $MODULES
                ret=$?
                if test -t 1 && stty -a | grep -q -- -echo\ ; then

Such a patched script can be found here:
http://www.suse.de/~poeml/rc.apache-82    (copy it to /etc/init.d/apache)


I've installed the rpms, Apache and mod_perl, mod_python and mod_php4. However, they don't seem to be taking effect. I've added : LoadModule php4_module /usr/lib/apache2-worker/libphp4.so to suse_loadmodule.conf but php files still try to download, are there any other places I need to add information to? - such as httpd.conf..

LoadModule php4_module                    /usr/lib/apache2-worker/libphp4.so

PHP4 module for the worker MPM? The PHP module exists only for the prefork MPM, due to the issues described here here... you need to have apache2-prefork installed, and APACHE_MPM in /etc/sysconfig/apache2 must not be set to "worker". By the way, you should not add anything to suse_loadmodule.conf, since the file is created from scratch each time apache is started. Thus your changes are overwritten. There should be a big warning commentary in the file, in fact. The point is that you just need to add "php4" to the APACHE_MODULES variable in /etc/sysconfig/apache2, and restart. This small change will automagically figure out the right LoadModule statement for you and put it into suse_loadmodule.conf. Do the same with other third party module (mod_perl, mod_python, ...)


I'm not seeing the correct Umlauts (like German ö).

You can adjust the default character set in mod_mime-defaults.conf

AddDefaultCharset UTF-8
to the character set you actually use. For example, you could set it to ISO-8859-1 (Latin1), which was the default before SUSE LINUX 9.0.

Note that this setting is effective / needed only for responses where the HTTP headers do not already contain a parameter on the content type (as in META tags). It is explained here: http://httpd.apache.org/docs-2.0/mod/core.html#adddefaultcharset. Furthermore, note that the setting can also be applied in the scope of a virtual host. <keyword>apache2,apache,httpd,http,web,server,start,faq</keyword>