2

Can I have help with making multiple site working with Apache (LAMP) on ubuntu 12.04 desktop ed. I pointed the apache2 to a home directory with my new sites which were enabled, but the browser is only displaying the default website that come with the apache2 installation. thx

Jorge Castro
  • 71,754
irkinosor
  • 141
  • 2
    You'll need to be more specific. Can you explain how you pointed Apache to your home directory? Also, your question is a bit vague. Can you clarify what you're trying to do more specifically? – weberc2 May 15 '12 at 10:54
  • You need read about Virtual Hosts or userdir - it depends what you really need. Take a look on this page. – us3r May 15 '12 at 11:03

3 Answers3

2

To install LAMP on ubuntu 12.04 how to configure apache linux not the one on the ubuntu wiki ApacheMysqlPhp which seems to be a bit outdated since you can ow do the whole installation with:

sudo apt-get install lamp-server^

Now my problem was after creating two news web sites directories called site1 and site2 and enabling them in apache2, I had to point apache2 to their location by editing the etc/hosts file. this was my mistake or what was not working:

127.0.0.1 localhost

127.0.0.1 localhost site1

127.0.0.1 localhost site2

The solution was to point my new sites directories in one line like this:

127.0.0.1 localhost site1 site2

irkinosor
  • 141
0

As us3r indicated in the comment, you need to read the Ubuntu Serve Guide that covers this. Under Configurations > Basic Settings you'll find the instructions to:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mynewsite

and then edit several files to get that site up and running. In other words, use the default Apache site configuration to create one for each site you want to host, then tweak that file to specify all the needed directives(ServerAdmin, ServerName, Listen ports, etc.) for mynewsite.

The guide is very well done, and if you take you time and work through it step-by-step, you should be up and running with multiple sites fairly soon.

P.S. - Hopefully it goes without saying, but please replace mynewsite with the actual name of the site you want to use.

Jim C
  • 343
  • 2
  • 10
0

I've also had issues when adding new sites to 127.0.0.1 where all the config files were setup correctly and the cache cleared but one of the new sites was not working. To fix it I had to disable all of the other sites using the terminal command a2dissite sitename first then enable the new site using a2ensite sitename, restart the server and it worked.

br3w5
  • 101