Linux 64位安装xampp

XAMPP只支持32位的linux。所以如果在64位中运行XAMPP会报错:XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.

解决这个问题很简单,只需安装32位库,运行:

yum install -y glibc*i686

 

安装完之后要考虑以下安全问题,XAMPP为了方便开发,被设置得尽量开放,但这也带来一些安全问题。这儿有一份 XAMPP 缺乏安全防护的列表:

  • MySQL 管理员(root)没有密码。
  • MySQL 可通过网络访问。
  • ProFTPD 使用“lampp”作为用户名“nobody”的密码。
  • PhpMyAdmin 可以通过网络访问。
  • 示例程序可以通过网络访问。
  • MySQL 和 Apache 在同一个用户名(nobody)下运行。
要修正绝大部分的安全薄弱环节,只需执行以下命令:
/opt/lampp/lampp security

接下来可能会遇到phpmyadmin拒绝访问的问题。只需打开httpd-xampp.conf文件,找到<Directory “/opt/lampp/phpmyadmin”>,在对应的</Directory>之前加上Require all granted。修改完如下所示:

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

然后用 /opt/lampp/lampp restart 重新运行即可正确访问

如果一切顺利那么恭喜恭喜。但是我很不幸的发现进了phpmyadmin却各种没有权限!这个问题在windows下面遇到过,原因应该是在前面解决安全问题时修改了数据库账号root的密码,而phpmyadmin中默认的为空。这么想问题就简单了,到/opt/lampp/phpmyadmin下找到config.inc.php,在/* Authentication type and info */下面加上必要的信息,比如我的就是这样:

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

最后重启lampp,

posted @ 2018-10-26 14:51  beihaiyang  阅读(669)  评论(0编辑  收藏  举报