码迷,mamicode.com
首页 > Web开发 > 详细

Setup Apache2 in Debian 9 and enable two ports for two sites

时间:2017-07-12 00:55:20      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:available   color   conf   mod   var   host   listen   ota   deb   

root@debian:~# apt-get install apache2

root@debian:~# cd /etc/apache2/

root@debian:/etc/apache2# ls -l

total 80
-rw-r--r-- 1 root root  7224 Jun 20 15:29 apache2.conf
drwxr-xr-x 2 root root  4096 Jul  8 12:06 conf-available
drwxr-xr-x 2 root root  4096 Jul  8 12:06 conf-enabled
-rw-r--r-- 1 root root  1782 Jun 20 15:25 envvars
-rw-r--r-- 1 root root 31063 Jan 25 16:16 magic
drwxr-xr-x 2 root root 12288 Jul 11 10:05 mods-available
drwxr-xr-x 2 root root  4096 Jul 11 10:05 mods-enabled
-rw-r--r-- 1 root root   332 Jul  8 11:40 ports.conf
drwxr-xr-x 2 root root  4096 Jul 11 10:21 sites-available
drwxr-xr-x 2 root root  4096 Jul 11 10:14 sites-enabled

root@debian:/etc/apache2# vi ports.conf


Listen 80
Listen 8080 

<IfModule ssl_module>

 

root@debian:/etc/apache2# cd sites-enabled/

root@debian:/etc/apache2/sites-enabled# cp 000-default.conf 001-default.conf

root@debian:/etc/apache2/sites-enabled# vi 001-default.conf

<VirtualHost *:8080>

        DocumentRoot /var/www/mysite

root@debian:/etc/apache2/sites-enabled# apachectl -k restart

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now, we have two site could be accessed. http://127.0.0.1,  http://127.0.0.1:8080

 

Setup Apache2 in Debian 9 and enable two ports for two sites

标签:available   color   conf   mod   var   host   listen   ota   deb   

原文地址:http://www.cnblogs.com/iwasmu/p/7153027.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!