XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建 XAMPP 软件站集成软件包。这个软件包原来的名字是 LAMPP,但是为了避免误解,最新的几个版本就改名为 XAMPP 了。它可以在Windows、Linux、Solaris、Mac OS X 等多种操作系统下安装使用,支持多语言:英文、简体中文、繁体中文、韩文、俄文、日文等。下面介绍下xampp的安装:
去xampp的官网 http://www.apachefriends.org 下载最新的版本,这里下载的是xampp-linux-x64-1.8.3-5-installer.run,适合64位的Linux操作系统。下载之后,将其上传到服务器。
给xampp-linux-x64-1.8.3-5-installer.run添加可执行权限,并允许。
[root@iZ23o5qv2ozZ zhongning]# ls -l total 121572 -rw-rw-r-- 1 zhongning zhongning 124487989 Nov 17 22:17 xampp-linux-x64-1.8.3-5-installer.run [root@iZ23o5qv2ozZ zhongning]# chmod +x xampp-linux-x64-1.8.3-5-installer.run [root@iZ23o5qv2ozZ zhongning]# ./xampp-linux-x64-1.8.3-5-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 finished installing XAMPP on your computer. [root@iZ23o5qv2ozZ zhongning]#
进入/opt/lampp目录,可以查看到组件都已经安装。给htdocs目录赋予777所有的权限,方便以后使用。
[root@iZ23o5qv2ozZ lampp]# cd /opt/lampp/ [root@iZ23o5qv2ozZ lampp]# ls apache2 htdocs licenses php uninstall bin icons logs phpmyadmin uninstall.dat build img man proftpd var cgi-bin include manager-linux-x64.run properties.ini xampp ctlscript.sh info manual RELEASENOTES docs lampp modules sbin error lib mysql share etc libexec pear temp [root@iZ23o5qv2ozZ lampp]# chmod -R 777 /opt/lampp/htdocs
执行命令/opt/lampp/lampp start
[root@iZ23o5qv2ozZ lampp]# /opt/lampp/lampp start Starting XAMPP for Linux 1.8.3-5... XAMPP: Starting Apache...ok. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...fail. XAMPP: Another FTP daemon is already running. [root@iZ23o5qv2ozZ lampp]#
在浏览器中输入http://121.41.32.134/xampp/,结果出现403错误,意思是只允许从本机发起访问,需要修改配置文件。
修改配置文件/opt/lampp/etc/extra/httpd-xampp.conf如下所示。
[root@iZ23o5qv2ozZ extra]# vi /opt/lampp/etc/extra/httpd-xampp.conf <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> #Require local Order deny,allow Allow from all ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </LocationMatch>
重启xampp,/opt/lampp/lampp restart,即可看到正确的网页。
原文:http://www.cnblogs.com/zhongning/p/4106725.html