Bonmat86 Posted October 27, 2006 Report Share Posted October 27, 2006 How can I change Apache IP address from 127.0.0.1 to 127.0.0.100 for example?I can change port 80 to 8000 but I can't change IP address.Thank you. Quote Link to comment Share on other sites More sharing options...
Ric Posted October 27, 2006 Report Share Posted October 27, 2006 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,AllowDeny from allAllow from 127.0.0.1Allow 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 Quote Link to comment Share on other sites More sharing options...
Bonmat86 Posted October 29, 2006 Author Report Share Posted October 29, 2006 I tried to edit .htaccess file in cgi-bin, www, programbut failed. I can't access to 127.0.0.100Could you please give your compressed server?I want to change the IP of apache because the machine at my school is using IIS. I just want to change to have easy access insteal of typing http://127.0.0.1:8000/Thank you. Quote Link to comment Share on other sites More sharing options...
Ric Posted October 29, 2006 Report Share Posted October 29, 2006 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,AllowDeny from allAllow 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,AllowDeny from allAllow 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. Quote Link to comment Share on other sites More sharing options...
Bonmat86 Posted October 30, 2006 Author Report Share Posted October 30, 2006 Ya, now I can do it. Thank you much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.