Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
398 views
in Technique[技术] by (71.8m points)

apache - 为什么apache2服务器中的虚拟主机对我不起作用? [关闭](Why virtual host in the apache2 server is not working for me? [closed])

I have installed apache2 server with ubuntu 18.04.

(我已经用ubuntu 18.04安装了apache2服务器。)

I have started the service and I am able to see the localhost page for ubuntu.

(我已经启动了该服务,并且能够看到ubuntu的localhost页面。)

Then I created a new configuration in the /etc/apache2/sites-available named mysite.conf , and it looks like the below configuration.

(然后,我在/etc/apache2/sites-available创建了一个名为mysite.conf的新配置,它看起来像下面的配置。)

<VirtualHost example222.com:80>
    ServerName www.example222.com
    ServerAlias example222.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/example222/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I enabled this configuration using sudo a2ensite mysite.conf and restarted the apache2 server using sudo service apache2 restart .

(我使用sudo a2ensite mysite.conf启用了此配置,并使用sudo service apache2 restart重启了apache2服务器。)

I have a directory /var/www/example222/html which contains an index.html file.

(我有一个目录/var/www/example222/html ,其中包含一个index.html文件。)

After doing all this I am not able to visit www.example222.com on my local network.

(完成所有这些操作后,我将无法访问我的本地网络上的www.example222.com 。)

I don't understand the mistake I have made.

(我不明白我犯的错误。)

Please help.

(请帮忙。)

I have followed following tutorial: https://help.ubuntu.com/lts/serverguide/httpd.html

(我遵循了以下教程: https : //help.ubuntu.com/lts/serverguide/httpd.html)

  ask by MSS translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...