Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 36
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Question Server Name Location?????

    I have purchased a server that once had a different name.
    Now I have changed name in the whm panel. and on all new account pages it shows new server name, but when I try this script it still shows old name. Where would I find the server name outside of the whm panel to change it? Where is it Hiding?

    PHP Code:
    <p>Welcome to future home of <!--#echo var="SERVER_NAME" --></p> 

  2. #2
    Member Robert_'s Avatar
    Join Date
    Apr 2002
    Location
    Arizona
    Posts
    106

    Default

    pico /etc/hosts

    make sure it is showing the hostname you want if not change for example the srv1a's to your hostname


    # Do not remove the following line, or various programs
    # that require network functionality will fail.

    00.000.000.00 srv1a.domain.com srv1a
    127.0.0.1 localhost

    ctrl x


    pico /etc/sysconfig/network

    check that matches

    NETWORKING=yes
    HOSTNAME=srv1a.domain.com
    GATEWAY=00.000.000.00


    ctrl x



    Reboot and everything should work

    Keyword should!
    Regards, Robert


  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default

    Thanks Robert that worked

    using this on our skelton diretory

    PHP Code:
    <p>Welcome to future home of <!--#echo var="SERVER_NAME" --></p> 
    It returns this like it should

    Welcome to future home of server.name.net

    Any idea how we would change that script where it would show something like

    Welcome to future home of New Domain

    New Domain being the name of the site when a new user signs up?

    Like I said thanks again

  4. #4
    Member Robert_'s Avatar
    Join Date
    Apr 2002
    Location
    Arizona
    Posts
    106

    Default

    Im still setting up myself so this was a useful question.


    You can do it with php




    <p>
    Welcome to the future home of
    PHP Code:
    <?php echo "http://$SERVER_NAME"?>
    </p>
    Regards, Robert


  5. #5
    Member
    Join Date
    Sep 2001
    Location
    Spain
    Posts
    779

    Default

    Ok, that SERVER_NAME variable is just the Apache SERVER_NAME env variable, which is given by the ServerName directive of httpd.conf. If you go to:

    www.example.com

    it will show "Welcome to future home of www.example.com" but if you go to:

    host.name.com/~example/

    then it will show "Welcome to the future home of host.name.com"

    With SSI you can try this (in the first line put your own hostname as given by the ServerName directive in httpd.conf).

    <h1>Under Construction</h1>
    <!--#if expr="\"$SERVER_NAME\" != \"host.name.com\"" -->
    <h2><!--#echo var="SERVER_NAME" --></h2>
    <!--#endif -->

    It is not be as bad as the simpler solution but I'm pretty sure some customers would get confused.

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default

    Ok that shows under construction if possible want to show Welcome to the future home of domain.net

    Your code gives this
    http://64.71.165.249/~rad345c/

  7. #7
    Member Robert_'s Avatar
    Join Date
    Apr 2002
    Location
    Arizona
    Posts
    106

    Default

    For that code to work the domain needs to be resolved to your nameservers.

    hmm I dont think the code did that jackal I think that is the page you already have in your skel dir.


    Im going to see what I can come up with I would also like it when the email goes out for the client to goto http://00.000.000.00/~username and get a some $domain coming soon.
    Regards, Robert


  8. #8
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    The only way we found to do this was to modify wwwacct and have it create a special file for us that we call.

    I take it you want something like this?

    http://www.dgbaker.net/

    <?php

    $FILEPATH = "../OUR SPECIAL FILE";
    $FILE = fopen($FILEPATH, "r");
    $a = fgets($FILE, 300); = DOMAIN NAME
    $b = fgets($FILE, 300); = HOME SERVER
    $c = fgets($FILE, 300); = USERNAME
    fclose($FILE);

    echo"<html><head>";
    echo"<title>Welcome to the future home of $a</title>";
    echo"</head><body style=\"font-family: Arial; font-size: 10pt; >";


    ETC......
    Regards,
    David
    Forum Moderator

  9. #9
    Member Robert_'s Avatar
    Join Date
    Apr 2002
    Location
    Arizona
    Posts
    106

    Thumbs up

    cool!


    Thanks
    Regards, Robert


  10. #10
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default

    What would you put that in yur sketlon dir then everytime someone signs up it would add their domain to their index page. How ould this work with the temp ip like I have above.

  11. #11
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Our's works this way,

    When a new account is being created we have an extra file created and added to there /home/user area.

    In this file is their domain name and such. Then our default index.php file reads in that file to grab the info to build the index page.

    So even if the user goes to http://Ip Address/~username, the index page is reading in the correct file and getting the domain name from the file. The index page is generated everytime it is needed.

    Now we've done ours in the wwwacct file, but it should really be done in the postacct file /scripts.
    Regards,
    David
    Forum Moderator

  12. #12
    Member Robert_'s Avatar
    Join Date
    Apr 2002
    Location
    Arizona
    Posts
    106

    Default

    Im trying to figure out how to modify the wwwacct


    <-- not really a scripter ~ but its fun

    so far this is what I got

    open (indexdom, ">/usr/indexdomains.txt") or
    die ("Cannot open indexdomains.txt");
    print indexdom "$some variable";
    close (indexdom);


    that should print it to the file

    I think still working on it
    Regards, Robert


  13. #13
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Close.

    open(CPDATA,">$uhomedir/FILENAME");
    print CPDATA "$domain\n";
    print CPDATA "MAIN HOST SERVER\n";
    print CPDATA "$user\n";
    close(CPDATA);
    chmod 0644, "$uhomedir/FILENAME";
    Regards,
    David
    Forum Moderator

  14. #14
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default

    tried to keep up, finally lost me though


  15. #15
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Originally posted by jackal
    tried to keep up, finally lost me though

    Okay I try to explain.

    In /scripts/wwwacct we edited it and added this;

    open(CPDATA,">$uhomedir/FILENAME");
    print CPDATA "$domain\n";
    print CPDATA "MAIN HOST SERVER\n";
    print CPDATA "$user\n";
    close(CPDATA);
    chmod 0644, "$uhomedir/FILENAME";


    Now in our skel_dir is the index.php file that is looking for variables. When the users home directory is created, the index.php is put there as well as our new file.

    The index.php file reads the new file and assigns a each value in the file to a variable. Then the index.php uses those variable to build the page.
    Regards,
    David
    Forum Moderator

Similar Threads & Tags
Similar threads

  1. Singapore's Best Co-location/Dedicated Server Offer
    By jacksony in forum Dedicated Servers
    Replies: 0
    Last Post: 04-01-2011, 01:59 PM
  2. cpanel green server page, location?
    By devGOD in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-05-2007, 10:27 PM
  3. mail server at a different location and can't send to it HELP PLEASE
    By Canar in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-18-2007, 04:58 PM
  4. New name server (ns3) on new server, new location, how?
    By x-man in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-27-2005, 08:36 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube