How do I find out syntax errors in my Apache web server configuration file?




+ Reply to Thread
Results 1 to 6 of 6

Thread: How do I find out syntax errors in my Apache web server configuration file?

  1. #1
    Meer is offline Senior Member
    Join Date
    Sep 2010
    Posts
    179
    Feedback Score
    0

    How do I find out syntax errors in my Apache web server configuration file?

    Apache web server support special syntax checking. You can run syntax tests for configuration files only. Following two are important syntax checker option you can pass to apache binary program httpd (Red Hat/ Fedora Linux) or apache-perl (Debian Linux apache binary):
    Executing the following command, that will detect syntax errors:
    If you are using Debian Linux:
    # /usr/sbin/apache-perl -t
    Syntax OK
    If you are using Red Hat Linux:
    # /usr/sbin/httpd -t
    Syntax OK
    Where,
    • -t : The program immediately exits after these syntax parsing with either a return code of 0 (i.e. Syntax OK message) or return code not equal to 0 (i.e. Syntax Error message).
    Consider following example:
    # /usr/sbin/apache-perl -t
    Warning: DocumentRoot [/data/network/www/blogs] does not exist
    Syntax OK
    Replace it with -T option:
    /usr/sbin/apache-perl -T
    Syntax OK
    The option -T is same as option -t but does not check the configured document roots (warning message disappeared).
    Another example:
    Code:
    # /usr/sbin/apache-perl -t -S
    Syntax error on line 1059 of /etc/apache-perl/httpd.conf:
    Invalid command 'CustomLogl', perhaps mis-spelled or defined by a module not included in the server configuration
    As you see error on line number 1059 need to be fixed. Use vi text editor:
    Code:
    # vi +1059 /etc/apache-perl/httpd.conf
    After correction again retype command:
    Code:
    # /usr/sbin/apache-perl -t –S
    Output:
    VirtualHost configuration: 192.168.1.1:80 is a NameVirtualHost default server cyberciti.biz (/etc/apache-perl/httpd.conf:1053) port 80 namevhost cyberciti.biz (/etc/apache-perl/httpd.conf:1053) port 80 namevhost apps.cyberciti.biz (/etc/apache-perl/httpd.conf:1062) port 80 namevhost dl.cyberciti.biz (/etc/apache-perl/httpd.conf:1069) port 80 namevhost blogs.cyberciti.biz (/etc/apache-perl/httpd.

  2. #2
    rediman is offline Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Feedback Score
    0
    Great tut

  3. #3
    kites is offline Junior Member
    Join Date
    Apr 2011
    Posts
    2
    Feedback Score
    0
    Thanks buddy, great work

  4. #4
    ryker58 is offline Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Feedback Score
    0
    gr8 thanks

  5. #5
    purowl is offline Junior Member
    Join Date
    Jun 2011
    Posts
    2
    Feedback Score
    0
    thank u alot

  6. #6
    ryeane is offline Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Feedback Score
    0
    Great tutorial. Easy to follow

+ Reply to Thread

Visitors found this page by searching for:

apache httpd.conf configuration check syntax errors

how to check httpd syntax error in linux

warning DocumentRoot does not exist

checking syntax of the file apache

fedora 12 warning documentroot does not exist syntax ok

how to configure apache web server cyberciti

warning documentroot does not exist -selinux

httpd config cyberciti

debian apache documentroot does not exist

howto check apache syntax debian

documentroot does not exist apache redhat linux

check apache config syntax debian

detect php error that crashes thread

apache web server syntax

apache web server does not start syntax checking

redhat administrator <error> Checking Syntax Of The File [apache:

Syntax error --- The configuration file is us apache 1

find the errors

how to find configuration error in apache server

Apache Webserver configuration file forum

what is the syntax for checking the syntax error of configuration files

check if syntax errors on httpd conf

apache commands in linux check syntax

webserver syntax

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts