CentOS下安装XAMPP详细教程

转自:http://www.centoscn.com/image-text/install/2015/1112/6412.html

一、 下载XAMPP

如果直接使用wget从xampp的官网上下载,由于各种墙,不能下载成功,可以在 该链接 中选择自己需要的版本。我选择的linux下,64位,5.6.14这个版本。

使用以下命令进行下载:

<code class="language-linux hljs ruleslanguage has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-array" style="padding: 0px; margin: 0px; box-sizing: border-box;"># wget http</span>:<span class="hljs-comment" style="padding: 0px; margin: 0px; color: rgb(136, 0, 0); box-sizing: border-box;">//sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.14/xampp-linux-x64-5.6.14-0-installer.run</span></code>

下载成功后,会在目录中看到名为:xampp-linux-x64-5.6.14-0-installer.run 的文件。

二、 安装

安装前,需要先给xampp安装包可执行的权限

<code class="language-linxu hljs vala has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># chmod 777 xampp-linux-x64-5.6.14-0-installer.run</span></code>

运行 ./xampp-linux-x64-5.6.14-0-installer.run 进行安装操作。根据提示进行选择需要安装的部分即可: 

至此,安装步骤就已经完成了  启动xampp:

<code class="language-linux hljs vala has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># /opt/lampp/lampp start</span></code>

停止xampp:

<code class="language-linux hljs vala has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># /opt/lampp/lampp stop</span></code>

卸载xampp:

<code class="language-linux hljs vala has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># /opt/lampp/lampp stop</span>
<span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># rm -rf /opt/lampp</span></code>

三、 让局域网均可访问

安装完成后,很多时候用locahost来访问时,是没有问题的,但是同一局域网里其它主机用域名访问时,常常不能访问,这里情况大概分为两种:  1. xampp的配置文件:/opt/lampp/etc/extra/httpd-xampp.conf中将一下内容屏蔽

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

2. 如果按照以上修改后,还是不能访问,则可能是防火墙把80端口给干掉了,要么把防火墙关闭,要么配置一下80端口允许访问。

四、 安装设置

在默认的安装过程中,xampp所有均是没有密码的,为了安全,我们应该为xampp设置密码。该如何操作呢?

<code class="language-linux hljs vala has-numbering" style="padding: 0px; margin: 0px; display: block; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-preprocessor" style="padding: 0px; margin: 0px; color: rgb(68, 68, 68); box-sizing: border-box;"># /opt/lampp/lampp security</span></code>
  • 1

设置xampp的密码:  XAMPP: Quick security check…  XAMPP: Your XAMPP pages are NOT secured by a password.  XAMPP: Do you want to set a password? [yes] yew  XAMPP: Do you want to set a password? [yes] yes  XAMPP: Password:  XAMPP: Password (again):

用户名默认是:xampp


设置phpMyAdmin的密码:  XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!  XAMPP: Do you want to set a password? [yes] yes  XAMPP: Password:  XAMPP: Password (again):  XAMPP: Setting new MySQL pma password.  XAMPP: Setting phpMyAdmin’s pma password to the new one.


设置mysql的root账户:  XAMPP: MySQL has no root passwort set!!!  XAMPP: Do you want to set a password? [yes] yes  XAMPP: Write the password somewhere down to make sure you won’t forget it!!!  XAMPP: Password:  XAMPP: Password (again):  XAMPP: Setting new MySQL root password.  XAMPP: Change phpMyAdmin’s authentication method.


设置ftp密码:  XAMPP: The FTP password for user ‘daemon’ is still set to ‘xampp’.  XAMPP: Do you want to change the password? [yes] yes  XAMPP: Password:  XAMPP: Password (again):

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值