在CentOS上安装和配置XAMPP
2020-05-11 本文已影响0人
BlueFishMan
安装XAMPP
1. 系统版本
lsb_release -a
或者
cat /etc/redhat-release
2. 下载
https://www.apachefriends.org/download.html
wget https://www.apachefriends.org/xampp-files/7.2.30/xampp-linux-x64-7.2.30-0-installer.run
wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/7.2.30/xampp-linux-x64-7.2.30-0-installer.run
3. 安装
chmod 755 xampp-linux-*-installer.run
sudo ./xampp-linux-*-installer.run
4. 安装目录
/opt/lampp
5. 配置文件
- Apache配置文件:
/opt/lampp/etc/httpd.conf
/opt/lampp/etc/extra/httpd-xampp.conf
- PHP配置文件:
/opt/lampp/etc/php.ini
- MySQL配置文件:
/opt/lampp/etc/my.cnf
- ProFTPD配置文件:
/opt/lampp/etc/proftpd.conf
启动XAMPP
sudo /opt/lampp/lampp start
问题&解决No.1
/opt/lampp/lampp start
XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility library for your system.
yum install libnsl
https://forums.centos.org/viewtopic.php?t=71785
问题&解决No.2
/opt/lampp/lampp start
Starting XAMPP for Linux 7.2.31-0...
XAMPP: Starting Apache.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting MySQL.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
XAMPP: Starting ProFTPD.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
ok.
yum install net-tools
关闭XAMPP
sudo /opt/lampp/lampp stop
配置
1. 安全
sudo /opt/lampp/lampp security
2. 开机启动
- Debian, Ubuntu.
sudo ln -s /opt/lampp/lampp /etc/init.d/lampp
sudo update-rc.d lampp start 80 2 3 4 5 . stop 30 0 1 6 .
- RedHat, Fedora, CentOS. If your Linux distro uses "chkconfig" tool to install the services you can run the following commands:
sudo ln -s /opt/lampp/lampp /etc/init.d/lampp
sudo chkconfig --add lampp
- SUSE
sudo ln -s /opt/lampp/lampp /etc/init.d/lampp
sudo chkconfig lampp 2345
3. 激活eAccelerate
/opt/lampp/etc/php.ini
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/opt/lampp/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
4. 数据库远程链接
https://www.jianshu.com/p/d7b9c468f20d
- 登陆
[root@instance-q5oe4saj ~]# /opt/lampp/bin/mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.4.11-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
- 创建用户
MariaDB [(none)]> CREATE USER 'remote'@'%' IDENTIFIED BY '*';
Query OK, 0 rows affected (0.000 sec)
- 授权
MariaDB [(none)]> GRANT ALL ON *.* TO 'remote'@'%';
Query OK, 0 rows affected (0.000 sec)
git
https://www.jianshu.com/p/b02645fff791
1. 安装
yum install git
2. 配置
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
3. 复制公钥
cat ~/.ssh/id_rsa.pub