Apache not running on localhost

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terra1fab
    New Member
    • Nov 2006
    • 1

    Apache not running on localhost

    My apache server is running on 127.0.0.1 but not on localHost.
    NameVirtualHost 192.168.0.15
    listen 80
    listen 8080
    Code:
    <virtualHost localhost:80>
         phpMyadmin site
    </Virtualhost>
    
    <virtualHost localhost:8080>
         my website
    </Virtualhost>
    
    The problem is if i type localhost in internet explorer, i get an error,
    BUT if i type 127.0.0.1, it works. My hosts file does have a mapping
    127.0.0.1 localhost
    
    Also, i cannot browse to another site on the local area network from my PC by typing in the ip of the computer hosting the site (of course the site works, i can access it from a third PC) .
    
    Also, i cannot use IP base virtrual hosting
    <virtualhost 192.168.0.15>
    
    </virtualhost>
    Please help
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Originally posted by terra1fab
    My apache server is running on 127.0.0.1 but not on localHost.
    NameVirtualHost 192.168.0.15
    listen 80
    listen 8080
    Code:
    <virtualHost localhost:80>
         phpMyadmin site
    </Virtualhost>
    
    <virtualHost localhost:8080>
         my website
    </Virtualhost>
    
    The problem is if i type localhost in internet explorer, i get an error,
    BUT if i type 127.0.0.1, it works. My hosts file does have a mapping
    127.0.0.1 localhost
    
    Also, i cannot browse to another site on the local area network from my PC by typing in the ip of the computer hosting the site (of course the site works, i can access it from a third PC) .
    
    Also, i cannot use IP base virtrual hosting
    <virtualhost 192.168.0.15>
    
    </virtualhost>
    Please help
    Hi there,

    What's your OS?

    Comment

    • cassbiz
      New Member
      • Oct 2006
      • 202

      #3
      If your OS is Linux you can enter the following command to see all of the programs that are running.

      Code:
      ps -ax
      If apache is not running, try to restart it

      Code:
      /etc/init.d/httpd restart
      Also you can look into your apache logs to see what the error is if it won't start.

      Comment

      • cassbiz
        New Member
        • Oct 2006
        • 202

        #4
        in your httpd.conf file change "virtualHos t" to "VirtualHos t"

        You define 'localhost" in the named.conf file

        Be sure that you also have a localhost file in your zone files.

        Comment

        • cassbiz
          New Member
          • Oct 2006
          • 202

          #5
          Here is the beginning of my named.conf file

          Code:
          controls {
                  inet 127.0.0.1 allow { localhost; } keys { rndckey; };
          };
          zone "." IN {
                  type hint;
                  file "named.ca";
          };
          
          zone "localhost" IN {
                  type master;
                  file "localhost.zone";
                  allow-update { none; };
          };
          
          zone "0.0.127.in-addr.arpa" IN {
                  type master;
                  file "named.local";
                  allow-update { none; };
          };
          and here is my zone file "localhost.zone "

          Code:
          $TTL    86400
          $ORIGIN localhost.
          @                       1D IN SOA       @ root (
                                                  42              ; serial (d. adams)
                                                  3H              ; refresh
                                                  15M             ; retry
                                                  1W              ; expiry
                                                  1D )            ; minimum
          
                                  1D IN NS        @
                                  1D IN A         127.0.0.1
          Make sure that those entries are there and that named is up and running.

          Comment

          • swandi
            New Member
            • Nov 2006
            • 13

            #6
            Originally posted by sashi
            Hi there,

            What's your OS?
            If your OS is Windows
            please check this file :C:\windows\sys tem32\drivers\e tc\hosts

            Comment

            • sashi
              Recognized Expert Top Contributor
              • Jun 2006
              • 1749

              #7
              Originally posted by swandi
              If your OS is Windows
              please check this file :C:\windows\sys tem32\drivers\e tc\hosts
              Hi there,

              By default the hosts file includes localhost with (127.0.0.1) as it's IP address, add new host name unless you have changed the server name. Good luck & Take care.

              Comment

              Working...