Jump to content
The Uniform Server Community

Apache Ip Adress


Bonmat86
 Share

Recommended Posts

I am not sure what you require but if you type this into your browsers address bar:

 

http://127.0.0.1/test.html you will receive from your machine that test page (assuming the file is in folder www)

 

127.0.0.1 is the standard IP address used for a loopback network connection that means your machine.

 

The same result can be obtained by typing in

 

http://localhost/test.html note localhost will be resolved to 127.0.0.1 via your host file.

 

Note: 127.0.0.1 is the most common address for localhost, however any IP address in the range 127.*.*.* can be used (see RFC 3330: Special-Use IPv4).

 

Hence the specific address 127.0.0.100 is valid for a local loop back. So typing in

 

http://127.0.0.100/test.html

 

will bring up that test page.

 

However the default instalation of Uniserver will not allow this. Because the htaccess file contained in folder www restricts access to only 127.0.0.1 to allow acess to 127.0.0.100 either modify that line or add a new line to your htaccess file eg

 

# This file provides security to the server limiting access to the localhost only.

# Comment to deactivate.

 

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

Allow from 127.0.0.100

 

Note: Deny from all ... means no one is allowed access

 

The next two lines allow access to IP address 127.0.0.1 and 127.0.0.100 all other IP addresses will be denied access.

 

With those changes and your port change the complete address to access the page will look like:

 

http://127.0.0.100:8000/test.html

 

It would be interesting for others to know why you want to do this.

Have fun :rolleyes:

Link to comment
Share on other sites

Steps in detail:

 

1) Open Apache configuration file and change the listening port

 

UniServer3_3\Uniform_Server\diskw\usr\local\apache2\conf\httpd.conf

 

Change the line: Listen 80 to Listen 8000

 

2) Open .htaccess

 

UniServer3_3\Uniform_Server\diskw\www\.htaccess

 

Change the IP access address from 127.0.0.1 to 127.0.0.100

 

Order Deny,Allow

Deny from all

Allow from 127.0.0.100

 

This will allow you to run the test file as follows.

 

http://127.0.0.100:8000/test.html

 

Note: Apanel will not display because re-direct needs forcing to port 8000 in addition admin htaccess file needs changing. I will cover this a little later.

 

3) Memorable name instead of using 127.0.0.100:8000 lets use fred:8000

 

The name “fred” needs resolving to achieve this add it to the hosts file:

 

C:\WINDOWS\system32\drivers\etc\ hosts

 

The entry looks like this:

 

127.0.0.100 fred

 

4) Open file redirect.html

 

UniServer3_3\Uniform_Server\diskw\home\admin\www\ redirect.html

 

Change the line:

 

window.setInterval("window.location = 'http://localhost/apanel/'", 500);

 

To:

 

window.setInterval("window.location = 'http://fred:8000/apanel/'", 500);

 

If you re-run the servers you will receive a forbidden error message because you need to change the admin htaccess file:

 

UniServer3_3\Uniform_Server\diskw\home\admin\www\.htaccess

 

Order Deny,Allow

Deny from all

Allow from 127.0.0.100

 

5) Recap

 

With the changes so far you can type the following to run your test page:

 

http://fred:8000/test.html

 

OR

 

fred:8000/test.html

 

To make it slightly shorter use port 81 instead of 8000

 

You could force your browser to use another port say 8000 instead of 80 hence the above would reduce to fred/test.html. I have never seen this option on any browser that I have used hence you are forced to enter it manually.

 

Well that turned into a ramble hope some of it helped. I am sure to have missed something so be prepared to change some other files.

 

:rolleyes:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...