Ubuntu_Debian配置Apache2_PHP配置站点
日常更新 apt-get update -y apt-get upgrade -y 查找程序名 sudo apt-cache search apache | grep 'apache2' 安装Apache2 apt-get install apache2 安装好后开服务 service apache2 start systemctl enable apache2 检查Apache2运行状态 systemctl status apache2 安装Apache的php支持模块 sudo apt-get install libapache2-mod-php 重启Apache2 /etc/init.d/apache2 restart 停止 /etc/init.d/apache2 stop 状态查询 /etc/init.d/apache2 status 在浏览器中输入IP地址,看到以下页面说明apache成功安装 Debian系统上Apache2 Web服务器安装的配置布局如下: /etc/apache2/ |-- apache2.conf | `-- ports.conf |-- mods-enabled | |-- *.load | `-- *.conf |-- conf-enabled | `-- *.conf |-- sites-enabled | `-- *.conf apache2.conf is the main configuration file. It puts the pieces together by including all remaining configuration files when starting up the web server. ports.conf is always included from the main configuration file. It is used to determine the listening ports for incoming connections, and this file can be customized anytime. Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ directories contain particular configuration snippets which manage modules, global configuration fragments, or virtual host configurations, respectively. They are activated by symlinking available configuration files from their respective *-available/ counterparts. These should be managed by using our helpers a2enmod, a2dismod, a2ensite, a2dissite, and a2enconf, a2disconf . See their respective man pages for detailed information. The binary is called apache2. Due to the use of environment variables, in the default configuration, apache2 needs to be started/stopped with /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not work with the default configuration. Document Roots ...