CentOS配置XAMPP和Trac

#CentOS配置XAMPP和Trac @(工作日志)[centos, xampp, trac, xampp]

安装好LAMPP后,还需要进行如下的安全设置,才能在局域网内进行访问。

1. 系统防火墙配置

编辑 /etc/sysconfig/iptables 开放 apache 和 mysql 的端口访问。

... ...

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

... ...

2. phpMyAdmin可访问配置

编辑 /opt/lampp/etc/extra/httpd-xampp.conf 。删除配置文件末尾的"phpMyAdmin"。

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpMyAdmin|webalizer|server-status|server-info))">

Require local

ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

</LocationMatch>

3. MySQL root用户密码设置
3.1 修改root密码
/opt/lampp/bin/mysqladmin -u root -p password PASSWORD
3.2 修改phpMyAdmin配置

设置登录phpMyAdmin需要输入密码。修改 /opt/lampp/phpmyadmin/config.inc.php

... ...

/* Authentication type */

$cfg['Servers'][$i]['auth_type'] = 'cookie'; // 原来是'config'

$cfg['Servers'][$i]['user'] = 'root';

//$cfg['Servers'][$i]['password'] = '';

/* Server parameters */

//$cfg['Servers'][$i]['host'] = 'localhost';

//$cfg['Servers'][$i]['connect_type'] = 'tcp';

$cfg['Servers'][$i]['compress'] = false;

$cfg['Servers'][$i]['AllowNoPassword'] = true;

... ...

4. 创建trac数据库
4.1 修改默认引擎

查询当前数据库默认引擎

MariaDB [(none)]> show engines; +--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+

| Engine | Support | Comment | Transactions | XA | Savepoints |

+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+

| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MyISAM | YES | MyISAM storage engine | NO | NO | NO |

| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |

| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |

| ARCHIVE | YES | Archive storage engine | NO | NO | NO |

| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |

| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |

| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |

+--------------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+

10 rows in set (0.00 sec)

如果默认不是INNODB,修改/opt/lampp/etc/my.cnf,在[mysqld]下加上: default-storage-engine=INNODB

4.2 创建数据库
create database trac default charset utf8 collate utf8_bin;
4.3 创建用户并授权
create user 'trac'@% identified by 'password';
grant ALL on trac.* to 'trac'@'%';

转载于:https://my.oschina.net/meichenhui/blog/610633

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值