美文网首页
Apache虚拟目录的配置

Apache虚拟目录的配置

作者: 某人A | 来源:发表于2017-11-06 11:06 被阅读0次

我直接说我的习惯吧,我一般在/etc/httpd/conf.d/目录下创建对应得文件比如我创建一个demo.com的虚拟目录执行命令如下

vim /etc/httpd/conf.d/demo.conf

写入下面内容

<VirtualHost *:80>  
 ServerName demo.com  
 DocumentRoot "/home/www/demo"  
 DirectoryIndex index.html index.php  
  
 <Directory "/home/www/demo">  
  Options -Indexes +FollowSymlinks  
  AllowOverride All  
  Require all granted  
 </Directory>  
  
</VirtualHost>

保存重启 systemctl restart httpd
OK 搞定
apache版本2.4.*

相关文章

网友评论

      本文标题:Apache虚拟目录的配置

      本文链接:https://www.haomeiwen.com/subject/otakmxtx.html