for apache2 configuration:

by default, apache is configured 80 port for the default web site.

follow is a step for configing the second website with 8000 port:

1 in folder /etc/apache2/sites-available, create a new conf(testdj.conf):

the content as below:

<VirtualHost *:8000>
        ServerName 40.74.87.66
        WSGIScriptAlias / /usr/lib/djangotest/testdj/testdj/wsgi.py
        <Directory /usr/lib/djangotest/testdj/testdj/>
        <Files wsgi.py>
                Require all granted
                Order deny,allow
                Allow from all
        </Files>
        </Directory>
</VirtualHost>

2. in the file /etc/apache2/ ports.conf, add the follow content for listenning 8000 port:

   Listen 8000

3. enable the new site with follow command:

sudo a2ensite testdj

(note: here the testdj is the name of testdj.conf)

4. if need to install wsgi feature, use the follow command to enable the wsgi mod:

for python3:

  sudo apt-get install libapache2-mod-wsgi-py3

       sudo apt-get purge libapache2-mod-wsgi-py3

for python2:

sudo apt-get install libapache2-mod-wsgi
       sudo apt-get purge libapache2-mod-wsgi

4. then restart apache service:

   sudo service apache2 restart

now, the website with 8000 port will work.

maybe also need the add permission for the new web project files.

参照:https://www.cnblogs.com/hubing/p/3424987.html

Apache 配置多个端口多站点(Linux)的更多相关文章

  1. apache配置多个虚拟目录站点

    错误的做法 网上查了几个资料,做法如下:比如想配置两个www.web1.com  www.web2.com站点 打开httpd.conf ,然后添加: <VirtualHost *:80> ...

  2. Apache本机不同端口多站点配置:httpd-vhosts.conf(转载)

    环境:Apache2.2.9,Resin-3.1.6,Win Server 2003 1.解压Resin至任意目录,我的是D:; 2. 安装Apache,具体操作下一步.下一步即可,其中要配置的地方是 ...

  3. PHP学习笔记:APACHE配置虚拟目录、一个站点使用多域名配置方式

    我用的是xmapp lite2016的集成包,配置虚拟目录教程如下: 找到httpd-vhosts.conf这个文件,这个文件一般是在xampp\apache\conf\extra这个路径下面,找不到 ...

  4. Apache 多端口多站点配置实例

    分享下Apache多端口多站点的配置方法,配置apache服务器的朋友参考下. 配置httpd.conf 监听多个端口 复制代码代码如下: # Listen: Allows you to bind A ...

  5. Apache服务器在80端口配置多域名虚拟主机的方法

    我们在配置一台服务器的时候,如果只运行一个站点,往往过于浪费资源.Nginx和Apache都可以通过配置虚拟主机实现多站点.配置虚拟主机的方式主要有两种,一种是多个不同端口对应的多个虚拟主机站点,一种 ...

  6. windows apache 配置多个服务站点

    原文 方法一:多个APACHE服务 更改第一个站点的根目录: 在文件Apache2.2/conf/httpd.conf中查找 DocumentRoot 属性,将后面的路径改为你的主站点的路径, 如:D ...

  7. apache 配置网站目录,虚拟目录,新端口

    1 配置网站目录,以ubuntu为例 1)打开apache的默认配置文件夹:cd /etc/apache2/sites-available 2)打开配置文件,本机为sudo vi  000-defau ...

  8. apache配置多个站点

    序:这次项目主要是为了给微信客户端添加一个地址,在微信公众号里面添加一个可以访问的app下载页面,说起来很简单,但总不能为了这么小的一个网站新建一个web服务器吧! 现在开始配置,首先必须确认已经在L ...

  9. 基于Apache在本地配置多个虚拟主机站点

    简单的说,打开httpd.conf 在最后加入如下内容: <VirtualHost 127.0.0.2:80>    DocumentRoot d:/AppServ/www2    Ser ...

随机推荐

  1. Mysql笔试题(二)

    (1)表名:购物信息购物人      商品名称     数量A            甲          2B            乙          4C            丙       ...

  2. ngnix 反向代理来解决前端跨域问题

    1.定义 跨域是指a页面想获取b页面资源,如果a.b页面的协议.域名.端口.子域名不同,所进行的访问行动都是跨域的,而浏览器为了安全问题一般都限制了跨域访问,也就是不允许跨域请求资源.注意:跨域限制访 ...

  3. JMeter-正则表达式(HTML)

    2019-04-26问题:需要取出交易成功,但是有黄色部分 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN& ...

  4. python --(链表)

    链表的使用 #/usr/bin/python#-*- coding: utf-8 -*-#Function: simulate the link-list in python#__author__: ...

  5. word_freq

    1) 博客开头给出自己的基本信息,格式建议如下: 学号:2017*****7193(保留前4位和后4位,中间用星号代替,避免泄露个人信息): 姓名:刘新飞,用你的真实姓名替代 我的码云仓库地址:[ht ...

  6. 爬虫---爬虫er与反爬虫er之间的斗争 转发

    转自:昵称:python修行路 https://www.cnblogs.com/zhaof/p/7326260.html

  7. LNMP分离式部署

    #### LNMP组合工作流程 在LNMP组合工作时,首先是用户通过浏览器输入域名请求Nginx Web服务,如果请求是静态资源,则由Nginx解析返回给用户:如果是动态请求(.php结尾),那么Ng ...

  8. JAVA常用加密解密算法Encryption and decryption

    加密,是以某种特殊的算法改变原有的信息数据,使得未授权的用户即使获得了已加密的信息,但因不知解密的方法,仍然无法了解信息的内容.大体上分为双向加密和单向加密,而双向加密又分为对称加密和非对称加密(有些 ...

  9. git之push

    git push :将本地的哪个分支推送到哪个远程主机上的哪个分支.因此明确主机.本地分支名.远程分支名这三个要素. git push命令用于将本地分支的更新,推送到远程主机.它的格式与git pul ...

  10. node多人聊天室搭建

    1.采用websocket: 为什么不用ajax的http:在用HTTP发送消息时,必须用一个新的TCP/IP连接.打开和关闭连接需要时间.此 外,因为每次请求都要发送HTTP头,所以传输的数据量也比 ...