CentOS 7 安装XAMPP

0 篇文章 0 订阅

以下步骤如果包含Linux命令,没有特别说明均在root下运行:

1、首先安装CentOS,下载ISO的网址如下,挑选最快的镜像站点下载:

http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso


2、我是在VMware Workstation 11下安装的,实体机没试过。一路按向导做来就行,我选的是GUI服务器,并点选了KDE。


3、装完重启,CentOS自动把VMware Tools也装上了,真省事。


4、下载XAMPP,网址如下:

https://downloadsapachefriends.global.ssl.fastly.net/xampp-files/5.6.3/xampp-linux-x64-5.6.3-0-installer.run?from_af=true


5、给安装文件加上可执行的属性:

chmod 777 xampp-linux-x64-5.6.3-0-installer.run

6、运行安装文件:

./xampp-linux-x64-5.6.3-0-installer.run


7、按照向导安装完成后,XAMPP默认会安装在/opt/lampp下,服务器的开启、关闭和重启命令如下:

/opt/lampp/xampp start #开启

/opt/lampp/xampp stop #关闭

/opt/lampp/xampp restart #重启


8、设置防火墙。因为目标是准备作为内部网论坛,也懒得设置防火墙规则了。Centos 7的默认防火墙改成了firewalld,而非iptables,设置如下:

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service#禁止firewall开机启动


9、关闭SELinux:

编辑 /etc/selinux/config ,找到 SELINUX 行修改成为: SELINUX=disabled :

# This file controls the state of SELinux on the system. 
# SELINUX= can take one of these three values: 
# enforcing - SELinux security policy is enforced. 
# permissive - SELinux prints warnings instead of enforcing. 
# disabled - No SELinux policy is loaded. 
SELINUX=disabled
 
# SELINUXTYPE= can take one of these two values: 
# targeted - Only targeted network daemons are protected. 
# strict - Full SELinux protection. 
SELINUXTYPE=targeted 


10、设置xampp开机自动运行

(1)增加/opt/lampp/xampp的运行权限:
chmod 777  /opt/lampp/xampp

(2)在/etc/init.d下添加一个xampp的符号链接:

ln -s /opt/lampp/xampp /etc/init.d/xampp 

(3)加入到开机自动运行:

chkconfig --add xampp

(4)服务控制:

service xampp start #启动

service xampp stop #停止

service xampp restart #重启

11、关于MySQL数据库启动失败

如果设置了开机自动运行XAMPP,但只有Apache httpd和 ProFTPD能启动,MySQL启动不成功,有可能是CentOS自带的MariaDB影响,打开桌面左上角的“应用程序”-》“系统工具”-》“软件”(我装了KDE),在Databases分支下,把包含MariaDB的软件包全部删除就行了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值