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
- js 实时显示时间(自动变化)代码全球[VPS测评]
- 搬瓦工 $29.88 年 2G 内存 40G SSD 1T 流量 KVM全球[VPS测评]
- select2 动态设置选中项全球[VPS测评]
- HostYun→9.9 元 月 512MB 内存 5GB SSD 空间 虚拟空间(主机)
- 免费美国空间 微基主机→现有 VPS 客户可领取首年免费 100M 高速虚拟空间(主机)
- tudcloud 香港沙田大带宽 vps 七折起,100M 带宽无限流量香港VPS[主机]
- ZJI 香港葵湾服务器六折优惠,香港 CN2 4C 站群 美国圣何塞 G站群服务器[IP]
- DogYun→香港云服务器按小时计费 25.27 元 月起(0.0351香港VPS[主机]
- CN2 $15 年 512M 内存 10G 硬盘 1T 流量@1Gbps全球[VPS测评]
- php 生成唯一订单号全球[VPS测评]
- CrownCloud→洛杉矶大硬盘 KVM 年付 25 美元 德国&荷兰全球[VPS测评]
- ThinkPHP5 自定义配置文件全球[VPS测评]
- 用ImgURL免费图床程序自建WordPress图床全球[VPS测评]
- 新博客如何快速通过 Google AdSense 账号申请全球[VPS测评]
- WordPress博客固定链接是否会影响网站SEO?全球[VPS测评]
- Tmhhost新上香港CN2GIA VPS 三网回程CN2GIA 堪比国香港VPS[主机]
- VPSie 东非吉布提VPS 测试(20M5$)全球[VPS测评]
- Wikihost CN2 香港虚拟主机 → 独立IP → 限量446元独立服务器[U]
- BugetNode → 7G内存 70G储存 7T流量 荷兰高配鸡 月付全球[VPS测评]
- 邢志宏:加快推动高质量建设跨境电商综试区起势成势全球[VPS测评]
- 源云主机,香港沙田VPS CN2 1核1G 24/月 NTT 50M 9香港VPS[主机]
- 金斗云双12活动:全场8折起,美国圣何塞CN2 GIA高防VPS20元/美国VPS[主机]
- sugarhosts糖果主机黑五:VPS服务器5折,最低月付24.5元,香港VPS[主机]
- 创意加载进度HTML动画特效,SVG+CSS3实现的动画死神来了load全球[VPS测评]
- 六一云:香港CN2/洛杉矶高防85折优惠,CDN半年优惠,充值返利送水杯香港VPS[主机]
- 精编案例丨游戏行业转型升级迫在眉睫,云计算助力打造下一代游戏体验全球[VPS测评]
- 1分钟快速读懂云计算全球[VPS测评]
- 麻花云:2021新春采购节,香港云主机2折起,安徽BGP高防云机,移动大香港VPS[主机]
- UCloud优刻得云服务器建站教程:香港云服务器购买优惠方法香港VPS[主机]
- VoLLCloud:香港200Mbps不限速大宽带VPS,免费vps领取香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-145075.html











