Unable to access IP/phpmyadmin - getting error

SolidState

Verified User
Joined
Jul 26, 2011
Messages
11
Hi,
I am not expert in linux but have general idea of using it. I am struggling to access he phpmyadmin link from my server.
when i visit

Code:
http://IPaddress/phpmyadmin

I get the following error on page

Code:
Forbidden

You don't have permission to access /phpmyadmin on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I tried to fix it by applying the fix I found on internet :
Code:
http://senthilthoppur.blogspot.ae/2012/09/you-don-have-permission-to-access.html

for the command:
Code:
ls -ld /var/www
instead of getting
Code:
dr-xr-x--- 9 webapps apache 4096 Sep  2 14:43 /var/www

I get
Code:
drwxr-xr-x 9 root root 4096 Jun 18 18:22 /var/www

If my permission messed up? How do I fix it? I dont know the command to fix it
 
Also can some one please look at my httpd.conf file entries, what am I missing in it.

Code:
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

# Options and AllowOverrides
Include conf/extra/httpd-directories.conf

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.p                                                                                                  hp4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
    #replace %b with %O for more accurate logging
    <IfModule mod_logio.c>
      LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" c                                                                                                  ombined
      LogFormat "%h %l %u %t \"%r\" %>s %O" common
      LogFormat "%O %I" bytes

      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I                                                                                                   %O" combinedio
    </IfModule>

    CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
    # Include some DirectAdmin alias
    Include conf/extra/httpd-alias.conf
</IfModule>

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
        AddType video/x-ms-asf .avi
        AddType video/mpeg .mpg
        AddType video/mpeg .mpeg
        AddType video/quicktime .mov
        AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

################################################################################                                                                                                  #######
# For user configurations not maintained by DirectAdmin. Empty by default.
################################################################################                                                                                                  #######

Include conf/extra/httpd-includes.conf


################################################################################                                                                                                  #######
# Do not change anything in included files, because they are rewritten by Direct                                                                                                  Admin #
################################################################################                                                                                                  #######

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

################################################################################                                                                                                  #######
# End of included files that are rewritten by DirectAdmin                                                                                                                               #
################################################################################                                                                                                  #######

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


Help appreciated.
 
Please post the output of:
Code:
cat /etc/httpd/conf/extra/httpd-alias.conf
ls -l /var/www/html
 
Please post the output of:
Code:
cat /etc/httpd/conf/extra/httpd-alias.conf
ls -l /var/www/html

output:
Code:
Alias /config "/var/www/html/redirect.php"
Alias /phpMyAdmin "/var/www/html/phpMyAdmin/"
Alias /phpmyadmin "/var/www/html/phpMyAdmin/"
Alias /squirrelmail "/var/www/html/squirrelmail/"
Alias /roundcube "/var/www/html/roundcube/"
Alias /webmail "/var/www/html/squirrelmail/"
Alias /atmail "/var/www/html/atmail/"

ls -l /var/www/html

Code:
total 20
-rwxr-xr-x  1 root root   44 Jun 18 18:22 index.html
lrwxrwxrwx  1 root root   46 Jun 21 18:45 phpMyAdmin -> /var/www/html/phpMyAdmin-3.5.8.2-all-languages
drwxr-xr-x  8 root root 4096 Jun 21 18:45 phpMyAdmin-3.5.8.2-all-languages
-rwxr-xr-x  1 root root   68 Jun 18 18:39 redirect.php
lrwxrwxrwx  1 root root   19 Jun 18 18:51 roundcube -> roundcubemail-1.0.1
drwxr-xr-x 10 root root 4096 Jun 18 18:51 roundcubemail-1.0.1
lrwxrwxrwx  1 root root   19 Jun 18 18:51 squirrelmail -> squirrelmail-1.4.22
drwxr-xr-x 16 root root 4096 Jun 18 18:51 squirrelmail-1.4.22
 
I finally made it work... it was folder permission issue, this code fixed it

chmod 755 /var/www


some more details now:

[root@mct conf]# ls -ld /var/www/
drwxr-xr-x 9 root root 4096 Jun 18 18:22 /var/www/
[root@mct conf]# ls -ld /var/www/html
drwxr-xr-x 5 root root 4096 Jun 21 18:45 /var/www/html
[root@mct conf]# ls -ld /var/
drwxr-xr-x. 21 root root 4096 Jun 19 03:22 /var/
[root@mct conf]# ls -ld /var/www/html/phpMyAdmin
lrwxrwxrwx 1 root root 46 Jun 21 18:45 /var/www/html/phpMyAdmin -> /var/www/html/phpMyAdmin-3.5.8.2-all-languages
 
Last edited:
@smtalk is there anyway I can restrict phmyadmin url to work only when a user log in to there directadmin panel?
 
Back
Top