繁体   English   中英

VPS,Apache MySql和phpMyadmin错误

[英]VPS, Apache MySql and phpMyadmin error

最近,我已经配置了VPS,但是效果不佳。

什么问题 ? 我使用yum install安装了Apache2,MySql,PHP,并且从源代码安装了phpmyadmin,基本上对其进行了编译,我基本上遵循了在线教程。

当我尝试使phpmyadmin在ssh上工作时,我输入“ service httpd restart”,这给了我这个错误

[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版本

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

MYSQL版本

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

当我尝试访问phpmyadmin时我不知道如何解决它,它给我403错误

我希望有人可以帮助我修复它

在服务器上安装了centos 5.8

提前致谢 :)

编辑:

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岁了-起初我没有注意到-但是对于那些来的人来说。 像我一样晚

任何人都需要从安装CentOS 7开始-如果没有托管公司,请摆脱它或将其转移给其他托管公司。 CentOS 5.x的更新寿命于2017年3月31日结束

不要从源代码构建-配置REMI存储库-它具有最新版本的phpmyadmin,并且已将php安装配置为符合CentOS标准。 在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也无济于事。

因此,要回答任何后来者的问题-这是一个很好的phpmyadmin conf文件,看起来像什么,它会锁定除您进入的网络以外的任何人-如果您输入正确,它将位于/etc/httpd/conf.d中。设置了Red Hat风格的CentOS服务器-但“ apache2不是众所周知的-听起来您可能已经制作了Frankenstein服务器。该错误消息告诉我。某个地方已经加载了别名。请尽量避免编译您自己的任何内容-在CentOS上-大多数时候RPM或存储库都有文件-在网上搜索rpm-然后查看是否有可以配置的yum存储库

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

如果您在网上看到某些东西(作为教程,但不适用于CentOS和您的版本),请移动一个,不要尝试使用它。

# 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使其保持最新状态,然后您可能会得到人们的帮助,它会正常运行

我想知道为什么您没有直接从存储库中安装phpmyadmin?

yum install phpmyadmin

问候

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM