WebFaction
Community site: login faq

I have a static/cgi/php app installed and have two "Websites" setup in the control panel each with a different domain name. At first I had a test index.html file sitting in htdocs and both domains would go to that test index.html fine. I now have .htacces (from html5 boilerplate) located at webapps/htdocs with two different folders at webapps/htdocs/site1 and webapps/htdocs/site2. For now each folder just has a different index.html file to see if this works. I then put a NameVirtualHost configuration in my .htacces like this:

Listen 80

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /site1
ServerName site1.com

</VirtualHost>

<VirtualHost *:80>
DocumentRoot /site2
ServerName site2.com

</VirtualHost>

I'm getting a 500 Internal Server Error. I know just enough to get things not to work. What am I doing wrong?

asked 10 Mar '11, 23:39

irose
111
accept rate: 0%


Hi,

You get the error because VirtualHost directive is not allowed in .htaccess. You are using a Static/CGI/PHP app which means even if you have two on the same server they would still be using the same Shared Apache server and would be nothing more then two different virtual hosts similiar to what you are trying to do here.

So, you can just setup two Symlink to Static/CGI/PHP apps that point to ~/webapps/htdocs/site1 and ~/webapps/htdocs/site2 respectively and make two new sites from the Control Panel for site1.com and site2.com.

Hope that helps!

permanent link

answered 10 Mar '11, 23:47

neeravk
1.5k3412
accept rate: 41%

I am now getting a 403 Forbidden error. Thoughts?

(11 Mar '11, 00:52) irose

Hi,

Did you remove the .htaccess changes that you made earlier? Also did you setup different sites using the panel for your domains?

If you still get the error after the steps above you should file a support ticket with us using https://help.webfaction.com so we can take a better look at the exact cause and suggest a better solution.

(11 Mar '11, 01:02) neeravk
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×33
×8

question asked: 10 Mar '11, 23:39

question was seen: 4,010 times

last updated: 11 Mar '11, 01:02

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM