Find the answer to your Linux question:
Results 1 to 6 of 6
Hello I am trying to run apache on CentOS 6.0 but something seems to be wrong and I never had anything like this happened so I am totally stuck. Everything ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Location
    Brooklyn, NY
    Posts
    2

    CentOS 6.0 and Apache Web Server


    Hello

    I am trying to run apache on CentOS 6.0 but something seems to be wrong and I never had anything like this happened so I am totally stuck. Everything starts up BUT I can not access the page that you see when you have installed Apache with no issues.

    Everything is internal and is going to be set up for testing stuff out only. The IP for the server is (Sorry won't let me post an address until after 15 post) and the name address for the server is (Sorry won't let me post an address until after 15 post)

    I can ssh with the IP but not the name os I am sure that is an issue right there. Someone told me to use the following command to see if I got any errors but I didn't:


    [root etc]# httpd -t
    Syntax OK

    I also tried the following to see what ports was listening to what but it seems to me to be fine:

    [root etc]# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:48167 *:* LISTEN 1182/rpc.statd
    tcp 0 0 *:sunrpc *:* LISTEN 1164/rpcbind
    tcp 0 0 *:ssh *:* LISTEN 1368/sshd
    tcp 0 0 localhost:smtp *:* LISTEN 1444/master
    tcp 0 48 localhost:ssh 192.168.60.7:53728 ESTABLISHED 1522/0
    tcp 0 0 *:sunrpc *:* LISTEN 1164/rpcbind
    tcp 0 0 *:34484 *:* LISTEN 1182/rpc.statd
    tcp 0 0 *:ssh *:* LISTEN 1368/sshd
    tcp 0 0 localhost:smtp *:* LISTEN 1444/master

    Besides this, I have no idea what to do. We only need it to work locally but its not doing that. Any help would be greatly appreciated!!

    Thank You!

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    I don't see apache (port 80, by default) listed in the output of your netstat command. make sure it is started:

    Code:
    service httpd start
    Then do the netstat command again and if good, see if you can connect.

    Not being able to ssh to the server name just means that resolving isn't working right, but don't worry about that yet. When testing the apache server locally just use the ip address first.

  3. #3
    Just Joined!
    Join Date
    Jun 2011
    Location
    Belgium
    Posts
    84
    it seems that the httpd server isn't started.
    How do you installed the Apache webserver?
    1. With yum or a rpm package?
      Then check if the webserver is running:
      Code:
      $> service httpd status
      httpd.service - LSB: start and stop Apache HTTP Server
                Loaded: loaded (/etc/rc.d/init.d/httpd)
                Active: inactive (dead) since Mon, 25 Jul 2011 23:51:54 +0200; 59s ago
               Process: 28273 ExecStop=/etc/rc.d/init.d/httpd stop (code=exited, status=0/SUCCESS)
              Main PID: 1604 (code=exited, status=0/SUCCESS)
                CGroup: name=systemd:/system/httpd.service
      when it is inactive, you can start it with
      Code:
      $> service httpd start
      Starting httpd (via systemctl):                            [  OK  ]
    2. From a downloaded binary?
      start httpd with '$> httpd -k start' or see documentation


    To check that the webserver is running:
    Code:
    $> netstat -tap | grep httpd
    tcp        0      0 *:http     *:*    LISTEN   28453/httpd         
    tcp        0      0 *:https    *:*    LISTEN   28453/httpd

  4. #4
    Just Joined!
    Join Date
    Jul 2011
    Location
    Brooklyn, NY
    Posts
    2
    I may have started it wrong. I thought you started it like this:

    /etc/init.d/httpd start

    When I did the service command I got the following:


    [root@nyclibr ~]# service httpd start
    Starting httpd: [ OK ]

    Then I did the netstat and got this:

    [root@nyclibr ~]# netstat -tap | grep httpd
    tcp 0 0 localhost:http *:* LISTEN 1958/httpd
    tcp 0 0 *:https *:* LISTEN 1958/httpd

    I went to IP address and got the following in the web browser:

    "Unable to connect" error in firefox.

    I even checked to see if it was running and I got the following:

    [root@nyclibr ~]# service httpd status
    httpd (pid 195 is running...


    Not sure what else to check but I feel like something is maybe being blocked? Is there a way I can try it on another port by changing it in the httpd.conf file?

  5. #5
    Just Joined!
    Join Date
    Jun 2011
    Location
    Belgium
    Posts
    84
    Have you tried with 'http://localhost/' or 'http://localhost:80' ?
    If this work, you have to configure the IP address of your machine (/etc/hosts).

    Logs of the webserver are in '/var/log/http/'.

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Also, you can temporarily disable the firewall, to make sure that is not your prob:

    Code:
    service iptables stop

Posting Permissions

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