【发布时间】:2017-02-13 13:10:17
【问题描述】:
我想将我的端口号 80 更改为我的 Apache 服务器的其他号码。在 ubuntu 中怎么可能
【问题讨论】:
标签: apache
我想将我的端口号 80 更改为我的 Apache 服务器的其他号码。在 ubuntu 中怎么可能
【问题讨论】:
标签: apache
您可以在 /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
【讨论】:
在任何操作系统上更改您的虚拟主机,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...
【讨论】: