Apache 和 XAMPP

Apache 和 XAMPP

我是 Linux 和 XAMPP 的新手,我想用 php 和 mySql 创建一个网站。问题是我不知道如何创建新的 Apache 服务器。当我重新启动 Apache 时,我收到此消息,有人能告诉我这是什么意思,以及如何解决它吗?

$ sudo /etc/init.d/apache2 restart
[sudo] password for sheila: 
1. Restarting web server apache2
AH00558: apache2: Could not reliably determine the server's fully
qualified domain name, using 127.0.1.1. Set the 'ServerName' directive
globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
[fail]
2. The apache2 instance did not start within 20 seconds. Please read the
log files to discover problems

答案1

Ubuntu 预装了 Apache,因此该服务会在启动时自动启动。如果您想使用 XAMPP 捆绑的 Apache,则需要停止当前的 Apache。命令如下:

sudo service apache stop
//go to /opt/lampp or whereever you've put your XAMPP and launch it
sudo ./lampp start

更新:如果你想在启动时自动启动整个 XAMPP(我不建议这样做,因为它会降低你的操作系统速度),这里是如何(但您应该卸载当前的 Apache 才能使其工作)。

相关内容