网络营销电子商务研究中心

网络营销电子商务研究中心 (https://www.0058.net/index.php)
-   服务器环境搭建 (https://www.0058.net/forumdisplay.php?f=5)
-   -   Ubuntu 下Apache 域名绑定设置 (https://www.0058.net/showthread.php?t=4306)

topvip 2011-04-26 02:44 AM

Ubuntu 下Apache 域名绑定设置
 
以在Ubuntu 要配置 \var\www\linuxidc 目录为 0058.net为例

一、打开:\etc\hosts文件:sudo vi \etc\hosts
添加:127.0.0.1 0058.net

二、打开: \etc\apache2\sites-available\000-default
在头部添加:NameVirtualHost *:80



三、在目录:etc\apache2\sites-available\下新建一个为:‘0058’的文件(sudo touch 0058)
编辑该文件内容:
<VirtualHost *:80>
ServerName 0058.net
ServerAlias *.0058.net
DocumentRoot "/var/www/0058/"
ErrorLog "/var/log/apache2/0058_errors.log"
CustomLog "/var/log/apache2/0058_accesses.log" common
</VirtualHost>

四、重启apache:sudo /etc/init.d/apache2 restart


All times are GMT +8. The time now is 01:56 AM.

Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.