How to create VirtualHost in Ubuntu 12.10 [closed]

徘徊边缘 提交于 2019-12-10 13:44:51

问题


I had followed many articles to 'How to create VirtualHost in Ubuntu'. This is what have I done

Installed Apache

sudo apt-get  install lamp-server^ phpmyadmin

I created folder called site1.com in /var/www/

Then I have created the file in /etc/apache2/sites-available/site1.com

Then added the following code to that site1.com file

<VirtualHost *:80>
    ServerName www.site1.com
    ServerAdmin mifas@site1.com
    ServerAlias site1.com
    DocumentRoot /var/www/site1.com

    # Other directives here
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /var/www/site1.com/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Then after that I edit the host file added the following line of code

127.0.0.1   site1.com

Edit Also I enable the site1.com via sudo a2ensite site1.com

Then i restart the apache serivice. (Even i restarted the pc)

When I go to the site1.com, It will say The connection has timed out Error Message. But I can browse via localhost/site1.com. I have been trying since last two days. No solution. And followed many articles and videos.

来源:https://stackoverflow.com/questions/13575987/how-to-create-virtualhost-in-ubuntu-12-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!