LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2005, 07:32 PM   #1
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Rep: Reputation: 15
Apache giving the error :Could not determine the server's fully qualified domain name


apachectl gives me this:

/usr/sbin/apachectl restart
Starting httpd2: httpd2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

can someone help?

this is my /etc/hosts/ file:

127.0.0.1 localhost
ServerName localhost

and this is my httpd.conf file:

### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /etc/httpd/2.0
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /var/www/html


### Dynamic Shared Object (DSO) Support
###
### You should always leave those three, as they are needed for
### normal use.
### mod_access (Order, Allow, etc..)
### mod_log_config (Transferlog, etc..)
### mod_mime (AddType, etc...)

LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
##LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
##LoadModule charset_lite_module modules/mod_charset_lite.so
##LoadModule case_filter_module modules/mod_case_filter.so
##LoadModule case_filter_in_module modules/mod_case_filter_in.so
##LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
##LoadModule mime_magic_module modules/mod_mime_magic.so
##LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
##LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
##LoadModule cgid_module modules/mod_cgid.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
##LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

###
### Global Configuration
###
# We now support multiple apache configurations on the same server. In
# common.conf, we put all directives that are common to all implementations
# (httpd, httpd-perl, etc.)
# For Apache2 we load all conf files in conf.d
Include /etc/httpd/conf.d/*.conf
Include conf/commonhttpd.conf


###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
Listen 80
</IfDefine>

# Likewise, we can set apache as the server by default and send perl
# requests via ProxyPass to apache-mod_perl. It increases performance
# since the perl interpreter is only used for perl and the standard apache
# does all the html and image files, with a smaller footprint.
#
# If you install apache and apache-mod_perl, this is the default config.
# If you don't want two web servers to use perl, uninstall apache, and
# apache-mod_perl will not be proxied.

<IfDefine PERLPROXIED>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^proxy:.* - [F]
RewriteRule ^(.*\/perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
RewriteRule ^(.*\/cgi-perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
</IfModule>
</IfDefine>

###
### Log configuration Section
###

<IfModule mod_log_config.c>
#Single logfile with access, agent and referer information
#This is the default, if vlogs are not defined for the main server
CustomLog logs/access_log combined env=!VLOG
#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG
</IfModule>

###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf


###
### Performance settings Section
###
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


# prefork MPM [THIS IS THE DEFAULT]
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>
 
Old 01-21-2005, 08:29 PM   #2
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
you may wish to put a server name directive in your config file i.e.:

Servername serverX.com

or you may wish to adjust your server's host name
( in a shell )
i.e.:

hostname serverX.com


its so apache knows what server name to listen out for





hope that helps a little
 
Old 01-21-2005, 08:46 PM   #3
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
nope, same error
 
Old 01-22-2005, 05:51 AM   #4
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
what fqdn did you set them to?
 
Old 01-22-2005, 03:41 PM   #5
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
What's that?
 
Old 01-22-2005, 04:17 PM   #6
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
sorry...
what did you set the hostname to?

and what did your set the Server Name directive to in apache ?
 
Old 01-22-2005, 08:28 PM   #7
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
i don't think that it's set to anything, so where would I put it?
 
Old 01-22-2005, 08:35 PM   #8
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
the ServerName one would go in the httpd.conf file and the host name bit would be a cmd line thing, i.e.:

hostname servername.domain.com
 
Old 01-22-2005, 08:45 PM   #9
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
Okay, I added this line to httpd2:
ServerName foo
and then, as root, entered:
hostname foo.bar.com
then started apache, with no success. Any other advice?
ps: thanks for the help!
 
Old 01-24-2005, 04:23 PM   #10
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
*shameless bump*
 
Old 01-29-2005, 12:44 PM   #11
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
*yet another shameless bump*(5 days)
 
Old 01-29-2005, 03:06 PM   #12
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
hostname foo.bar.com
This is not right. The hostname of a machine should not be a FQDN, that is what /etc/hosts is for. In your case it looks like you want to run 'hostname foo' at the command line and put a line such as:
Code:
<ip address>  foo.bar.com foo
in /etc/hosts.

This all depends on you actually owning the 'bar.com' domain, and having DNS pointing to the ip address you are running apache on, which I suspect you don't...you cannot make up an arbitrary ServerName using a FQDN

If you just want to play around with apache on your local system then you should have just put "ServerName localhost" in httpd.conf (actually it's there, just commented out). All apache is telling you with that error is that it didn't find a ServerName in your conf file, so it is using the default (127.0.0.1 is the same as 'localhost'). It should still work fine, and you should be able to navigate to http://127.0.0.1/ or http://localhost/ and see the test page.

PS: ServerName doesn't belong in /etc/hosts, it goes in httpd.conf

Last edited by bulliver; 01-29-2005 at 03:11 PM.
 
Old 02-05-2005, 06:04 PM   #13
bcf2
Member
 
Registered: Nov 2003
Location: Nowhere and somewhere
Distribution: Mandrake 10
Posts: 124

Original Poster
Rep: Reputation: 15
actually, that error causes apache to stop booting up, and therefore not launching, I then did the changes that you told me to do, and now apache fails to start without any error messages.
Thanks for all this help, though!

Last edited by bcf2; 02-05-2005 at 06:09 PM.
 
Old 10-06-2005, 05:24 PM   #14
syddel
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
Apache warning message

I had same problem when starting a freshly installed Apache 2 (on a box that doesn't have an FQDN):

gentoo bin # ./apachectl start
httpd: apr_sockaddr_info_get() failed for gentoo
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

However, when I do a:

netstat -tapn

I can see that Apache is listening on TCP port 80 (so I can then http://123.123.123.123).

To get rid of the warning message I added:

ServerName gentoo

to my httpd.conf file. Do a 'hostname' and then enter that value for ServerName in your httpd.conf file.

Hope that this helps.
 
Old 11-07-2005, 08:38 AM   #15
imanassypov
LQ Newbie
 
Registered: Sep 2005
Location: Toronto, Canada
Distribution: FreeBSD, Gentoo, NetBSD
Posts: 28

Rep: Reputation: 15
Hey guys,


On gentoo, you are supposed to explicitely specify the machines fqdn in the /etc/conf.d/hostname file, something like HOSTNAME="prelude.snort.com", and also in the /etc/conf.d/domainname would have DNSDOMAIN="snort.com"

Once those are set, reboot and start apache with

apache2ctl start, or equivalently, /etc/init.d/apache2 start
 
  


Reply

Tags
apache, could, domain, error, fully, httpd, name, servers



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
squid FATAL: Could not determine fully qualified hostname. Please set 'visible_hostn tarakthakor Linux - Networking 5 12-04-2010 05:29 AM
Fully Qualified Domain Name tumana Linux - Networking 4 06-10-2004 02:58 AM
Apache: httpd: Could not determine the server's fully qualified domain name.. shirtboy Linux - Software 1 11-20-2003 03:47 AM
Fully Qualified Domain Names? MasterC Linux - Networking 7 05-19-2003 01:38 PM
http: can't could not determine the servers fully qualified domain name, using 127xyz s7nner Linux - Newbie 4 05-05-2003 06:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration