You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by zhou jian <su...@yahoo.com> on 2006/02/23 03:54:05 UTC

[users@httpd] how to enable 127.0.0.1 in httpd.conf

Hello everyone,

I want to enable 127.0.0.1 in httpd.conf so I can
access the site with http://localhost or
http://127.0.0.1. I searched over google and found the
following solution. I tried but it didn't work.( It
return with error that the httpd can't bind to the
port something. ) 

Since the following post was released two years ago
while I am using httpd 2.XXX version. It may outdated.
Do you guys know how to setup that in httpd.conf if
that is still the case?

Thanks,
--Paul





First, make a backup of your httpd.conf file in case
you break something while editing it.

Open httpd.conf and find the line that begins with
ServerName. Edit it so that it looks like this:

ServerName 127.0.0.1

Then find the line that begins with Listen and then an
IP address or hostname. Edit it to look like this:

Listen 127.0.0.1

If you find a second "Listen" line that designates
port 80, leave it alone. It should already read:

Listen 80

As long as the only listen lines in httpd.conf that
are not commented out with a # are:

Listen 127.0.0.1
and
Listen 80

Then Apache will only accept connections from your
local machine on port 80. Restart apache to make your
changes take effect. You can test to see if it worked
by typing 127.0.0.1 into your web browser. If it
worked you should see a default apache page.

This is all off of the top of my head, but I think it
should work. If it doesn't, just restore your original
httpd.conf file from your backup and restart apache
again and you'll be no worse off than you were before.

If you want to be extra safe, you can also configure
your firewall to block INBOUND connections on port 80.
Make sure you don't block outbound port 80 or you
won't be able to load any external webpages from that
computer.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] how to enable 127.0.0.1 in httpd.conf

Posted by zhou jian <su...@yahoo.com>.
[root@osg-tg2 bin]# ./httpd -k start
[Thu Feb 23 11:26:06 2006] [warn] NameVirtualHost
127.0.0.1:80 has no VirtualHosts

I have done the first two steps before. Could you
elaborate a little bit about how to 
NameVirtualHost 127.0.0.1:80

I simplely put them to the httpd.conf file and it
showed the above warnning message and it still doesn't
work with http://localhost.

--Paul




--- sanjay tripathi <sa...@yahoo.com> wrote:

> HI,
>        Do Step by Step !!
>   1:- First you need to Resolve your localhost from
> your local host
>       a) Please check with /etc/hosts file, there
> should be Entry like
>          127.0.0.1  localhost.localdomain  localhost
>    
>       b) Edit httpd.conf file
>          ServerName 127.0.0.1
>    
>         NameVirtualHost 127.0.0.1:80
>    
>       
>    
>   Thanks
>   San
>        
> 
> zhou jian <su...@yahoo.com> wrote:
>   Hello everyone,
> 
> I want to enable 127.0.0.1 in httpd.conf so I can
> access the site with http://localhost or
> http://127.0.0.1. I searched over google and found
> the
> following solution. I tried but it didn't work.( It
> return with error that the httpd can't bind to the
> port something. ) 
> 
> Since the following post was released two years ago
> while I am using httpd 2.XXX version. It may
> outdated.
> Do you guys know how to setup that in httpd.conf if
> that is still the case?
> 
> Thanks,
> --Paul
> 
> 
> 
> 
> 
> First, make a backup of your httpd.conf file in case
> you break something while editing it.
> 
> Open httpd.conf and find the line that begins with
> ServerName. Edit it so that it looks like this:
> 
> ServerName 127.0.0.1
> 
> Then find the line that begins with Listen and then
> an
> IP address or hostname. Edit it to look like this:
> 
> Listen 127.0.0.1
> 
> If you find a second "Listen" line that designates
> port 80, leave it alone. It should already read:
> 
> Listen 80
> 
> As long as the only listen lines in httpd.conf that
> are not commented out with a # are:
> 
> Listen 127.0.0.1
> and
> Listen 80
> 
> Then Apache will only accept connections from your
> local machine on port 80. Restart apache to make
> your
> changes take effect. You can test to see if it
> worked
> by typing 127.0.0.1 into your web browser. If it
> worked you should see a default apache page.
> 
> This is all off of the top of my head, but I think
> it
> should work. If it doesn't, just restore your
> original
> httpd.conf file from your backup and restart apache
> again and you'll be no worse off than you were
> before.
> 
> If you want to be extra safe, you can also configure
> your firewall to block INBOUND connections on port
> 80.
> Make sure you don't block outbound port 80 or you
> won't be able to load any external webpages from
> that
> computer.
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
> " from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 
> 
> 		
> ---------------------------------
>  Yahoo! Mail
>  Use Photomail to share photos without annoying
> attachments.
> 		
> ---------------------------------
>  Yahoo! Autos. Looking for a sweet ride? Get
> pricing, reviews, & more on new and used cars.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] how to enable 127.0.0.1 in httpd.conf

Posted by sanjay tripathi <sa...@yahoo.com>.
HI,
       Do Step by Step !!
  1:- First you need to Resolve your localhost from your local host
      a) Please check with /etc/hosts file, there should be Entry like
         127.0.0.1  localhost.localdomain  localhost
   
      b) Edit httpd.conf file
         ServerName 127.0.0.1
   
        NameVirtualHost 127.0.0.1:80
   
      
   
  Thanks
  San
       

zhou jian <su...@yahoo.com> wrote:
  Hello everyone,

I want to enable 127.0.0.1 in httpd.conf so I can
access the site with http://localhost or
http://127.0.0.1. I searched over google and found the
following solution. I tried but it didn't work.( It
return with error that the httpd can't bind to the
port something. ) 

Since the following post was released two years ago
while I am using httpd 2.XXX version. It may outdated.
Do you guys know how to setup that in httpd.conf if
that is still the case?

Thanks,
--Paul





First, make a backup of your httpd.conf file in case
you break something while editing it.

Open httpd.conf and find the line that begins with
ServerName. Edit it so that it looks like this:

ServerName 127.0.0.1

Then find the line that begins with Listen and then an
IP address or hostname. Edit it to look like this:

Listen 127.0.0.1

If you find a second "Listen" line that designates
port 80, leave it alone. It should already read:

Listen 80

As long as the only listen lines in httpd.conf that
are not commented out with a # are:

Listen 127.0.0.1
and
Listen 80

Then Apache will only accept connections from your
local machine on port 80. Restart apache to make your
changes take effect. You can test to see if it worked
by typing 127.0.0.1 into your web browser. If it
worked you should see a default apache page.

This is all off of the top of my head, but I think it
should work. If it doesn't, just restore your original
httpd.conf file from your backup and restart apache
again and you'll be no worse off than you were before.

If you want to be extra safe, you can also configure
your firewall to block INBOUND connections on port 80.
Make sure you don't block outbound port 80 or you
won't be able to load any external webpages from that
computer.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.
		
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.

Re: [users@httpd] how to enable 127.0.0.1 in httpd.conf

Posted by zhou jian <su...@yahoo.com>.
http://httpd.apache.org/docs/2.2/install.html#customize

////////////////////////////////////////////////////
Test
Now you can start your Apache HTTP Server by
immediately running:

$ PREFIX/bin/apachectl -k start

and then you should be able to request your first
document via URL http://localhost/. The web page you
see is located under the DocumentRoot, which will
usually be PREFIX/htdocs/. Then stop the server again
by running:

$ PREFIX/bin/apachectl -k stop
////////////////////////////////////////////////////////


The strange thing is that I went to the link as above.
It is the official install guide. http://localhost
should work for the test step.

What do you think it is wrong with my system
configuration?



--- zhou jian <su...@yahoo.com> wrote:

> Hello everyone,
> 
> I want to enable 127.0.0.1 in httpd.conf so I can
> access the site with http://localhost or
> http://127.0.0.1. I searched over google and found
> the
> following solution. I tried but it didn't work.( It
> return with error that the httpd can't bind to the
> port something. ) 
> 
> Since the following post was released two years ago
> while I am using httpd 2.XXX version. It may
> outdated.
> Do you guys know how to setup that in httpd.conf if
> that is still the case?
> 
> Thanks,
> --Paul
> 
> 
> 
> 
> 
> First, make a backup of your httpd.conf file in case
> you break something while editing it.
> 
> Open httpd.conf and find the line that begins with
> ServerName. Edit it so that it looks like this:
> 
> ServerName 127.0.0.1
> 
> Then find the line that begins with Listen and then
> an
> IP address or hostname. Edit it to look like this:
> 
> Listen 127.0.0.1
> 
> If you find a second "Listen" line that designates
> port 80, leave it alone. It should already read:
> 
> Listen 80
> 
> As long as the only listen lines in httpd.conf that
> are not commented out with a # are:
> 
> Listen 127.0.0.1
> and
> Listen 80
> 
> Then Apache will only accept connections from your
> local machine on port 80. Restart apache to make
> your
> changes take effect. You can test to see if it
> worked
> by typing 127.0.0.1 into your web browser. If it
> worked you should see a default apache page.
> 
> This is all off of the top of my head, but I think
> it
> should work. If it doesn't, just restore your
> original
> httpd.conf file from your backup and restart apache
> again and you'll be no worse off than you were
> before.
> 
> If you want to be extra safe, you can also configure
> your firewall to block INBOUND connections on port
> 80.
> Make sure you don't block outbound port 80 or you
> won't be able to load any external webpages from
> that
> computer.
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org