一、 下載XAMPP
如果直接使用wget從xampp的官網上下載,由於各種牆,不能下載成功,可以在 該鏈接 中選擇自己需要的版本。我選擇的linux下,64位,5.6.14這個版本。
使用以下命令進行下載:
# wget http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.14/xampp-linux-x64-5.6.14-0-installer.run
下載成功後,會在目錄中看到名爲:xampp-linux-x64-5.6.14-0-installer.run
的文件。
二、 安裝
安裝前,需要先給xampp安裝包可執行的權限
# chmod 777 xampp-linux-x64-5.6.14-0-installer.run
運行 ./xampp-linux-x64-5.6.14-0-installer.run
進行安裝操作。根據提示進行選擇需要安裝的部分即可:
至此,安裝步驟就已經完成了 啓動xampp:
# /opt/lampp/lampp start
停止xampp:
# /opt/lampp/lampp stop
卸載xampp:
# /opt/lampp/lampp stop
# rm -rf /opt/lampp
三、 讓局域網均可訪問
安裝完成後,很多時候用locahost來訪問時,是沒有問題的,但是同一局域網裏其它主機用域名訪問時,常常不能訪問,這裏情況大概分爲兩種: 1. xampp的配置文件:/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
2. 如果按照以上修改後,還是不能訪問,則可能是防火牆把80端口給幹掉了,要麼把防火牆關閉,要麼配置一下80端口允許訪問。
四、 安裝設置
在默認的安裝過程中,xampp所有均是沒有密碼的,爲了安全,我們應該爲xampp設置密碼。該如何操作呢?
# /opt/lampp/lampp security
- 1
設置xampp的密碼: XAMPP: Quick security check… XAMPP: Your XAMPP pages are NOT secured by a password. XAMPP: Do you want to set a password? [yes] yew XAMPP: Do you want to set a password? [yes] yes XAMPP: Password: XAMPP: Password (again):
用戶名默認是:xampp
設置phpMyAdmin的密碼: 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.
設置mysql的root賬戶: 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.
設置ftp密碼: 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):
通過以上步驟,基本的設置就搞定了,已經達到可用的程度。想要了解更多的,可用google啦!