markdown add-new-virtual-host.md

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown add-new-virtual-host.md相关的知识,希望对你有一定的参考价值。

# Add new port number based virtual host.
on Mac OSX 10.11.4 El Capitan

If you create virtual host, you can use **document root** for each project.
## Add new virtual host
```shell
$ sudo vim /etc/apache2/extra/httpd-vhosts.conf
```
Add like following.
In this case **3025** is port number.   
You can add port number you like.  
**Edit port number & directory name.**
```apache
<VirtualHost *:3025>
    DocumentRoot "/Library/WebServer/Documents/hoge"

    <Directory "/Library/WebServer/Documents/hoge">
      Options FollowSymLinks Indexes
      AllowOverride All 
      Order deny,allow
      Allow from all
   </Directory>
</VirtualHost> 
```

When you finished add above codes.  
Type ``` :wq ``` command on Vim editor to save & finish Vim editor.

## Open new port number.
```shell
$ sudo vim /etc/apache2/httpd.conf
```
Add following code around Line 52~ to open port.
```
Listen 3025 
```
When you finished to edit.  
Type this command ```:wq``` to save & finish Vim editor.

## Restart Apache to activate new virtualhost you created.
```shell
$ sudo apachectl restart
```

That's all.  
From now you can access to 
[http://localhost:3025/](http://localhost:3025/)

以上是关于markdown add-new-virtual-host.md的主要内容,如果未能解决你的问题,请参考以下文章

转换rst到markdown总结

markdown [Markdown HowTo]作为Markdown语法的秘籍

python markdown干啥用的

markdown前端渲染

如何用markdown生成目录

markdown排版示例