2

Everything is working fine - hosting a couple of my own sites, but would like to be able to maintain them from other PC's on the LAN. Works fine, except for phpmyadmin.

Everything is set up to be able to do so.

On other PC's I get a 403 error (access denied - and apache's logs tells me it is caused by server configuration).

I have to use the PC's name, tho - using localhost, actual IP, or 127.0.01 gives a server not found from the browser - but this would be OK, as I only want access from LAN - not from the internet.

In \wamp\alias\phpmyadmin.conf I have:

    Alias /phpmyadmin "Q:/wamp/apps/phpMyAdmin4.5.0.2/"
    \# to give access to phpmyadmin from outside
    \# replace the lines
    \#
    \# Require local
    \#
    \# by
    \#
    \# Require all granted
    \#

    <Directory "Q:/wamp/apps/phpMyAdmin4.5.0.2/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        <IfDefine APACHE24>
            Require local
            Require ip 192.168.1
            </IfDefine>
        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from localhost ::1 127.0.0.1
            Allow from 192.168.1
            </IfDefine>
        php_admin_value upload_max_filesize 128M
        php_admin_value post_max_size 128M
        php_admin_value max_execution_time 360
        php_admin_value max_input_time 360
    </Directory>

Also I tried adding this to Q:\wamp\bin\apache\apache2.4.9\conf\httpd.conf:

    <Directory "Q:/wamp/apps/phpMyAdmin4.5.0.2">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride none
        Require local granted
        Allow from localhost ::1 127.0.0.1
    </Directory>

But to no avail - all i can get is a 403 access denied or allow everybody access to my databases - which is not really useful, as it does not even ask for a password...

Jakuje
  • 9,715
  • 2
  • 42
  • 45

2 Answers2

0

First, 127.0.0.1 is the IP of the loopback interface: this can only work from the same host. Localhost is 127.0.0.1, so it's normal that both are not working.

You should check that your LAN is using 192.168.1.0/24, maybe it's not! Look at your apache access log, you will find your source IP, the one you need to add to the "Allow From" (apache 2.2) or "Require ip" (apache 2.4).

  • Thank for the answer. Tried that - got the IP from the ruoter, tho, not the log. As soon as I remove the Require all granted line, I am shut out, even tho I do have Require ip 192.168.1.50 - which is the IP I'm connecting from – Birger Sørensen Nov 03 '15 at 21:56
  • You really need to check access log for seeing which IP is used for accessing the server... Logs are your friends :) – Clément Moulin - SimpleRezo Nov 05 '15 at 13:49
  • Don't really see, how IP's should change from router to server... Looked it up anyway. There is no IP in logs - uses the network name of the requesting PC - "birger-pc" Tried inserting "Require user birger-pc" - which then gives an error 500 Internal server error...
    which is not really usefull either... ;)
    – Birger Sørensen Nov 06 '15 at 16:22
  • Every error 500 generates an entry in error.log of apache... – Clément Moulin - SimpleRezo Dec 07 '15 at 15:43
0

Require host birger-pc
solves the problem.

Thak you for your help and patiense ;>)