Reputation: 161
Is it possible to use my xampp offline just like wamp has with the "put online/offline" function? I want this so nobody in my classroom can get access to my localhost by typing my IP address into the address bar.
Upvotes: 1
Views: 2343
Reputation: 599
Hello you should solve the problem within C:\xampp\apache\conf\httpd.conf or wampserver or anything else.
You have 4 options, open only one option below. It will works. Find below section
in C:\xampp\apache\conf\httpd.conf Do not forget to restart apache after changes is made.
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
AllowOverride All
# Controls who can get stuff from this server.
# you have 4 options -> open only one option
#Require all granted # put online
#Deny from all # it also deny you
#Require ip 192.168.1 # some part of ip is possible
#Require ip 127.0.0.1
Require local # put offline
</Directory>
Upvotes: 0
Reputation: 555
You can also change the port that apache is listening to to other (the default is 80).
If you change your port to 1234 (or other number) the others in your classroom can only access your website if they know that value.
you have to access it using localhost:1234
To do this you have to open httpd.conf file in a text editor, find "Listen 80" and change it to "Listen 1234(or other number)". Save that file and restart apache.
Upvotes: 0
Reputation: 306
put in your apache (&other server) that it will only listen on 127.0.0.1:80
, so only YOUR localhost can access it
for me i change the port too, only security reason.
in my xampp, its on the xampp/apache/conf/httpd.conf
on line 58.
Change Listen :80
to Listen 127.0.0.1:80
or, like me, Listen 127.0.0.1:9999
If you changed the listening port, you also have to navigate in your browser to that like http://127.0.0.1:9999
, ot localhost ;)
Upvotes: 1