最新消息:阿啰哈,本人90后,目前单身,欢迎妹子们来撩!.(。→‿←。) 微信:frank01991

GNU/Linux中安装XAMPP

Xubuntu 林志斌 987浏览

介绍

XAMPP(跨平台,Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包。

下载

XAMPP官方下载地址:http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/
官方网站:http://www.apachefriends.org/en/index.html
截至目前,Linux下的最新版为:
xampp-linux-x64-1.8.3-1-installer.run(for 64bits)
xampp-linux-1.8.3-1-installer.run(for 32bits)
http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/

安装

下载好后,把软件移动到/opt目录里:sudo mv ./sudo mv xampp-linux-x64-1.8.3-1-installer.run /opt
并添加可执行权限:sudo chmod +700 xampp-linux-x64-1.8.3-1-installer.run
安装:sudo ./xampp-linux-x64-1.8.3-1-installer.run
下面是详细的安装截图:

启动时注意

kashu本人第一次启动时,Apache就启动失败,通过netstat -tunap查看到vmware占用了443端口,kill占用进程后(或把vmware这个服务停止就可以了sudo /etc/init.d/vmware-workstation-server stop),再次启动xampp就OK
16:19 [email protected]:/opt/lampp$ sudo ./xampp start
Starting XAMPP for Linux 1.8.3-1...
XAMPP: Starting Apache...fail.
XAMPP:  Another web server with SSL is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
注意这三个端口不要被占用了:
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      21591/httpd     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      21591/httpd     
tcp6       0      0 :::3306                 :::*                    LISTEN      21520/mysqld 

启动

再次启动xampp即可:
16:20 [email protected]:/opt/lampp$ sudo ./xampp start
Starting XAMPP for Linux 1.8.3-1...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...already running.
XAMPP: Starting ProFTPD...already running.
此时可以在浏览器中打开:http://127.0.0.1 或 https://localhost

执行xampp时的相关参数:

16:18 [email protected]:/opt/lampp$ sudo ./xampp 
Usage: xampp <action>

start         Start XAMPP (Apache, MySQL and eventually others)
startapache   Start only Apache
startmysql    Start only MySQL
startftp      Start only ProFTPD

stop          Stop XAMPP (Apache, MySQL and eventually others)
stopapache    Stop only Apache
stopmysql     Stop only MySQL
stopftp       Stop only ProFTPD

reload        Reload XAMPP (Apache, MySQL and eventually others)
reloadapache  Reload only Apache
reloadmysql   Reload only MySQL
reloadftp     Reload only ProFTPD

restart       Stop and start XAMPP
security      Check XAMPP's security

enablessl     Enable SSL support for Apache
disablessl    Disable SSL support for Apache

backup        Make backup file of your XAMPP config, log and data files

oci8          Enable the oci8 extenssion

panel         Starts graphical XAMPP control panel
IMPORTANT FILES AND DIRECTORIES(重要文件和目录)
File/Directory Purpose
/opt/lampp/bin/ The XAMPP commands home. /opt/lampp/bin/mysql calls for example the MySQL monitor.
/opt/lampp/htdocs/ The Apache DocumentRoot directory.
/opt/lampp/etc/httpd.conf The Apache configuration file.
/opt/lampp/etc/my.cnf The MySQL configuration file.
/opt/lampp/etc/php.ini The PHP configuration file.
/opt/lampp/etc/proftpd.conf The ProFTPD configuration file. (since 0.9.5)
/opt/lampp/phpmyadmin/config.inc.php The phpMyAdmin configuration file.
建议再做个安全设置,执行此脚本:sudo /opt/lampp/xampp security
连接mysql数据库的用户名和密码在这:sudo vim /opt/lampp/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123';
更改默认的http监听端口:sudo vim /opt/lampp/etc/httpd.conf
找到Listen 80这行,把80端口改成其它端口后需重启apache服务:sudo /opt/lampp/xampp reloadapache

如何卸载:

先把服务关闭:sudo /opt/lampp/lampp stop
16:46 [email protected]:/opt/lampp$ sudo ./uninstall
or
16:46 [email protected]:/opt/lampp$ sudo rm -rf /opt/lampp

另可参考:
http://www.apachefriends.org/en/xampp-linux.html
http://wiki.ubuntu.org.cn/Xampp

转载请注明:林志斌 » GNU/Linux中安装XAMPP

发表评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址