The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

My Host Machines HOME Directory

Discussion in 'General Discussion' started by Pete, Dec 23, 2001.

  1. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    When we try to connect to the machine that we are using for our hosting machine via a browser (http://xxxx.ourdomain.com) we unexpectedly get one of the virtual domains being hosted on that machine. It was suggested that we set up an account for that machine under WebHost but when we tried doing that WebHost informs us that such an account already exist...
    I guess what we\'re now searching for is the directory where the information is coming from so we can set up some html files to provide support from that machine, - or if that\'s not possible then the line within the httpd.conf that will set up the proper structure for reading html files when calling up that machine..
    Suggestions appreciated...
     
  2. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    The first virtualhost for that IP number in httpd.conf is the one you need to look for. Whatever you put as the index.html in that host\'s public_html displays when you put xxx.anyotherdomain.com in the browser.

    If the domain is enabled for subdomains in WHM then xxx.otherdomain.com will redirect to the main site.

    If all this looks like a Chinese puzzle just let me know :D
     
  3. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Maybe I should explain my problem in a little more detail..

    (1) My main domain is, asianet.net and under that domain I have set up a machine called, for example, xxxx.asianet.net to handle the virtual hosting.

    (2) During the initial setup for Cpanel an account was created for this xxxx.asianet.net machine BUT naturally it doesn\'t show up in the list of virtual machines under WebHost..

    (3) If I try to use WebHost to create an account called xxxx.asianet.net WebHost indicates that that account already exist.

    Naturally I don\'t want someone typing xxxx.hsta.asianet.net to get one of the virtual host, I want virtual host to be called ONLY from their own address

    I want to put some html on that machine to support those virtual host which would be accessible at xxxx.asianet.net.

    Since the main web directory under that machine (www.html) won\'t show, I am trying to find a work-around for this problem.
     
  4. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    [quote:059d5854c8] I want to put some html on that machine to support those virtual host which would be accessible at xxxx.asianet.net.

    Since the main web directory under that machine (www.html) won\'t show, I am trying to find a work-around for this problem.


    [/quote:059d5854c8]
    Actually you do have a web directory under your machine name. Just put an index.html file in /usr/local/apache/htdocs and then type your host name xxx.domain.com in your browser. You should be able to view the file. :cool:
     
  5. indiboi

    indiboi Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    make sure you have a virtualhost directive for your machine name and that you have subdomains \"disabled\" for it, ie, you don\'t have any server aliases for it including a star, and that the document root for it points to /usr/local/apache/htdocs.
     
  6. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Looked at /usr/local/apache/htdocs before and actually tried writing a simple \"hello\" but that did not function when I tried it before from that location. Still got a virtual domain\'s page instead of my simple \"hello\" message.

    Looks like I\'m going to have to go back to Burst and ask them to take another look at their setup and either fix it or tell me how to....
     
  7. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    [quote:6914803e61]Looked at /usr/local/apache/htdocs before and actually tried writing a simple \"hello\" but that did not function when I tried it before from that location. Still got a virtual domain\'s page instead of my simple \"hello\" message.
    [/quote:6914803e61]
    Try to make sure you have the following in your httpd.conf:

    [code:1:6914803e61]DocumentRoot /usr/local/apache/htdocs

    <Directory \"/usr/local/apache/htdocs\">
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>[/code:1:6914803e61]
    The Options line can be individualized as you see fit.

    Also check out the first virtual host in your httpd.conf that has the IP address for xxx.machine.com. The IP address displays on the <VirtualHost xx.xx.xx.xx> line. You\'ll most likely find that the index.html page in that host\'s document directory is what you see when you access your machine\'s URL or IP address from your browser.
     
  8. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    First, let me say that I most certainly appreciate the replies and the quickness of the responses. This is really fantastic help and support...

    Per your recommendation I took a look at the httpd.conf file. It looks like everything is set as you said it should be. Here is what I have:

    #First, we configure the \"default\" to be a very restrictive set of permissions.
    #
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    #
    #Note that from this point forward you must specifically allow particular features to be enabled - so if something\'s not working as you might expect, make sure that you have specifically enabled it below.
    #
    #This should be changed to whatever you set DocumentRoot to.
    #
    <Directory \"/usr/local/apache/htdocs\">
    #
    #Note that \"MultiViews\" must be named *explicitly* -- \"Options All\" doesn\'t give it to you.
    #
    Options Indexes FollowSymLinks MultiViews
    #
    #\"AuthConfig\", and \"Limit\"
    #
    AllowOverride None
    #
    #Controls who cana get stuff from this server.
    #
    Order allow,deny
    Allow from all
    </Directory>

    Once again thanks for your continued help, it is greatly appreciated....

    On a super positive note, with this thread I may get promoted on this board and moved up out of the Junior ranks and into Member status (^_^)....
     
  9. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Pete,

    I assume you already have this in httpd.conf:
    [code:1:49dae16eaf] DocumentRoot /usr/local/apache/htdocs[/code:1:49dae16eaf].
    Have you checked whether the contents of the first virtual host are what you get when you access your machine\'s URL?
     
  10. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Ah Ha Found something interesting but not sure exactly what I found (^_^)... I\'ll talk about specific machines this trip...

    The entry for my hosting machine IS the first virtual machine listed in httpd.conf but when the machine hsta.asianet.net is called the virtual host for the virtual host listed SECOND is called up. In httpd.conf it looks to me like the main machine\'s listing is commented (#) out.. Hereis the difference between the two entries:

    #Added by cpanel 4.0.0-STABLE_97 install

    NameVirtualHost xxx.xx.xx.xx

    #<VirtualHost xx.xx.xx.xx>
    #ServerAdmin webmaster@hsta.asianet.net
    #DocumentRoot /var/www/html
    #BytesLog domlogs/hsta.asianet.net-bytes_log
    #ServerName hsta.asianet.net
    #CustomLog domlogs/hsta.asianet.net combined
    #ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
    #</VirtualHost>

    #NameVirtualHost xxx.xx.xx.xx:80
    <VirtualHost xxx.xx.xx.xx>
    ServerAlias www.vfwtokyo.org vfwtokyo.org
    ServerAdmin webmaster@vfwtokyo.org
    DocumentRoot /home/vfwtokyo/public_html
    BytesLog domlogs/vfwtokyo.org-bytes_log
    ServerName www.vfwtokyo.org
    CustomLog domlogs/vfwtokyo.org combined
    ScriptAlias /cgi-bin/ /home/vfwtokyo/public_html/cgi-bin/
    </VirtualHost>

    From what I observe, but have no idea what affect it has, is that the very first instance of NameVirtualHost is NOT commented out but it also does NOT have the :80 port assignment. And all the lines for my machine\'s entry are commented out.

    I\'m wondering if this is the way WebHost configured it and if so, if I uncomment out those lines pertaining to the machine, will WebHost possibly put the comments back when I use it to add the next virtual host? Which should I try first, entering port 80 to the first line, or uncommenting, or both?

    This is almost becoming fun as I am learning a lot in the process, but then again I apologize for bothering you so much with this.




    [Edited on 12/26/01 by Pete]
     
  11. indiboi

    indiboi Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    interesting...
    I manually added my own virtual host as the first one in the range of virtualhosts, as it did not exist in my httpd.conf.

    You should be able to correct the entry to point exactly where you want it to go, uncomment it, restart apache... etc, and it should begin to work, I doubt WHM/Cp will comment it back out, and as far as I\'m aware, you can\'t name your machine and direct webtraffic to the primary htdocs through WHM.
     
  12. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Commented out the entry for the machine and also added the port assignment :80 at the end of the first virtual server address, restarted the httpd services using WebHost and whamooo is WORKS.... Can now access the machine with a browser and get what I want... Looks like I\'ll have to start another thread though on Apache Server Status because when I restarted httpd with WebHost an error was displayed but I didn\'t pay to much attention as I wanted to quickly find out if the machine was now viewable or not....

    This has been a really valuable learning experience. I almost feel confident enough now to help anyone else who might wind up with a similar problem..

    Now the question is WHY would that initial entry be commented out? Is this the case with all CPanel installations, or just a quirk of fate during the initial setup of my machine?

    I can\'t thank you guys enough for helping me lick this problem. It was really bugging me. The support on this board is absolutely fantastic. I hope some day soon to be able to contribute and help others as much as you folks have helped me.. Again THANKS!!
     
  13. indiboi

    indiboi Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    it was probably done by your deds provider, mine didn\'t have any entries for the host name, yours had them commented out, just part of the \"how do I get this the way I want it\" experience.

    The server status error when you restart apache in WHM is resolved by uncommenting the sections in the httpd.conf regarding /server-status/ and /server-info/ and putting the allow from to match your hostname (that way random people can\'t look).
     
  14. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    Pete,

    [quote:56fcd24e04] Now the question is WHY would that initial entry be commented out? Is this the case with all CPanel installations, or just a quirk of fate during the initial setup of my machine?
    [/quote:56fcd24e04]
    You don\'t actually need a VirtualHost entry for your machine name for the system to work, although it won\'t do any harm either.

    This line in httpd.conf ensures that you can reach your machine with its host name from a browser:

    [code:1:56fcd24e04]ServerName hsta.asianet.net [/code:1:56fcd24e04]
     
  15. Pete

    Pete Well-Known Member

    Joined:
    Dec 19, 2001
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
     
Loading...

Share This Page