Skip to main navigation
#! code
Code Tips, Snippets, Resources, Tutorials And Help
  • Home
  • Tools
  • About
  • Contact

Localhost Apache 2 Server Warning On Ubuntu 11

By philipnorton42 on 19th September 2011

I was recently setting up a localhost environment with Ubuntu 11 and after adding all of my needed VirtualVost directives I found that I could start/restart the server but that I found the following error when trying to start the server.

  1. [email protected]:/etc/apache2/sites-available$ sudo apache2ctl -k start
  2. apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

To fix the problem you needed to add a simple directive to the Apache httpd.conf file. In order to access this file you'll need be have admin access, so open up a terminal window and type the following command.

sudo gedit /etc/apache2/httpd.conf

Don't worry if the file you open is empty, it is meant to be. The httpd.conf file is a user editable file that you can add directives to in order to configure your Apache install. What we need to do with this file is enter a directive that will give the server a name. Because we are not using a DNS server (as it is local) we need to let Apache know what to call itself. Enter the following directive.

  1. ServerName localhost

Save this file and close it. When you are done you can restart the server by typing in the following command.

sudo apache2ctl -k restart

Your Apache server will now start with no annoying warnings or errors (as long as the rest of your configuration is correct).

Category
Apache
Tags
Apache

Comments

Permalink

Anonymous coward - Wed, 09/21/2011 - 08:41

apache is awesome, but  nginx is way more efficient.

Add new comment

The content of this field is kept private and will not be shown publicly.
About text formats
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
  • Add new comment

Categories

  • Ansible
  • Apache
  • Book Reviews
  • CSS
  • DOS/Windows
  • Drupal
    • Drupal 8
    • SimpleTest
  • Flex/Flash
  • General
  • Git
  • HTML/XHTML
  • JavaScript
    • JavaScript Strings
    • JavaScript Websites
    • JQuery
    • MooTools
    • OpenLayers
    • Script.aculo.us
  • Linux/Unix
  • MS SQL
  • OSX
  • PhoneGap
  • PHP
    • Phing
    • PHP Arrays
    • PHP Questions
    • PHP Strings
    • PHP Websites
    • Zend Framework
  • PostgreSQL
  • Python
  • Regular Expressions
  • Regular Expressions Websites
  • SQL
    • MS SQL
    • MySQL
    • PostgreSQL
  • Vagrant
  • Websites
  • WordPress

User login

  • Reset your password

© 2019 #! code

  • Twitter
  • Facebook
  • Google+
  • Github
  • RSS
  • Colophon
  • Privacy Policy
  • Terms and License