LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   error when setting up multiple domains (https://www.linuxquestions.org/questions/linux-server-73/error-when-setting-up-multiple-domains-4175443776/)

said76 01-02-2013 03:09 AM

error when setting up multiple domains
 
Hi,

I am currently managing my own website e.g. www.example.com which is working fine and now would like to host another domain (e.g. www.someotherexample.com) on the same machine running Ubuntu Server 12.04 LTS.

I looked this up via google search and found that I need something like name-based virtual hosts.

So I made some changes in my apache2 httpd.conf by adding the following:
<snip>
...
Listen 80
...
<snip>

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "/usr/local/apache2/htdocs"
ServerName www.example.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/usr/local/apache2/htdocs/myothersite/otherexample"
ServerName www.someotherexample.com
</VirtualHost>

Then, saved it and restart my apache2.

I got the following error message when trying to open the page http://www.someotherexample.com

Forbidden
You don't have permission to access / on this server

I have checked the file permission of the directory myothersite and they are apache:nogroup

I'm at a loss - I don't know what to do.

Any help would be greatly appreciated.

Thank you

bathory 01-02-2013 06:50 AM

Hi,

In ubuntu/debian the vhosts in apache are defined using files under /etc/apache2/sites-available/
Have a look here to see how it's bone

egards

said76 01-02-2013 06:16 PM

It works. thank you for the link, bathory.

Well done

fsshl 01-27-2013 07:57 PM

in that link, there is a video
http://youtu.be/QaZBly7_0zo
in that video, Mr. wilson, say, test1.com, test2.com, for me it apparently not real domain name
so if I have realdomain1.com, realdomain2.com /* already registered these two domains and they point to my same public ip */
should I modify somewhere in linux file (like etc/host(...) and/or anything else)? to make my realdomain1.com and realdomain2.com be seen
in world wide web?
thanks any experts' advice/help in advance


All times are GMT -5. The time now is 03:12 PM.