logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Can only have one virtual host?
Author
bazianm



Joined: 01 Jul 2014
Posts: 11
Location: Passaic, NJ

PostPosted: Thu 07 Aug '14 14:44    Post subject: Can only have one virtual host? Reply with quote

Hi all...

I have a fresh Ubuntu 14.04 install (desktop). I installed Apache, php and mysql from APT and updated everything.

I tried to setup a virtual host using these directions:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

I followed them to the letter:

o I created a folder /var/www/mydomain.local/public_html
o I copied the 000-default.conf in sites available and modified it
o I added mydomain.local to my hosts file (with IP of 127.0.0.1
o I used a2ensite to enable the host
o I used service apache2 reload

When I went to mydomain.local in firefox, it took me to the default host main page.

I tried a restart of the service and even a reboot of the computer. No change.

On a theory, I used a2dissite to remote 000-default from the enabled site list and reloaded the service. I got the home page for mydomain.local after that.

I created a named host called localhost and reloaded the apache. When I went to http://localhost it took me to the mydomain.local homepage.

Rebooted the computer. Now, localhost gives me the apache default home page and mydomain.local does not work at all (I get a server not found).

I get the feeling that there is an apache configuration item I am missing but I cannot find it.

Any help would be appreciated. I am trying to make this my development laptop and I will need many many hosts on this.

Thanks in advance
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 12 Aug '14 10:21    Post subject: Reply with quote

yaou can check which vhosts are enabled by

Code:
sudo /etc/init.d/apache2 -S


it should give you a list.

What a2ensite does is it creates a symlinmk from /etc/apache2/sites-available/example.conf to /etc/apache2/sites-enabled/example.conf

You can check that

Code:
ls -l /etc/apache2/sites-enabled/
Back to top


Reply to topic   Topic: Can only have one virtual host? View previous topic :: View next topic
Post new topic   Forum Index -> Apache