| View previous topic :: View next topic |
| Author |
Message |
wojtek
Joined: 16 Nov 2006
Posts: 7
|
| Posted: Thu Nov 16, 2006 10:59 pm Post subject: how to configure apache as a test server, not real machine? |
|
|
| I want to set the conf files for the testing server. not real server. just for examining my web sites. With no real IP. Is it possible? What to do? |
|
| Back to top |
|
Joshua Meadows (DemoRic)
Joined: 29 Dec 2004
Posts: 785
Location: S.E. Kansas
|
| Posted: Fri Nov 17, 2006 6:31 pm Post subject: |
|
|
limit everything to 127.0.0.1 or localhost.
For example in your httpd.conf change
Listen 80
to
Liste 127.0.0.1:80
There is a domain change tool in the apache2triadcp, you can use that. |
|
| Back to top |
|
wojtek
Joined: 16 Nov 2006
Posts: 7
|
| Posted: Fri Nov 17, 2006 6:57 pm Post subject: what more? |
|
|
:D Thanks Josh.
As far as i Know, I am to create my own virtual contener, define its name in etc\hosts file and what, change something in the directory directive? |
|
| Back to top |
|
Joshua Meadows (DemoRic)
Joined: 29 Dec 2004
Posts: 785
Location: S.E. Kansas
|
| Posted: Fri Nov 17, 2006 10:49 pm Post subject: |
|
|
Add your test server name to your hosts file having it resolve to 127.0.0.1
As long as your server is listening on 127.0.0.1:80 (or anything that resolves to it). You don't have to have the allow / deny rules in your httpd.conf to limit it to only localhost.
Example to allow from 127.0.0.1
Quote: <Directory "C:/somefoldername>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
Personally I just password protect some folders that I want to be private using an .htaccess folder
Quote:
AuthType Basic
AuthName "Restricted Access"
AuthUserFile C:\apache2triad\htdocs\.htpasswd
#Require valid-user
#Require user root
<LIMIT GET POST>
require valid-user
</LIMIT> |
|
| Back to top |
|
Vlad Alexa Mancini
Joined: 07 Jul 2003
Posts: 1538
|
| Posted: Fri Nov 17, 2006 10:51 pm Post subject: |
|
|
the default apache2triad configuration is that of a partly local server
i say partly because some servers like apache are set to bind on 0.0.0.0 that is all available interfaces , if you have more than a loopback like it is generally the cause some servers will be available remotely
you can prevent all remote access by configuring everything explicitely to bind on the loopback interface that is 127.0.0.1/localhost
also on a default windows there is no need to modify hosts file for the localhost mapping to be available for 127.0.0.1
more explicitely the loopback works as 127.0.0.1 and AFAIK can not be disabled , but for the "localhost" (mapping/alias/hostname if you will) of 127.0.0.1 to be available a Quote: 127.0.0.1 localhost line must be present in system32\drivers\etc\hosts , and it is present by default |
|
| Back to top |
|
wojtek
Joined: 16 Nov 2006
Posts: 7
|
| Posted: Fri Nov 17, 2006 10:59 pm Post subject: thanks |
|
|
| :lol: works smoothly. thanks |
|
| Back to top |
|
| |