Setup Apache2 in Debian 9 and enable two ports for two sites
2017-07-11 22:54
411 查看
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
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
相关文章推荐
- Dual-Port Block RAM with Two Write Ports and Byte-wide Write Enable in Read-First Mode
- Batch ReaderEnable:编程实现 Batch "Enable For Commenting and analysis In Adobe Reader"
- Cabling Guide for Console and AUX Ports
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- Setup 64-bit Windows Server for Running ASP.NET 1.1 and ASP.NET 2.0 at the Same Time
- How to setup a new Organization and Set of Books for a Payables Responsibility
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experience
- How to enable packet forwarding for IPv4 and IPv6
- Setup 64-bit Windows Server for Running ASP.NET 1.1 and ASP.NET 2.0 at the Same Time
- Adapting to Web Standards: CSS and Ajax for Big Sites
- Step-by-step setup guide for two interconnected Asterisk boxes with chan_ss7
- A soulation for loss the PageSetUp porperty after InsertFile or merge two files in Interp.Word
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experi
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experi
- Two Sql script for counting tables and using snapshot
- HWOTO install and setup Apache+Jakarta-Tomcat4.01+tomcat-connectors for Linux
- Code maturity level options 代码成熟度选项 [*]Prompt for development and/or incomplete code/drivers 显示尚在开发中或尚未完成的代码与驱动.除非你是测试人员或者开发者,否则请勿选择 我是开发者,所以选[*] Loadable module support 可加载模块支持 [*]Enable loadable module support 内核编译配置选项简介 (2.4.20-8
- Design Accessible Web Sites: 36 Keys to Creating Content for All Audiences and Platforms
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- 10 Tips and Tricks for Private BitTorrent Sites