DocumentRoot syntax error in a VirtualHost config on Apache

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • camphor
    New Member
    • Sep 2006
    • 35

    DocumentRoot syntax error in a VirtualHost config on Apache

    hi,

    I am very new to PHP and trying to set up a virtual host in Apache so I can test the protx Form PHP Intergration kit

    I received this message after I restarted Apache:
    Code:
    Syntax error on line 466 of c:/server/conf/httpd.conf: invalid command 'DocumentRoot/www/server/htdocs/VSPForm-kit' perhaps mispelled or defined by a module not included in the server configuration
    I installed the latest version of Apache on windows xp as well as PHP
    I put VSPForm-kit in c:/server/htdocs and the spelling is correct.
    How would you define a module not included in the server configuration

    Code:
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    <VirtualHost 127.0.0.1>
    ServerName localhost:80
    DocumentRoot/www/server/htdocs/VSPForm-Kit   Line 466
    </VirtualHost>
    I typed http://localhost/VSPForm-kit but the welcome.php page did not show
    I added welcome.php under
    Code:
    <IfModule dir_module>
        DirectoryIndex index.html index.php default.html welcome.php
    </IfModule>
    Any help appreciated
    Last edited by Atli; Nov 21 '07, 10:25 PM. Reason: Added [code] tags.
  • andho
    New Member
    • Sep 2007
    • 34

    #2
    Originally posted by camphor
    Syntax error on line 466 of c:/server/conf/httpd.conf: invalid command 'DocumentRoot/www/server/htdocs/VSPForm-kit' perhaps mispelled or defined by a module not included in the server configuration
    its as the error says: invalid command

    there should be a space after "DocumentRo ot" and i dont think that "Line 466" belongs there either

    Comment

    • camphor
      New Member
      • Sep 2006
      • 35

      #3
      Had a look at the Apache website and DocumentRoot has no space and I know line 466 is not suppose to be there, I just put it in just for reference. I am not sure how to fix this problem

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Hi.

        What I think andho means is that there should be a space after the DocumentRoot command.

        For example:
        Code:
        // Your line is like this
        DocumentRoot/usr/local/apache/htdocs
        
        // While it should be like this
        DocumentRoot /usr/local/apache/htdocs
        Check out this page for an example of the <VirtualHost> directive.

        P.S.
        I've change the title of this thread to better describe it's contents.

        Please use good, descriptive, titles for you threads. It helps our other members finding questions they can help with, as well as making it easier for people looking for answers to a similar question.
        Check out the Posting Guidelines for more on how to create good thread titles.

        Thank you.

        Comment

        • camphor
          New Member
          • Sep 2006
          • 35

          #5
          I put a space as per your suggestion DocumentRoot /www/server/htdocs/VSPForm-kit, there was no error when I started Apache but when I typed http://localhost/VSPForm-kit in my browser, this message came up "Forbidden You don't have permission to access /VSPForm-kit on this server." Even when I typed in http://localhost it also came up with ghe same error message. Why?

          Comment

          • Atli
            Recognized Expert Expert
            • Nov 2006
            • 5062

            #6
            I would bet that has something to do with the directory permission.

            Try doing something like:
            Code:
            chmod -R 755 /www/server/htdocs/VSPForm-kit
            Note, this will change the permission for all files and folders in all subdirectories of the given directory!

            Comment

            • camphor
              New Member
              • Sep 2006
              • 35

              #7
              Originally posted by Atli
              I would bet that has something to do with the directory permission.

              Try doing something like:
              Code:
              chmod -R 755 /www/server/htdocs/VSPForm-kit
              Note, this will change the permission for all files and folders in all subdirectories of the given directory!
              I am not sure where to put chmod -R 755 /www/server/htdocs/VSPForm-kit
              within <VirtualHost>
              Code:
              <VirtualHost 127.0.0.1>
              ServerName VSPForm-Kit
              DocumentRoot /www/htdocs/VSPForm-Kit
              <Directory c:/server/htdocs/VSPForm-kit>
              Options Indexes FollowSymLinks Includes ExecCGI
              AllowOverride FileInfo
              Order allow,deny
              Allow from all
              </Directory>
              </VirtualHost>

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                Originally posted by camphor
                I am not sure where to put chmod -R 755 /www/server/htdocs/VSPForm-kit
                within <VirtualHost>
                It shouldn't be.

                The chmod command is a Linux command which should be executed on the server through the CLI.

                If you don't have access to the server itself, you can probably execute the chmod command through FTP, although the -R property might not work through FTP.

                Most FTP clients offer some sort of interface to change file permissions so you may want to check that out if you use such a client.

                Comment

                • camphor
                  New Member
                  • Sep 2006
                  • 35

                  #9
                  Originally posted by Atli
                  I would bet that has something to do with the directory permission.

                  Try doing something like:
                  Code:
                  chmod -R 755 /www/server/htdocs/VSPForm-kit
                  Note, this will change the permission for all files and folders in all subdirectories of the given directory!
                  is there a way of changing the directory permission within Windows as I am using apache on windows

                  Comment

                  • Atli
                    Recognized Expert Expert
                    • Nov 2006
                    • 5062

                    #10
                    Originally posted by camphor
                    is there a way of changing the directory permission within Windows as I am using apache on windows
                    Yea sure thats possible.

                    First of all, you need to disable simple file sharing, so that you can mess with the permissions.

                    To do that, open a folder, select "Tools->Folder Options" from the main menu. Click the "View" tab and un-check the bottom checkbox in the list, titled "Use simple file sharing". Click OK to exit the window.

                    Then you need to set the permission, so that everybody has access to the folder.

                    Right click the folder you want to change the permission for. Click Properties. In the window that opens, select the "Security" tab.

                    If the user "Everyone" is in the list of users, make sure that he has "Read & Exectue", "List Folder Contents" and "Read" permissions.

                    If not, click the "Add" button, then the "Advanced" button and "Find now".
                    Select the user "Everyone" from the list and click OK on both of the open windows. Now make sure the permissions I listed earlier are set and click OK to exit the properties window.

                    Now it should be all set!

                    Comment

                    Working...