|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Apache - Access issues?
So what I want to do is to access my home Apache server from an alternative computer (specifically my work one)
Is this possible? I've tried looking on google, but can't seem to find any relevant threads/tutorials. I'm guessing that I'll need access to the router to do so? (if so I'm screwed lol)
__________________
~~==~~ Whoever said nothing is impossible never tried pushing a revolving door ~~==~~ |
|
#2
|
|||
|
|||
|
You probably would need access to the router so you can setup the port forwarding. Other than that, you would just need to edit the apache httpd.conf to allow connections from outside sources and restart apache.
|
|
#3
|
|||
|
|||
|
I couldn't see any line in httpd.conf regarding this, maybe I missed it?
|
|
#4
|
|||
|
|||
|
If http://localhost shows the default Apache page or any configured site it's not an Apache problem, you should check the network configuration.
|
|
#5
|
|||
|
|||
|
it might be an apache problem if it is set to deny from all allow from 127.0.0.1 meaning that it will only allow access from localhost.
|
|
#6
|
|||
|
|||
|
yea, I think I need to have port forwarding set up by looks of it, damn (no-one has access to the router in the property lol)
|
|
#7
|
|||
|
|||
|
You could try to use something like UPnP port forwarding. Basically a program requests access to a port forwarding and if the router supports it, it is granted. I just did a small search and found this that looks like a way to work use upnp. It is most commonly (nowadays) used with things like peer to peer protocols to request ports to open when they need to get out.
|
|
#8
|
|||
|
|||
|
Thats brilliant Llama! Works perfectly! (Well I've connected from my computer and laptop through external IP address anyway, the real test will be tomorrow at work).
What sort of security issues am I raising if I leave this running all day? The server is obviously password protected, howver passwords can be broken, there is nothing of value on the server itself, however as the server is running from my computer, that obviously has important stuff on it. My firewall asks for confirmation of every new thing really (running comodo) so I am pretty confident that any external access attempts would not get through without my auth, but you never know. |
|
#9
|
|||
|
|||
|
well you can also do like I said above and use apache to limit access to specific IP addresses. Most offices have a static IP address so if you find that out then you could add that IP to an allow list. Here is how part of my httpd.conf looks to allow access to just my work IP and my localhost.
Code:
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order deny,allow
deny from all
allow from 127.0.0.1
#full IP is in my config, added 0 for this post.
allow from 66.150.0.0
</Directory>
notice the end that says: Code:
Order deny,allow
deny from all
allow from 127.0.0.1
#full IP is in my config, added 0 for this post.
allow from 66.150.0.0
That basically means that deny comes before allow statements. The allow and deny statements overwrite in that order. meaning that if the order was allow,deny then I would be allowing local and work but then deny would block them all. order by deny,allow will deny everyone then only allow the listed IP's. *edit: The httpd.conf is found in the conf directory under apache. |
|
#10
|
|||
|
|||
|
OK, thanks for the help Llama, and that is working... mostly. If I connect through my external IP address it works fine, if I try going through my internal IP address it does not, it comes up with an "You don't have permission to access / on this server." message
However both my external and internal IP address are allowed, and I know I've entered them correctly. Any ideas? |
|
#11
|
|||
|
|||
|
Just comment out the IP addresses and add "Allow from all", restart apache and then go to the server and view a phpinfo() page or echo out $_SERVER['REMOTE_ADDR'] to get the IP address that is connecting. Add that into the apache config file and remove allow from all, uncomment the other IPs and restart apache again.
You probably just don't have all the IP addresses added. Also, you can put only a partial IP address if you wanted. Like if you wanted to allow access to other people on the network, but restrict access to only people on the network you can use something like 192.168.1 and that will allow everyone from 192.168.1.1-255 |
|
#12
|
|||
|
|||
|
ah, good plan!
I'll prob go for the second option though, to allow my other comps to connect etc. I thought there must be a way, but I was thinking something like 192.168.1.# would do the trick |
|
#13
|
|||
|
|||
|
# is a comment.
here is the manual page that talks about access: http://httpd.apache.org/docs/2.0/mo...cess.html#allow If you want you can also use apache to require a username and password, allow access to an IP range or to a specific user agent (browser name). It describes more stuff like that on the manual page. |
|
#14
|
|||
|
|||
|
wierd, If i echo out $_SEVER[REMOTE_ADDR] like you said I get 127.0.0.1, however in the httpd.conf file I changed the IP range to 192.168.1, which the IP given to the computer is included, and that would be connecting through one of the IPs in the range 192.168.1.1-255, yet still echos 127.0.0.1?
|
|
#15
|
|||
|
|||
|
that would depend on how you are connecting to the computer. If you connect through localhost, it is always going to be 127.0.0.1. If you connect through the internal IP (ie: 192.168.1.5), you will get whatever your internal IP is and if you connect through an external IP, you will get whatever your external IP is.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Apache - Access issues? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|