Find the answer to your Linux question:
Results 1 to 6 of 6
I am following this tutorial, howconfig.com/linux/how-t...ntos-6-server and I changed my hostname with the following commands echo "HOSTNAME=myname.tld" hostname "myname.tld" I get myname when I enter hostname in the command line, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    10

    Setting up LAMP on CentOS 6


    I am following this tutorial,

    howconfig.com/linux/how-t...ntos-6-server

    and I changed my hostname with the following commands

    echo "HOSTNAME=myname.tld"
    hostname "myname.tld"

    I get myname when I enter hostname in the command line, but not with hostname -f (the result here is: hostname: Unknown host; I think this might be a problem)

    Then when I try to run service httpd reload (after several other steps in the meantime listed on the page)
    I get:

    Reloading httpd: not reloading due to configuration syntax error
    [FAILED]

    I backed up /etc/httpd/conf/httpd.conf and reloaded it with the original version, but that does not make a difference.

    Here is how my /etc/sysconfig/network looks:

    NETWORKING=yes
    NETWORKING_IPV6=no
    HOSTNAME=localhost.localdomain
    HOSTNAME=myname.tld

    (again, I run hostname "myname.tld" command, and hostname -f does not display it - thats what is different as refered to that tutorial)

    Thanks for any help with this.

    PS. Does it sound like a lot of headache to install LAMP on CentOS and get it to work with IE from Win7 thorugh Virtual Box?

  2. #2
    Just Joined!
    Join Date
    Sep 2008
    Posts
    13

    name resolution almost certainly

    If you try and ping hostname.tld, does it attempt to connect to either your external IP address, or 127.x.x.x ( usually 127.0.0.1 or 127.0.1.1 )???

    If not, then you need to set it up. The best thing to do is to add a line to /etc/hosts...

    echo "127.0.0.1 hostname.tld" >> /etc/hosts

    note the >> ( = append ), rather than > ( = replace )! You'll need to be root to do this.

    This will get your LAMP server up and running. You will have to do the same thing on the client that you're running your browser from unless you've set hostname.tld up to resolve in DNS.

    hth,

    Steve
    PS. You're not using hostname.tld are you???

  3. #3
    Just Joined!
    Join Date
    Oct 2011
    Posts
    10
    [root@myname]# ping myname.tld
    PING myname.tld (10.0.2.15) 56(84) bytes of data
    64 bytes from myname.tld (10.0.2.15): icmp_seq=1 ttl=64 time=0.651 ms
    (...)
    ^Z
    [1]+ Stopped ping myname.tld

    I also tried hostname and hostname -f and both return myname.tld for whatever reason... (thats what it is suppose to be according to the tutorial)

    I also get a different error after service httpd start commnad

    Starting httpd: Syntax error on line 3 of /etc/httpd/conf.d/myname.com.conf:
    ServerAlias only used in <VirtualHost>
    [FAILED]

    I guess I need to lool at this part / documentation further.

    Thank you.
    Last edited by jtt89; 11-20-2011 at 09:11 AM.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Sep 2008
    Posts
    13
    To get started, just comment this line out. You can work on virtual hosts later...

  6. #5
    Just Joined!
    Join Date
    Oct 2011
    Posts
    10
    I did that, but I still get the error after service httpd start

  7. #6
    Just Joined!
    Join Date
    Oct 2011
    Posts
    10
    I was able to conect Centos6 on Virtual Box to Windows (I am able to ping in both directions) with Host-only Adapter (for connection between the two) and NAT Adapter (to enable Linux on VB to connect to the Internet). I want to set up httpd, mysql and vsftpd servers and in the end easily connect to httpd from Windows based browser and ftp server with a Windows based client as well. I would also want to have access through SSH.

    I have a general idea of the steps that are involved, but there is also a configuration that I am not sure about at this point. Lets say I follow these steps:

    # yum install httpd
    # yum install php php-pear php-mysql
    # yum install mysql-server
    # mysql_secure_installation
    # yum install vsftpd
    # yum install mod_ssl

    Technically, I have everything installed, but what would be the next steps that I need to take (from the networking point of view, so to speak) to get it all working?

    I know I need to configure, at least Apache, and ftp server, but I am not sure how is it gonna work; like where am I gonna be uloading the sites (I know this can vary), how am I gonna know what address to use in a browser if I wanna go to a website x, y, z on that installation etc. This sounds like I need to do some kind of DNS setup and I am kind of stuck at this point.

    If somebody could give me a general outline of what are the things that need to be done that would be great (I was looking at a lot of websites and I know about etc/sysconfig/network, httpd.config - not too much about it on Apache's site, hostname, hostname -f etc; but it is kind of hard to piece it all together at this point). I am gonna be looking at the books also, but they not always reflect the setup that I have too (VirtualBox).

    Thank you.
    Last edited by jtt89; 11-23-2011 at 11:45 PM.

Posting Permissions

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