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的更多相关文章

  1. [R] /usr/share/doc/apache2/README.Debian.gz

    Contents======== Apache2 Configuration under Debian GNU/Linux Files and Directories in '/etc/apache2 ...

  2. Installing OwnCloud 9 on Debian 8

    原文:https://www.howtoforge.com/tutorial/owncloud_9-installation-on-debian_8/?utm_source=tuicool&u ...

  3. centos apache2.4.6 apache https配置

    错误描述: SSL 接收到一个超出最大准许长度的记录. 错误代码:SSL_ERROR_RX_RECORD_TOO_LONG 原因: root@iZwz93telmwbh624e5zetqZ:~# ap ...

  4. Ubuntu 16.04 LAMP server 指南 - 配置 Apache2.4,PHP7,和MariaDB(而不是MySQL)

    翻译自:https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ 昨天在虚 ...

  5. Apache2 在Linux环境下的安装

    安装Apache2: apt-get install apache2 启动Apache2服务: service apache2 start 在终端运行启动后,打开浏览器URL访问 http://loc ...

  6. opensuse 安装APACHE2+MYSQL+PHP5

    sudo zypper in apache2-mod_php5 apache2 mariadb 装好后, 记得启动APACHE2对PHP的支持: a2enmod php5 默认mysql密码为空, 可 ...

  7. 开启apache2的ssl访问功能

    Ubuntu 20.04 1. Apache2默认安装的时候,ssl模块是不启用的.开启命令: $ sudo apt install apache2 #安装$ sudo a2enmod ssl #开启 ...

  8. Apache multiple domains setup

    Running several name-based web sites on a single IP address. Your server has a single IP address, an ...

  9. Ubuntu 16.04 LAMP server tutorial with Apache 2.4, PHP 7 and MariaDB (instead of MySQL)

    https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ This tut ...

随机推荐

  1. 使用service&scope 进行注入

    @service 声明该类为一个bean,bean的名称为类名首字母小写(customerService) @Scope("prototype")则声明为一个原子类型,既每个get ...

  2. 在使用windows调用Hadoop 错误 /bin/bash: line 0: fg: no job control一般解决方法

    在使用windows调用Hadoop yarn平台的时候,一般都会遇到如下的错误: 2014-05-28 17:32:19,761 WARN org.apache.hadoop.yarn.server ...

  3. bzoj 3157 && bzoj 3516 国王奇遇记——推式子

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3157 https://www.lydsy.com/JudgeOnline/problem.p ...

  4. bzoj 1001 [BeiJing2006]狼抓兔子——最小割转最短路

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1001 #include<cstdio> #include<cstring& ...

  5. Linux 制作补丁 打补丁 撤销补丁

    1.制作补丁 diff - 逐行比较文件 格式 diff   参数   旧文件/旧文件夹   新文件/新文件夹 -N   将不存在的文件看作是空的 -a   将所有文件都视为文本文件 -u   以合并 ...

  6. 【转载】Leaflet 中文api

    L.Map API各种类中的核心部分,用来在页面中创建地图并操纵地图. 使用 example // initialize the map on the "map" div with ...

  7. UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 7: ordinal not in range(128) [duplicate]

    Python在往文件里写东西的时候,如果ascii码报错 参考 http://stackoverflow.com/questions/19833440/unicodeencodeerror-ascii ...

  8. 监控mysql状态并发送Email

    */10 * * * *  /shell/mysql_status.sh > /dev/null 2>&1 #!/bin/bash port55=`/usr/sbin/lsof - ...

  9. ubuntu 进入单用户模式

    进入单用户模式:  按shift进入 1.开机到grub时,用上下键移到第二行的恢复模式,按e(注意不是回车) 即Ubuntu,With Linux 3.2.0-23-generic(recovery ...

  10. codechef January Lunchtime 2017简要题解

    题目地址https://www.codechef.com/LTIME44 Nothing in Common 签到题,随便写个求暴力交集就行了 Sealing up 完全背包算出得到长度≥x的最小花费 ...