1.先下载 XAMPP Linux 1.7.3.tar.gz 安装包。并把它上传到centOs 指定目录下。
2.用命令进到该目录里,执行 tar xvfz xampp-linux-1.7.3.tar.gz -C /opt 把它解压到 /opt下。
3. 执行命令 /opt/lampp/lampp start 运行 lampp ,如果看到以下显示信息,表明启动成功.
Starting XAMPP 1.7.3…
LAMPP: Starting Apache…
LAMPP: Starting MySQL…
LAMPP started.
4.测试 转入http://localhost 如果看到欢迎页面,表明安装成功
如果只是简单的安装环境,到这里就可以了,我们说说它的一些默认设置。
程序 是安装 在 /opt/lampp下面的
1 The MySQL administrator (root) has no password.
2 The MySQL daemon is accessible via network.
3 ProFTPD uses the password ”lampp” for user ”nobody”.
4 PhpMyAdmin is accessible via network.
5 Examples are accessible via network.
6 MySQL and Apache running under the same user (nobody).
如果要想修改默认设置密码,可以执行下面的命令
/opt/lampp/lampp security
再根据提示一步一步设置不同的密码就可以了。
下面详细说明一下 lampp 这个命令的各个参数的用法 :
| start | Starts XAMPP. |
| stop | Stops XAMPP. |
| restart | Stops and starts XAMPP. |
| startapache | Starts only the Apache. |
| startssl | Starts the Apache SSL support. This command activates the
SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay activated. |
| startmysql | Starts only the MySQL database. |
| startftp | Starts the ProFTPD server. Via FTP you can upload files for
your web server (user ”nobody”, password ”lampp”). This command activates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay activated. |
| stopapache | Stops the Apache. |
| stopssl | Stops the Apache SSL support. This command deactivates
the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay deactivated. |
| stopmysql | Stops the MySQL database. |
| stopftp | Stops the ProFTPD server. This command deactivates the
ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay deactivated. |
| security | Starts a small security check programm. |
下面写一个调用的例子:开启ssl服务
/opt/lampp/lampp startssl
还有,如果我们要手动配置它的Mysql,Apache,php,它们的目录和配置文件又在哪里呢?
| /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. |
怎样停止服务呢?
/opt/lampp/lampp stop
怎样卸载服务呢?
先停止服务,再 rm -rf /opt/lampp

1 Comment
Pingback: linux下安装php环境xampp并配置虚拟域名 | 北京php培训讲师方龙的博客!