web - ubuntu下apache2.4配置多站點問題
問題描述
在apache2.4下配置了如下代碼文件但是apache報錯(另外網上教程說綁定host文件,我并不知道這是什么東西。。)
配置部分代碼如下apache2.confInclude the virtual host configurations:IncludeOptional sites-enabled/*.confNameVirtualHost smilencer.me<VirtualHost 138.68.12.160:80>
ServerName www.smilencer.meDocumentRoot '/var/www/wordpress' <Directory '/var/www/wordpress'> Options FollowSymLinks AllowOverride All Require all granted
</Directory> </VirtualHost> <VirtualHost 138.68.12.160:80>
ServerName www.whatare.meDocumentRoot '/var/www/What_Are_You_Doing/map'
<Directory '/var/www/What_Are_You_Doing/map'>
Options FollowSymLinks AllowOverride All Require all granted
</Directory> </VirtualHost>
NameVirtualHost whatare.me
mytest.conf
問題解答
回答1:這里給你一個參考,你可以用你自己的域名替換掉[YOUR_DOMAIN_NAME]
<VirtualHost *:80> ServerAdmin admin@[YOUR_DOMAIN_NAME].com DocumentRoot '/var/www/dev/doc' ServerName [YOUR_DOMAIN_NAME].com ServerAlias [YOUR_DOMAIN_NAME].com ErrorLog logs/[YOUR_DOMAIN_NAME].com-error_log</VirtualHost>
相關文章:
1. 淺談vue生命周期共有幾個階段?分別是什么?2. index.php錯誤,求指點3. 視頻 - html5 video的autoplay 在智能手機上不運作?4. javascript - 百度坐標,返回目標附近有哪些坐標5. css3 - 使用less編譯css后,后期的項目中less是直接放在項目文件中,后期如何維護呢6. css3 - 在css里面,樣式不生效問題7. node.js - 在阿里云搭建vue環境后npm run dev 沒有看到vue歡迎頁面而是 UnhandledPromiseRejection8. javascript - Jquary的contains如何做到精準匹配9. html5 - 前端面試碰到了一個緩存數據的問題,來論壇上請教一下10. javascript - ui-router AngularJS url顯示正常 頁面沒有變化?
