# phpMyAdmin permission error on Jail



## unknownuser (Jan 11, 2017)

Hello folks.

I have spent probably the last two days trying to get phpMyAdmin to work under a 10.3 jail with Apache24,  mod_php and php56-mysql.

Initially I copied the same exact configuration I have on the FreeBSD 10.3 host where phpMyAdmin is working fine, but for some reason I kept on getting a 403 permission error. After two days of struggle I have gotten as far as "_Wrong permissions on configuration file, should not be world writable!"_.

Here is my /usr/local/etc/apache24/httpd.conf configuration.

While /usr/local/www/phpMyAdmin folder permission is set to 755 and it's contents to 644. http://pastie.org/10989364

Lastly some logs here:

`less /usr/local/www/logs/phpmyadmin-error_log`

```
[Wed Jan 11 13:17:15.998397 2017] [:error] [pid 10301] [client 192.168.1.195:56419] script '/usr/local/www/phpMyAdminindex.php' not found or unable to stat
[Wed Jan 11 13:17:41.027814 2017] [:error] [pid 10602] [client 192.168.1.195:56424] script '/usr/local/www/phpMyAdminindex.php' not found or unable to stat, referer: http://10.1.0.1:8081/phpmyadmin/
[Wed Jan 11 13:18:58.050636 2017] [:error] [pid 10599] [client 192.168.1.195:56432] script '/usr/local/www/phpMyAdminindex.php' not found or unable to stat, referer: http://10.1.0.1:8081/phpmyadmin/
[Wed Jan 11 13:19:00.577829 2017] [:error] [pid 10609] [client 192.168.1.195:56434] script '/usr/local/www/phpMyAdminindex.php' not found or unable to stat
```

`less /usr/local/www/logs/phpmyadmin-access_log`

```
10.1.0.1 - - [11/Jan/2017:13:26:41 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:42 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:43 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:44 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:45 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:46 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:47 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:48 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:48 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
192.168.1.195 - - [11/Jan/2017:13:26:48 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
10.1.0.1 - - [11/Jan/2017:13:26:49 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:49 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:49 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:50 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:50 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:50 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
10.1.0.1 - - [11/Jan/2017:13:26:50 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:50 -0600] "-" 408 - "-" "-"
10.1.0.1 - - [11/Jan/2017:13:26:51 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:52 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:53 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
10.1.0.1 - - [11/Jan/2017:13:26:53 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:54 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:55 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:56 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:56 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:57 -0600] "-" 408 - "-" "-"
10.1.0.1 - - [11/Jan/2017:13:26:57 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [11/Jan/2017:13:26:58 -0600] "-" 408 - "-" "-"
10.1.0.1 - - [11/Jan/2017:13:26:58 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:26:59 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:00 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:01 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:02 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:03 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:04 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:05 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:06 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:07 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:09 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:10 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:11 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:12 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:13 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:14 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:15 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:16 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:17 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:18 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:19 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:20 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:21 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:22 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:23 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:24 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:25 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:26 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:27 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:29 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:30 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:31 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:32 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:33 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:34 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:35 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [11/Jan/2017:13:27:36 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [11/Jan/2017:13:27:51 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
192.168.1.195 - - [11/Jan/2017:13:27:51 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
192.168.1.195 - - [11/Jan/2017:13:27:51 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
192.168.1.195 - - [11/Jan/2017:13:27:54 -0600] "GET / HTTP/1.1" 200 949 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
```

Due to 2000 charters limit I uploaded httpd.conf & phpMyAdmin folder contents output to a external website. 

While for some people phpMyAdmin might not be that essential, it really is for me and I'd love to have it running on every single webserver / jail I have on my local server.

Thanks


----------



## SirDice (Jan 12, 2017)

I see several problems in your configuration. Firstly you defined an alias in the default website and additionally you defined a virtual host (on port 8081) that doesn't use the alias. The virtual host redirects back to the default website. And judging by the /usr/local/www/phpMyAdminindex.php failure, you missed a slash somewhere.


----------



## unknownuser (Jan 12, 2017)

Hello SirDice , thanks for stepping in.

I decided to start from scratch and this is what I edited in httpd.conf 


```
Listen *:8080
Listen *:8081
```


```
<VirtualHost *:8081>
    ServerName 10.1.0.1:8081  
    DocumentRoot /usr/local/www/phpmyadmin
    <Directory /usr/local/www/phpmyadmin>
        AllowOverride All
        Allow from all
        Require all granted
        Options FollowSymLinks
        DirectoryIndex index.php
    </Directory>
</VirtualHost>
```

Now I don't even get the permission error message anymore.  It seems like Apache totally ignore this configuration. I have compared this configuration with lots of others around the web and I just can't figure out why it doesn't work for me.

This is all I get right now in /var/logs/httpd-access.log


```
10.1.0.1 - - [12/Jan/2017:13:47:30 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
192.168.1.195 - - [12/Jan/2017:13:47:35 -0600] "GET /phpmyadmin/ HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
192.168.1.195 - - [12/Jan/2017:13:47:37 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [12/Jan/2017:13:47:37 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [12/Jan/2017:13:47:55 -0600] "-" 408 - "-" "-"
192.168.1.195 - - [12/Jan/2017:13:47:55 -0600] "-" 408 - "-" "-"
10.1.0.1 - - [12/Jan/2017:13:47:57 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
10.1.0.1 - - [12/Jan/2017:13:47:58 -0600] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.25 (FreeBSD) PHP/5.6.29 (internal dummy connection)"
```

Basically I want to run the website / wordpress on 10.1.0.1 on port 8080, and this one works just fine. At the other hand I want to run phpmyadmin same IP, same jail but on the 8081 port instead. The configuration I posted initially works just fine on the freebsd host, where I managed to accomplish exactly what I just described. I also run the same configuration on CentOS no issues.

Thanks


----------



## gkontos (Jan 13, 2017)

```
<Directory "/usr/local/www/phpMyAdmin/">
Options None
AllowOverride Limit
Require all granted
</Directory>
```

This works for me in a development server.


----------

