0

Recently I have configured VPS but it doesnt work well.

Whats problem ? I installed Apache2, MySql, PHP, using yum install and i installed phpmyadmin from source compiled it basicly i followed tutorials online.

When I try to make phpmyadmin work on ssh i enter 'service httpd restart' It gives me this error

[root@localhost ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: [Fri Oct 04 13:43:08 2013] [warn] The Alias directive in /etc/httpd/conf.d/phpmyadmin.conf at line 9 will probably never match because it overlaps an earlier Alias.
[Fri Oct 04 13:43:08 2013] [warn] The Alias directive in /etc/httpd/conf.d/phpmyadmin.conf at line 10 will probably never match because it overlaps an earlier Alias.

PHP version

PHP 5.5.4 (cli) (built: Sep 19 2013 15:01:01)

MYSQL version

mysql  Ver 14.14 Distrib 5.5.34, for Linux (i686) using readline 5.1

I dont know how to fix it when I try to access phpmyadmin it gives me 403 ERROR

I hope someone can help me fix it

On server there is installed centos 5.8

Thanks in advance :)

EDIT:

phpmyadmin.conf

#
# Web application to manage MySQL
#
#<Directory "/usr/share/phpmyadmin">
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
4
  • This should be moved to serverfault it isn't a programming problem Commented Oct 4, 2013 at 17:53
  • Look at the file /etc/httpd/conf.d/phpmyadmin.conf, especially rows 9 and 10. Are the aliases there just like an alias in the first 8 rows? Commented Oct 4, 2013 at 17:55
  • I edited post you can see how phpmyadmin.conf looks like Commented Oct 4, 2013 at 17:57
  • Check the .htaccess files and the httpd.conf, or anything in httpd/conf to make sure those aliases don't already exist Commented Oct 4, 2013 at 18:26

2 Answers 2

2

This question is 4 years old at my writing - and i did not notice that at first - but for those who come along . . . late like me

Anyone needs to start with an install of CentOS 7 - or get rid of or pass on any hosting company if they do not have it. The update life ended 31 March 2017 of CentOS 5.x

do not build from source - configure the REMI repository - it has phpmyadmin in the latest version and configured php installs to CentOS standards. Between yum update and the proper epel release - installing phpmyadmin is simple.

See https://rpms.remirepo.net/wizard/ Remi is also a regular support contributor at CentOS.org - but NO ONE will help with CentOS 5.8 it is just way too old, and most won't help with CentOS 6 now at this writing - either. There is no "upgrade" path if you start with CentOS 6, you MUST start with CentOS 7 and it then has an upgrade path from there on.

A better web server to use is from codeit - it has http2 and is updated more frequently than the redhat version and it is the Red Hat / Centos file version of etc/httpd of Apache. It will get you an "A" at SSLLABS.com.

Also CentOS now has MariaDB and not MySQL - which would be 10.1.xx or 10.2.xx - not 5.xx Upgrade to 10.2 - it has dynamic Innodb pool sizing and launches in a smaller memory footprint.

Then Get a panel like Webmin for operating on the server itself and use WinSCP if you access it with a Windows client. Once you get it configured Webmin will automatically keep your system sane and up to date. Webmin has a yum repo too that can be configured. there are some repos to STAY AWAY from => see https://wiki.centos.org/AdditionalResources/Repositories

No one today is doing themselves any favors even trying to run even CentOS 6 for that matter

So to answer the question for any late comers - here is what a good phpmyadmin conf file looks like and it locks out anyone but the network you come in on - it would be in /etc/httpd/conf.d if you have a properly set up Red Hat style CentOS server - but "apache2 is NOT what would known as - so it sounds like you may have made a Frankenstein server. The error message tells me that. somewhere an alias is already loaded. try to stay away from compiling anything yourself - on CentOS - most of he time an RPM or repo has the file - search the web for the rpm - then see if there is a yum repo you can configure

The remi phpmyadmin comes with a good conf file like this one below - but without the IP require statements

If you see something on the web - as a tutorial and it is not for CentOS and YOUR version - move one and do not try to use it.

# phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
    AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
  # Require local
     <RequireAny>
       Require all denied
       Require ip (your ip or subnet - it will take ranges like xxc.xxx.0.0/16)
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
    </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     # Require local
     <RequireAny>
       Require all denied
       Require ip (your ip or subnet - it will tke ranges like xxc.xxx.0.0/16)
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
    </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
<IfModule mod_security.c>
    <Directory /usr/share/phpMyAdmin/>
        SecRuleInheritance Off
    </Directory>
</IfModule>

Do not embarrass yourself making a Frankenstein server - make a current server under CentOS 7 and keep it current with yum and you can then get people to possibly help and it will run right

Sign up to request clarification or add additional context in comments.

Comments

1

I'm wondering why you didn't install phpmyadmin from the repository directly?

yum install phpmyadmin

Regards

1 Comment

Becouse i got errors everytime i try to install it cant get it working I dont know why It always fails If you have good tut how to do it link me please.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.