首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >phpMyadmin、Apache MySql和VPS错误

问phpMyadmin、Apache MySql和VPS错误
EN

Stack Overflow用户
提问于 2013-10-05 01:48:29
回答 2查看 1.2K关注 0票数 0

最近我配置了VPS,但它不能很好地工作。

有什么问题吗?我使用yum install安装了Apache2、MySql和PHP,并从源码中安装了phpmyadmin,对其进行了基本编译,我在线阅读了教程。

当我试图让phpmyadmin在ssh上工作时,我输入了'service httpd restart‘,它给出了这个错误

代码语言:javascript
复制
[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版本

代码语言:javascript
复制
PHP 5.5.4 (cli) (built: Sep 19 2013 15:01:01)

MYSQL版本

代码语言:javascript
复制
mysql  Ver 14.14 Distrib 5.5.34, for Linux (i686) using readline 5.1

我不知道如何修复它,当我尝试访问phpmyadmin它给我403错误

我希望有人能帮我解决这个问题。

在服务器上安装了centos 5.8

提前感谢:)

编辑:

phpmyadmin.conf

代码语言:javascript
复制
#
# 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
EN

回答 2

Stack Overflow用户

发布于 2017-11-05 08:47:40

这个问题在我写作的时候已经有4年了--一开始我并没有注意到--但对于那些来到这里的人来说。。。像我一样迟到

任何人都需要从安装CentOS 7开始-或者如果他们没有的话,就放弃或者放弃任何托管公司。CentOS 5.x的更新生命周期截止于2017年3月31日

不要从源代码构建-配置REMI存储库-它有最新版本的phpmyadmin,并且配置了符合CentOS标准的php安装。在yum更新和适当的epel发行版之间-安装phpmyadmin很简单。

https://rpms.remirepo.net/wizard/ Remi也是CentOS.org的定期支持贡献者-但没有人会帮助CentOS 5.8它只是太老了,而且在撰写本文时,大多数人也不会帮助CentOS 6。如果你从CentOS 6开始没有“升级”路径,你必须从CentOS 7开始,然后从那里开始有一个升级路径。

更好的web服务器来自codeit -它有http2,比redhat版本更频繁地更新,它是Apache的etc/httpd的Red Hat / Centos文件版本。它会让你在SSLLABS.com得到一个"A“。

此外,CentOS现在有MariaDB,而不是MySQL -将是10.1.xx或10.2.xx -而不是5.xx升级到10.2 -它具有动态Innodb池大小,并在更小的内存占用中启动。

然后获得一个像Webmin这样的面板,用于在服务器本身上操作,如果您通过Windows客户端访问它,则使用WinSCP。一旦你完成配置,Webmin会自动让你的系统保持正常并保持最新状态。Webmin也有一个可以配置的yum代码库。这里有一些远离=>的回购,请参阅https://wiki.centos.org/AdditionalResources/Repositories

今天,没有人为自己做任何事情,即使是试图运行CentOS 6也是如此

所以如果你有一个正确设置的Red风格的CentOS服务器,那么这个文件应该在/etc/httpd/conf.d中,但是"apache2不是人们所熟知的--所以听起来你可能做了一个科学怪人的服务器。“错误消息告诉我。某处已经加载了别名。尽量不要自己编译任何东西-在CentOS上-大多数时候RPM或repo都有文件-在web上搜索rpm -然后看看是否有可以配置的yum repo

remi phpmyadmin附带了一个很好的conf文件,如下所示-但没有IP require语句

如果你在网络上看到一些东西--作为一个教程,而且它不是针对CentOS和你的版本的--移动一个,不要尝试使用它。

代码语言:javascript
复制
# 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>

不要为自己制作一个科学怪人服务器而感到尴尬--在CentOS 7下创建一台最新的服务器,并将其与yum保持同步,这样您就可以让人们尽可能地提供帮助,它就会正常运行

票数 2
EN

Stack Overflow用户

发布于 2013-10-05 02:03:19

我想知道你为什么不直接从存储库安装phpmyadmin?

代码语言:javascript
复制
yum install phpmyadmin

问候

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19187615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档