We help IT Professionals succeed at work.

Simple question

hpchong7
hpchong7 asked
on
refer to :http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=linux&qid=20184711

Dear all,

1.)Do you know what command should I issue such that I can know what current run level I am in?
2.)Do you know where to set the domain name?(now it is root@localhost.localdomain , I want to change
it to , say, root@abc.com)
Comment
Watch Question

hi,

     u can use the runlevel command which tells u ur current runlevel.

     As for changing hostname u can try editing the /etc/rc.sysconfig file and changing HOSTNAME=`/bin/hostname`. lemme know if this works. ull need to restart.
 

Author

Commented:
I am sorry that I've tried but it don't work

Commented:
Hi,

     To change your system name on a redhat or a mandrake, one of the way that you can use is to edit the file /etc/sysconfig/network, you just have to change or add the following line : HOSTNAME=mycomputername.abc.com. You need to restart.

     To know your runlevel the "runlevel" command should work on at least mandrake and redhat.

Hope this help.

Bye

PS : root@abc.com is an e-mail address and will depend the way you configure your e-mail software. Basically, with the above configuration the address of the user root on this machine will be root@mycomputername.abc.com

Author

Commented:
Dear olidel,
  Thank you very much!I changed /etc/sysconfig/network and it works!However, after I changed, the httpd seems to be not work!Each time I want to start it, the process fails!
httpd.................[fail]
Only when I change back /etc/sysconfig/network to localhost.localdomain, then the httpd works again.May you tell me how to resolve it?Thanks!

Commented:
Hi,

     It' difficult for me to tell you what is wrong, I don't have enough informations. You should take a look in the logs of the system and/or the application e.g. /var/log/messages and/or /var/log/httpd/error_log you should have more informations in this files. You can also do a manual start from a comand line if you use the command "apachectl start".

     Anyway, I suspect that there is maybe a configuration problem with httpd.conf or maybe the application cannot bind on port 80.

Hope this help.

Bye
hi

edit /etc/httpd/httpd.conf
and change the ServerName attribute to  ur new hostname and try

Author

Commented:
1.)
Say,
My hostname is xyz
My domain is abc.com
then should the ServerName attribute set to xyz or xyz.abc.com?

2.)if my IP is 192.168.0.10(which is private IP).Other machine on the same LAN can access my web server by typing 192.168.0.10 in internet explorer, but cannot access my web server by typing xyz.abc.com.Do you know what's the problem?May you teach me how to resolve it?Thank you very much!
Commented:
Hi,

    About your network, and the way it should work, you have to do some configuration work on both your server and your clients. If you want that when somebody type "http://www.abc.com" they will see the homepage of your web server you have to have at least one DNS server (it is the "named" daemon which is taking care of DNS under linux) on your network. I'm not going to tell you how to do this because it would be a little too long and it all depends on what you want to do exactly. However, you will find here the DNS How-to : http://www.linuxdoc.org/HOWTO/DNS-HOWTO.html.

   The basic idea of a DNS server is to do an association between an IP address and a name. In the IP configuration of your clients you have to tell them to use your newly created DNS server, that means the IP address of your DNS server which can be the same than your web server. For example, with win98 you can give these informations in the network properties.

   Once everything is setup you should have what you are looking for.

   In the simplest case you should use xyz.abc.com for your ServerName value. But, be careful the way you configure your DNS server can have some effects. You can see this page to have more informations :

http://httpd.apache.org/docs/mod/core.html#servername


Hope this help.

Bye.

Author

Commented:
Thank you very much!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.