Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on "index.html" posted in "htdocs" does not work in the VPS & Dedicated forum
Hi, I am a complete newby to VPS and immediately ran into my first problem. I created a file with "vi" called "index.html" in /srv/www/htdocs ...

  1. #1
    JPC Member
    Join Date
    Sep 2006
    Posts
    5

    Cool "index.html" posted in "htdocs" does not work

    Hi, I am a complete newby to VPS and immediately ran into my first problem.

    I created a file with "vi" called "index.html" in /srv/www/htdocs and the message to be shown is "hello world".

    When browsing to this page via the worldwideweb, I got the standard message like
    "Hey it worked! The SSL/TLS-aware Apache webserver was ..."
    So quite obvious, not what I wanted to see.

    I also created, (in terminal mode) a subdirectory, with some html and php-pages in it. None of them showed up in my browser.

    Doing the same, as described above on my SUSE laptop works fine. So what am I missing here? What do I need to do on this VPS server to get my webpages up & running?
    Could somebody help me on this?
    Regards,
    Johan

  2. #2
    JPC Support Smithjp's Avatar
    Join Date
    Jun 2006
    Location
    Planet Earth
    Posts
    166
    It appears that the default document root for the Apache is not /srv/www/htdocs thats why your index page is not loading. You can check the DocumentRook in httpd.conf and place the webpages there or if you are not comfortable in making changes to httpd.conf, open a support ticket and we will assist you further in this regard.

  3. #3
    JPC Member
    Join Date
    Sep 2006
    Posts
    5
    Well, I'm a bit puzzled, since my httpd.conf has a call to
    "Include /etc/apache2/default-server.conf" and when looking in default-server.conf, I find a line DocumentRoot "/srv/www/htdocs"

    So, this seems OK to me. So, I am trying to understand the problem.
    Anybody, a suggestion.

    Regards,
    Johan

  4. #4
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    OK. So default Apache install page appeared. Good.

    Now continue with "Section 1: Global Environment". Since you got a response page earlier, you're OK in this section. If you are not running any virtual servers, then the "main" server settings should be all you need to review, so move on to "Section 2: 'Main' server configuration". I'm suggesting you try creating a seperate serving directory to work out bugs until you understand what's going on, but you don't have to. Just remember that I'm trying to seperate what you create from what Apache provides in its default configuration. If you screw up, you don't have to parse the Apache document tree for the files you created from the ones originally there:
    Code:
    ## Confirm your testing environment doctree
    # Default Root
    # DocumentRoot "/srv/www/htdocs"
    # Custom Root
    DocumentRoot "/srv/www/testhtml"
    
    ## Now, modify the main Directory features
    # Default
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    
    ## Now, expand features
    # Default
    # <Directory "/srv/www/htdocs">
    # Custom
    <Directory "/srv/www/testhtml">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
    DirectoryIndex index.html
    This should create a basic starting configuration to serve documents from your customized, serving "root" directory. If you place an index.html (-rwxr-xr-x) in /srv/www/testhtml, you should be able to browse to it like normal whether you type in the exact URI or just your FQDN. This is a very simple start-up and does not address the many security or customized manipulations of Apache; however, it should at least get you started in understanding the interrelationship between the server binaries, the default documents, the main server configuration files, the per directory configuration files, and the "root" startup page (index.html).

    You may know or have done all of this already, but I figure the oversight was the starting Directory directives and/or the DirectoryIndex directive. If it works, let us know. If it doesn't, let us know. Perhaps other can chime in and guide you further.

  5. #5
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Whoops. Forgot to remind you to restart the webserver when you make a change to httpd.conf:

    Remember to restart the HTTPd daemon when you make a change to httpd.conf.

  6. #6
    JPC Member
    Join Date
    Sep 2006
    Posts
    5
    Thanks,

    I did what you explained me to do, but I am still getting the "Hey it worked!" So I will be opening a ticket, like SmthJPC told me.

    Thanks for the suggestions anyway.
    Raisor

Bookmarks

Posting Permissions

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