0

I have a Raspberry Pi 2 B , Its running a LAMP package setup with Rasbains Jessie . i have looked at trying to host 2 domain names under one IP address but i have no clue where to start.

I have tried to edit the sites-enabled.conf and added a virtual host for each domain name i want to have , i then ran a2ensite Domain1.com.conf & a2ensite Domain2.com.conf then sudo service apache2 restartin terminal and forwarded both domain names to my IP address but they both root to the original website folder.

can anyone either give me a good tutorial to follow or explain how to setup 2 Domain names to one apache2 server with different content?

thanks :)

1

Start here:

https://httpd.apache.org/docs/2.4/vhosts/examples.html

vhosts is likely what you want because Patricks answer (running 2 services) requires more RAM which is limited on the raspberrypi.

0

This question on ServerFault seems to tackle this problem.

You will need to edit /etc/apache2. But the full explanation is in the aforementioned link.

0

@user1133275 has the right idea. Note that you will be editing /etc/apache2.conf to include the correct vhost setup as laid out in the docs, as well as creating a properly configured file at /etc/apache2/sites-available/domain.tld. Once that is done, you can run a2ensite, selecting the recently created domain.tld file, and running 'sudo service apache2 reload'. You should then be running two hosts on one machine from one IP (if desired / set up as such)!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.