5 Replies Latest reply on Sep 9, 2005 12:44 PM by Uncle RedBeard-Oracle

    Apache can't start with " error resolving localhost ..."

    Michel SALAIS
      Hi,
      I have Oracle 9.2.0.4 installed on a White Box Linux. This installation for some reason shows an Apache problem:
      When I try to start Apache then I have an error message stating the following
      "date and time [error] OPM: PRIV: error resolving host name localhost"
      then a message saying that httpd could not be started.

      This error is not added to the log file but displayed instead on the screen. Morever, files with names mm.*.sem and mm.*.mem are created in $ORACLE_HOME/Apache/Apache/logs.

      When I try "ping localhost" on this machine I have no problem and the name is correctly resolved!
      Can any one please tell me what could it be?
        • 1. Re: Apache can't start with " error resolving localhost ..."
          Uncle RedBeard-Oracle
          Hi Michel -

          It's been a while since I've worked with Apache, but I'll give it a shot. It sounds to me like the the 'ServerName:' parameter could be the culprit.

          <from the httpd.conf file>
          ServerName gives the name and port that the server uses to identify itself.
          This can often be determined automatically, but we recommend you specify it
          explicity to prevent problems during startup


          You can enter the locahost's hostname (i.e. linux1) or the localhost's IP address, not 127.0.0.1, but your host's public address (i.e. 192.168.0.1). Update the ServerName parameter and restart apache.

          Make sure that you update the correct httpd.conf file. If you are getting this error from the Apache server embedded in an Oracle install, then the httpd.conf will be found under the $ORACLE_HOME path (I appologize I can't remember the full path :). However, if this your Apache server from your Linux OS it will most likely be found under /etc or /etc/httpd or /etc/httpd/conf.

          -shawn
          • 2. Re: Apache can't start with " error resolving localhost ..."
            Michel SALAIS
            Thanks for your reply.
            Yes I do use Apache which is shipped with Oracle. The Configuration file in that case is $ORACLE_HOME/Apache/Apache/conf/httpd.conf

            I have already checked ServerName in this file and it is the host name. To put you in the context, the machine has changed its name and I changed all occurences accordingly. I have done it already for another machine without any problem.
            • 3. Re: Apache can't start with " error resolving localhost ..."
              Uncle RedBeard-Oracle
              Michel -

              Any time. That's quite odd. And has your /etc/hosts file changed at all? Is the first line setup correctly to only include localhost and localhost.localdomain? Are you calling apachctl from $ORACLE_HOME/Apache/Apache/bin? You said you could ping localhost successfully, but have you been able to ping the localhost by name? Have you tried changing the value of the ServerName parameter from the localhost's name to its IP address?

              -shawn
              • 4. Re: Apache can't start with " error resolving localhost ..."
                Michel SALAIS
                Michel -

                Any time. That's quite odd. And has your /etc/hosts
                file changed at all? Is the first line setup
                correctly to only include localhost and
                localhost.localdomain?
                Yes it is.
                Are you calling apachctl from
                $ORACLE_HOME/Apache/Apache/bin?
                Well, I copy the file to /etc/init.d and launch Apache from there at startup. The reason is that I have changed the ports on which Apaceh will listen to 80.

                You said you could
                ping localhost successfully, but have you been able
                to ping the localhost by name?
                Yes. I did. Note please that the name of the machine is lx_26_100.

                ping localhost
                ping 127.0.0.1
                ping lx_26_100
                ping 10.26.1.100

                All of that works fine!
                Have you tried
                changing the value of the ServerName parameter from
                the localhost's name to its IP address?
                Well I didn't try this. I'll try it. However, the error message doesn't speak about lx_26-100 but instead it speaks about localhost not beeing resolved.

                By the way, what are the files mm.*.mem and mm.*.sem in the logs of Appache?
                -shawn
                Thanks Shawn.
                • 5. Re: Apache can't start with " error resolving localhost ..."
                  Uncle RedBeard-Oracle
                  <p>Michel -</p>

                  <p>> Well, I copy the file to /etc/init.d and launch Apache from there at startup. The reason is > that I have changed the ports on which Apaceh will listen to 80.</p>

                  <p>Try creating a soft link to the file in your /etc/init.d (ln -s $ORACLE_HOME/.../../apachectl /etc/init.d) directory instead of copying it there. That way when apache starts it will start from the correct location.</p>

                  <p>> Well I didn't try this. I'll try it. However, the error message doesn't speak about lx_26-100 > but instead it speaks about localhost not beeing resolved.</p>

                  <p>Typically, when I've seen these problems (related to Apache and other apps) it's the first line of your /etc/hosts that is the problem. Which is why I asked ;). However, I would first try the symlink before changing ServerName to the IP address.</p>

                  <p>The *.mem & *.sem file are memory dumps (memory and semaphores), I believe. See this article high level info or Apache website.</p>

                  <p>-shawn</p>