【问题标题】:How to change port number of Apache server in ubuntu如何在ubuntu中更改Apache服务器的端口号
【发布时间】:2017-02-13 13:10:17
【问题描述】:

我想将我的端口号 80 更改为我的 Apache 服务器的其他号码。在 ubuntu 中怎么可能

【问题讨论】:

    标签: apache


    【解决方案1】:

    您可以在 /etc/apache2/sites-available 中创建虚拟主机配置文件

    示例:--

      <VirtualHost *:8080>
        ServerAdmin webmaster@localhost
    
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    

    。 . .

    你必须更改 /etc/apache2/ports.conf 上的监听端口

    EX:-- 听8080

    【讨论】:

      【解决方案2】:

      在任何操作系统上更改您的虚拟主机,ubuntu 路径类似于 /etc/apache2/apache2 config 之类的。

      #Virtual host for YOURSITE
      <VirtualHost *:4343>  
              ServerAdmin john.doe@jd.com
              ServerName webpage.dev #same as in your /etc/hosts file
              DocumentRoot /var/www/yoursite
              DirectoryIndex index.html
              <Directory /var/www/yoursite>
                      Options FollowSymLinks MultiViews
                      AllowOverride All
                      Order allow,deny
                      allow from all
              </Directory>
              ErrorLog /var/log/httpd/yoursite_error.log 
              #CustomLog /var/log/apache2/customLog.log  #for ubuntu
      </VirtualHost>
      

      希望这会对您有所帮助,您应该阅读有关 apache coinfiguration...

      这是一个很棒的链接https://www.digitalocean.com/community/tutorials/how-to-configure-the-apache-web-server-on-an-ubuntu-or-debian-vps

      【讨论】:

        猜你喜欢
        • 2013-08-27
        • 2012-07-02
        • 2017-07-09
        • 2014-06-09
        • 2021-12-01
        • 2012-01-24
        • 2016-06-03
        • 2021-10-11
        • 1970-01-01
        相关资源
        最近更新 更多