XAMPP(Apache+MySQL+PHP+PERL)是一個功能強大的建 XAMPP 軟件站集成軟件包。這個軟件包原來的名字是 LAMPP,但是為了避免誤解,最新的幾個版本就改名為 XAMPP 了。它可以在Windows、Linux、Solaris、Mac OS X 等多種操作系統下安裝使用,支持多語言:英文、簡體中文、繁體中文、韓文、俄文、日文等。下面介紹下xampp的安裝:
1、下載
去xampp的官網 http://www.apachefriends.org 下載最新的版本,這里下載的是xampp-linux-x64-1.8.3-5-installer.run,適合64位的Linux操作系統。下載之后,將其上傳到服務器。
2、安裝
給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
3、啟動
執行命令/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]#
4、驗證
在瀏覽器中輸入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,即可看到正確的網頁。