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.

how to configure apache to display a website when someone enters an ip address

Discussion in 'Database Discussions' started by triatma, May 3, 2004.

  1. triatma

    triatma Member

    Joined:
    Apr 21, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    i have a cpanel server with 10-12 ips. i want to configure apache such that whenever somebody starts internet explorer and enters any of the ip addresses of my box, my main website is displayed.

    how do i configure apache to do that ?

    thanks, any help will be appreciated.
     
  2. RawG

    RawG Member

    Joined:
    May 2, 2004
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Hey triatma,

    You need to look into the <VirtualHost> directive in apache, and how to use it... With it you can specify which site to load based on IP address, and also host multiple web-sites from a single IP.

    These examples should point you in the right direction...

    http://httpd.apache.org/docs/vhosts/examples.html

    Hope that helps.
     
  3. triatma

    triatma Member

    Joined:
    Apr 21, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    still confused and don't know which example applies to me.

    i have 12 ips, and i want all requests to any ip directly to go only to one website.

    also which is the file that should be edited ? that url does not mention that.
     
  4. RawG

    RawG Member

    Joined:
    May 2, 2004
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Thats a bit harder... It depnds on how cpanel sets it's VirtualHost directives (I'm yet to use it, hanging out here to see what the comunity is like).

    I think the examples that apply to you are "IP-based vhosts"... look at, and carefully read each example then try to grasp what kind of setup they are describing, and if it is similar to what you want... they cover most every possible situation, so if you just keep your nose buried in the HTML, you'll come away with the answer you're looking for.

    As for what file to edit, that also depends on your system... On my web-server (slackware) this would be done in:

    /etc/apache/httpd.conf

    If you can't find it, try using 'locate httpd.conf' or 'find / -name httpd.conf' from a command prompt.
    Though, I suspect that cpanel uses a database to store it's configurations, and next time you use cpanel to make a change, any changes not done through cpanel could be overwritten..... can any cpanel employees confirm this?
     
  5. triatma

    triatma Member

    Joined:
    Apr 21, 2003
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    yes, i found the httpd.conf file thanks, but it still beats me how i can have only one website come up, based on any ip entered in the browser window.

    topic justifies some research on my part. thanks so much.
     
Loading...
Similar Threads - configure apache display
  1. LUDHIMILA KENDRICK
    Replies:
    1
    Views:
    526

Share This Page