apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

Asked by Peeyush Chandel on 2010-07-15

hello

i am using ubutnu 10.04 and i installed apache2.2.14 and everything is working fine

then i try to install GNUPANEL(but it's installation was failed in last step)but it changed some configuration in my apache so

when i try to start apache then i got following message:

peeyush@peeyush-desktop:~$ sudo /etc/init.d/apache2 start
 * Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
no listening sockets available, shutting down
Unable to open logs
                                                                                                          [fail]

and the output of my /etc/hosts is:

127.0.0.1 localhost
127.0.1.1 peeyush-desktop

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

and output of /etc/apache2/apache2.conf and /etc/apache2/httpd.conf is empty
(it means these files contains nothing)

then i add this line

ServerName localhost

to /etc/apache2/apache2.conf file and save it

then i again try to start apache then got the following output:

peeyush@peeyush-desktop:~$ sudo /etc/init.d/apache2 start
 * Starting web server apache2
 no listening sockets available, shutting down
Unable to open logs
                                                                                                          [fail]

so please tell me how to solve this problem.

-Thanks
 Peeyush Chandel

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apache2 Edit question
Assignee:
No assignee Edit question
Last query:
2010-07-15
Last reply:
2010-07-16
Attila Vági (avagi) said : #1

check the file /etc/apache2/sites-enabled/000-default
use:
Listen 80

Peeyush Chandel (cpeeyush) said : #2

hey avagi

i am little confused please help me

current output of my /etc/apache2/sites-enabled/000-default is:

<VirtualHost *:80>
 ServerAdmin webmaster@localhost

 DocumentRoot /var/www
 <Directory />
  Options FollowSymLinks
  AllowOverride None
 </Directory>
 <Directory /var/www/>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  allow from all
 </Directory>

 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 <Directory "/usr/lib/cgi-bin">
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
 </Directory>

 ErrorLog /var/log/apache2/error.log

 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn

 CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

so where should i use:

Listen 80

Mikael Löfstrand (mikaelld) said : #3

In /etc/apache2/ports.conf.

My ports.conf (default install) looks like:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

Attila Vági (avagi) said : #4

The apache2 common practice is to use the Listen entry in /etc/apache2/ports.conf.

My best practice is to use Listen the entry always before the VirtualHost definition - so I never forget to set the port ... :-)

Listen 80
<VirtualHost *:80>
...
</VirtualHost>

Can you help with this problem?

Provide an answer of your own, or ask Peeyush Chandel for more information if necessary.

To post a message you must log in.