Blogger Information
Blog 81
fans 1
comment 0
visits 124573
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
linux 下域名配置和虚拟主机文件
有什么是忘不了的的博客
Original
749 people have browsed it

操作和win的大致相同,

    //先关闭防火墙

    systemctl stop firewalld

  1. 修改主配置文件:vim /etc/httpd/conf/httpd.conf (只操作1次)

  2. 查找:AllowOverride

  3. 修改 AllowOverride None 将None改为 All 

        a) 找到虚拟主机配置目录     cd /etc/httpd/conf.d/

        b) 创建虚拟主机文件   vim vhost.con

    在新创建的vhost.con里写入

        listen 8080

        <VirtualHost *:8080>#这里的8080是端口号

             DocumentRoot "/var/www/html/tp5/public" #这里写你要访问的地址

             ServerName 192.168.1.25 #这里写你自己的服务器ip地址

        </VirtualHost>

    4.重启服务器  systemctl restart httpd

然后就可以域名加端口号访问到你指代那个的项目了。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post