CentOS6.4部署安装XAMPP1.8.3网站环境建立站点运行
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

XAMPP环境包我们可能有些朋友在本地电脑中的PHP调试环境都是用的这款一键包,XAMPP安装包是一款比较流行的且可以运行于多个平台的网站环境。支持Linux、MAC和WINDOWS系统中,在这篇文章中,蜗牛需要分享的是在Linux Centos环境中安装XAMPP,然后可以在其运营平台中安装站点建站。
第一、准备工作
如果我们是VPS新手用户,个人还是建议选择大众使用较多的WEB面板、一键包等环境,毕竟可以参考的教程文档比较多。鉴于蜗牛纯属折腾,于是就在基于centos6 32/64位环境中部署XAMPP1.8.3环境。
yum update
yum remove httpd*
升级系统,然后清理已有的环境以免出现安装冲突。
第二、下载和安装XAMPP
#CentOS 32位
cd /tmp
wget http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/1.8.3/xampp-linux-1.8.3-4-installer.run
#CentOS 64位
cd /tmp
wget http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-4-installer.run
对应我们当前的系统环境,然后下载XAMPP环境包到TMP文件夹中。
chmod 755 xampp-linux*
./xampp-linux*
授权文件权限,安装XAMPP环境。
然后会看到如上图的安装过程,我们根据步骤输入y继续,直到安装完毕。
/opt/lampp/lampp start
然后重启XAMPP
然后我们可以看到已经启动完毕。这个时候我们去打开IP地址检查是否安装完毕,我们会看到Access forbidden!错误提示,我们需要解决这个问题。
找到/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
然后把这几行都屏蔽掉(前面加上#)。
# <LocationMatch \\”^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))\\”>
# Require local
# ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
然后我们再重启XAMPP
/opt/lampp/lampp restart
我们打开IP之后可以看到XAMPP界面,可以选择简体中文。
这样我们可以看到XAMPP运行OK。
第三、设置XAMPP
打开/opt/lampp/etc/httpd.conf文件,然后编辑
# Include etc/extra/httpd-vhosts.conf
把前面的#去掉,保存,重启XAMPP 。
/opt/lampp/lampp restart
编辑/opt/lampp/etc/extra/httpd-vhosts.conf设置站点,先创建mkdir -p /var/www/html目录,我们需要在HTML目录中建站。
然后在httpd-vhosts.conf文件中配置站点信息。
ServerAdmin [email protected]
DocumentRoot \\”/var/www/html\\”
ServerName laozuo.org
ServerAlias www.laozuo.org
ErrorLog \\”logs/laozuo.org-error_log\\”
CustomLog \\”logs/laozuo.org-access_log\\” common
执行/opt/lampp/lampp restart重启,然后我们需要设置密码,比如MYSQL密码等。
/opt/lampp/lampp security
XAMPP: Quick security check…
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Password protection active. Please use \\’xampp\\’ as user name!
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
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
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD…ok.
XAMPP: Done.
执行命令之后,我们会操作上面的示范命令。用来设置MYSQL、PHPMYADMIN密码的,然后我们完毕之后,登录HTTP://IP/xampp,执行路径我们可以设置用户名和密码,xampp是用户名,密码是我们设置的。
第四、激活启动eAccelerator
因为有些程序是需要用到eAccelerator的,我们需要启动,默认是关闭的,我们需要到/opt/lampp/etc/php.ini文件中启动,找到下面的代码:
;extension=\\”eaccelerator.so\\”
;eaccelerator.shm_size=\\”16\\”
;eaccelerator.cache_dir=\\”/opt/lampp/temp/eaccelerator\\”
;eaccelerator.enable=\\”1\\”
;eaccelerator.optimizer=\\”1\\”
;eaccelerator.check_mtime=\\”1\\”
;eaccelerator.debug=\\”0\\”
;eaccelerator.filter=\\”\\”
;eaccelerator.shm_max=\\”0\\”
;eaccelerator.shm_ttl=\\”0\\”
;eaccelerator.shm_prune_period=\\”0\\”
;eaccelerator.shm_only=\\”0\\”
;eaccelerator.compress=\\”1\\”
;eaccelerator.compress_level=\\”9\\”
然后把前面的;注释去掉保存。
最后,再启动/opt/lampp/lampp restart。我们就可以去目录中添加文件演示站点。
总结,这篇文章蜗牛折腾在CENTOS中安装XAMPP环境,如果你也想折腾也可以玩玩。对于XAMPP环境在我们本地PHP调试的时候用的较多,或者MAC环境中也有不少用到的。
猜你可能想看的VPS
- JGKVM→CN2 GIA 线路即将涨价 三月收尾活动 1 核 512M全球[VPS测评]
- Domeny.pl→.pl .com.pl .edu.pl .site 全球[VPS测评]
- 1fichier→€15 年 100TB 空间 支持 FTP WebDA虚拟空间(主机)
- 新年促销 reprisehosting→超级便宜的美国西雅图独立服务器独立服务器[U]
- baku.hosting→$24.4 半年 768MB 内存 20GB 虚拟空间(主机)
- 五一促销 edgeNAT→8 核 8G 40G SSD 4Mbps 不限韩国VPS[主机]
- 稳定高速 CeRaNetworks 香港服务器 4 核 16GB $18香港VPS[主机]
- CyberMonday liteserver→€2.5 月 KVM 1全球[VPS测评]
- 便宜 月付€2.49 1 核 CPU 1G 内存 30G SSD NVM全球[VPS测评]
- CloudCone→$17.5 年 1.5GB 内存 45GB 空间 1虚拟空间(主机)
- Windows 系统怎么远程连接 Linux 云服务器-命令行模式WINDOWS
- NameSilo→.xyz .top 等域名 首年 0.99 美金 一次全球[VPS测评]
- 便宜 $15 年 2 核 CPU 2G 内存 50G SSD 5T 流量全球[VPS测评]
- 企鹅小屋→香港 CN2 虚拟主机 Plesk 面板 5Mbps-10Mb虚拟空间(主机)
- WordPress文章发布时间怎么精确到秒?全球[VPS测评]
- CloudSilk新上香港cmi vps,500Mbps大带宽,三网cm香港VPS[主机]
- 2020: UOVZ 1G 内存 20G SSD 200流量 徐州NAT全球[VPS测评]
- 宝塔面板怎么放行端口?宝塔面板放行端口的方法全球[VPS测评]
- 什么是Bootstrap?全球[VPS测评]
- 创e云:香港CN2VPS优惠专区,4核/4G/20G/2Mbps不限流量香港VPS[主机]
- 腾讯云限时秒杀改版:轻量应用服务器2核4G8M仅598元/年,增香港/新香港VPS[主机]
- cmivps:香港vps终身7折,香港服务器终身9折,移动访问尤其优秀香港VPS[主机]
- 悦智网络:香港cn2 VPS阿里云线路,四川德阳高防vps,大连高防vp香港VPS[主机]
- CMIVPS,香港vps终身八折$7.76/月起,1核1G内存,香港沙田香港VPS[主机]
- 性价比最高的VPS网络评测全球[VPS测评]
- 详细介绍vps云服务器及其作用全球[VPS测评]
- 腾讯云海外服务器优惠活动:全球购1核2G美国云服务器低至318元/年美国VPS[主机]
- CMIVPS,香港vps终身八折$7.76/月起,1核1G内存,香港沙田香港VPS[主机]
- 什么是Bootstrap?全球[VPS测评]
- 磐逸云怎么样?CN2线路香港VPS月付20元香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-145075.html











