源码安装apache

谁说我不能喝 提交于 2020-01-14 06:05:53
源码安装httpd

1.安装apr和apr-util
   apr
      ./configure --prefix=/usr/local/apr && make && make install
   apr-util
      ./configure --with-apr=/usr/local/apr  --prefix=/usr/local/apr-util && make && make install

2.安装httpd
    ./configure  --with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util --prefix=/usr/local/apache2 --enable-so && make && make install

3.配置的虚拟主机
    vim /usr/local/apache2/conf/httpd.conf
    	# Virtual hosts
        Include conf/extra/httpd-vhosts.conf        \\启用包含虚拟主机配置文件

    vim /usr/local/apache2/conf/extra/httpd-vhosts.conf \\编辑虚拟主机配置文件
      \\增加虚拟主机
        <VirtualHost 192.168.189.180:80>
          DocumentRoot "/opt/html"
          ServerName  www.1706A.com
          ErrorLog "logs/1706A.com-error_log"
          CustomLog "logs/1706A.com-access_log" common
        </VirtualHost>
        
    修改访问目录的权限
    vim /usr/local/apache2/conf/httpd.conf
        <Directory />
           AllowOverride none
           Require all granted
        </Directory>
    重启httpd
    /usr/local/apache2/bin/apachectl -k restart
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!