参考:
https://blog.csdn.net/wyxeainn/article/details/79600897
https://blog.csdn.net/Shezzer/article/details/84075635
https://www.tecmint.com/install-apache-web-server-on-ubuntu-18-04/
一、安装Apache
安装apache2服务器:
sudo apt-get install apache2
查看状态:
service apache2 restart/status/start/stop
或者用:
sudo systemctl status apache2
可以用以下命令manage the Apache service:
$ sudo systemctl status apache2
$ sudo systemctl stop apache2
$ sudo systemctl start apache2
$ sudo systemctl restart apache2
$ sudo systemctl reload apache2
$ sudo systemctl enable apache2
$ sudo systemctl disable apache2
Next, if you have the UFW firewall enabled and running on your system, you need to open the ports 80 and 443 to allow client requests to Apache web server via HTTP and HTTPS respectively, then reload the firewall settings using following commands.
(关闭防火墙80/443限制:ufw是Ubuntu附带的,相对于iptables简单很多的防火墙,即uncomplicated firewall,不复杂的防火墙,繁琐部分的设置还是需要去到iptables。可以用 sudo ufw status 来查看防火墙状态,其它ufw的具体操作请看这里)
$ sudo ufw allow 80/tcp
$ sudo ufw allow 443/tcp
$ sudo ufw reload
查看当前启动和运行apache的用户:
ps -ef | grep httpd
查看/html文件夹下文件和文件夹权限(一般drwx-rx-rx没有问题,755):
ls -l /var/www/html/website
如果不是(意思如果操作wordpress过程中出现“无法创建目录”的情况