今天,非常感谢关注我的粉丝,我出这篇文章也是为能帮助到他,也为了能帮助到更多的人,直接开始了。
实验环境:RHEL7.4最小化安装
官网地址: Apache friends.org/index.html
XAMPP简介
XAMPP是最流行的PHP开发环境
XAMPP是一个完全免费且易于安装的包含 MariaDB ,PHP和Perl的Apache发行版。XAMPP开源软件包已被设置为非常易于安装和使用。
开始安装
[root@Yang ~]# wget —下载
[root@Yang ~]# chmod +x xampp-linux-x64-7.2.0-0-installer.run —给执行权限
[root@Yang ~]# ./xampp-linux-x64-7.2.0-0-installer.run
—————————————————————————-
Welcome to the XAMPP Setup Wizard.
—————————————————————————-
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
XAMPP Core Files : Y (Cannot be edited)
XAMPP Developer Files [Y/n] :Y
Is the selection above correct? [Y/n]: Y
—————————————————————————-
Installation Directory
XAMPP will be installed to /opt/lampp
Press [Enter] to continue: —-回车
Setup is now ready to begin installing XAMPP on your computer.
Do you want to continue? [Y/n]: Y —注:这里需要等待一会
Please wait while Setup installs XAMPP on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
—————————————————————————-
Setup has f ini shed installing XAMPP on your computer. —-看到这个说明你安装成功
开始启动XAMPP
[root@Yang ~]# /opt/lampp/lampp start —看到下面内容说明启动成功
Starting XAMPP for Linux 7.2.0-0…
XAMPP: Starting Apache…already running.
XAMPP: Starting MySQL…ok.
XAMPP: Starting ProFTPD…ok.
[root@Yang ~]# iptables -F && setenforce 0 —临时关闭防火墙和SELINUX
开始访问
看到如上图所示,安装成功
注意:默认情况下,XAMPP没有设置密码,因此不建议使用此配置运行XAMPP,因为他人可以访问它。
安全安装XAMPP
[root@Yang ~]# /opt/lampp/lampp security —安全检查
XAMPP: Quick security check…
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that’s not recommended. Do you want me to turn it off? [yes] yes
XAMPP: Turned off.
XAMPP: Stopping MySQL…ok.
XAMPP: Starting MySQL…ok.
XAMPP: The MySQL/ phpmyadmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes] yes —设置 phpMyAdmin密码
XAMPP: Password: —-当你输入密码,这里不显示
XAMPP: Password (again): —再次设置
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin’s pma password to the new one.
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.
XAMPP: The FTP password for user ‘daemon’ is still set to ‘xampp’.
XAMPP: Do you want to change the password? [yes] yes —设置FTP密码
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD…ok.
XAMPP: Done.
这里,XAMPP安装应该更安全。
再次访问
出现以上错误,解决方法如下
设置从外部访问PHPMyadmin
[root@Yang ~]# vim /opt/lampp/etc/extra/httpd-xampp.conf
修改
15 Alias /phpmyadmin “/opt/lampp/phpmyadmin”
16
17 # since XAMPP 1.4.3
18 <Directory “/opt/lampp/phpmyadmin”>
19 AllowOverride AuthConfig Limit
20 Require local
21 ErrorDocument 403 /error/XAMPP_FORBIDDEN.html. var
22 </Directory>
为:
15 Alias /phpmyadmin “/opt/lampp/phpmyadmin”
16
17 # since XAMPP 1.4.3
18 <Directory “/opt/lampp/phpmyadmin”>
19 AllowOverride AuthConfig
20 Require all granted
21 ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
22 </Directory>
[root@Yang ~]# /opt/lampp/lampp restart —重启服务,再次访问
看到上面内容。,说明访问成功
登录PHPMyadmin —使用用户名root,密码你自己设置的密码。登录成功界面如下
XAMPP主要配置文件位置
主要的XAMPP配置文件的位置如下所示:
Apache配置文件:/opt/lampp/etc/httpd.conf,/opt/lampp/etc/extra/httpd-xampp.conf
PHP配置文件:/opt/lampp/etc/php.ini
MySQL配置文件:/opt/lampp/etc/my.cnf
ProFTPD配置文件:/opt/lampp/etc/proftpd.conf