Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jun 14, 2012 3:14 am 
Offline
Junior Member

Joined: Wed Jun 13, 2012 2:38 am
Posts: 27
I have a fully functioning domain (ubuntu 10.04) and I've set up a second domain following the exact same instructions (http://library.linode.com/hosting-website). They are both located in the public directory: /home/myusername/public/domainslivehere. And they each have the same file structure (backup, log, public).

The second domain returns an internal server error when checking it via IP (I've modified my local machine hosts file so that when I go to the second domain in my browser it should use the linode IP). Putting the IP address alone in the browser takes me to my first functioning site. I think I'm very close, but missing a step somehow. a2ensite says it's active. I'm sure the ownership is correct.

Any help would be greatly appreciated.


Top
   
PostPosted: Thu Jun 14, 2012 3:27 am 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
Just a guess based on no real configuration information provided....

You don't have your virtual hosts configurations setup correctly.

When using a virtual host like in the guide, you really can't use just an IP to use in the browser to go to one or the other since they are normally tied to the same IP.

You have to use the hostname you have defined in the configuration file and have those hostnames bound to the same IP.

Code:
<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@example.com
  ServerName  www.example.com   <===============
  ServerAlias example.com       <=============== If there is an alias

  DocumentRoot /home/example_user/public/example.com/public

  ErrorLog  /home/example_user/public/example.com/log/error.log
  CustomLog /home/example_user/public/example.com/log/access.log combined
</VirtualHost>


ServerName for each section needs to be the hostname you want for that virtual host. If it has an alias, you would have that as well. The example above shows that there is a www and non-www address

Document root would point to the location of where the web files are for that virtual host.

Logs would be for that virtual host.

You would have a VirtualHost section for each virtual host you want to host.

As for the error ... ???? you have not provided any clue as to what it said, what is in the logfiles etc... so it is hard to figure out what is going on.

_________________
Kevin a.k.a. Dweeber


Top
   
PostPosted: Thu Jun 14, 2012 4:16 am 
Offline
Junior Member

Joined: Wed Jun 13, 2012 2:38 am
Posts: 27
Thank you Dweeber!

Sorry about the lack of info. I'll spell it all out as much as I can.

My site.net /etc/apache2/sites-available/site.net (the one that works) looks like:


Quote:
# domain: site.net
# public: /home/myusername/public/site.net/

<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin lagi@site.net
ServerName http://www.site.net
ServerAlias site.net

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/myusername/public/site.net/public

# Log file locations
LogLevel warn
ErrorLog /home/myusername/public/site.net/log/error.log
CustomLog /home/myusername/public/site.net/log/access.log combined
</VirtualHost>



My site.org /etc/apache2/sites-available/site.org (the one that doesn't work) looks like:


Quote:
# domain: site2.org
# public: /home/myusername/public/site2.org/

<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin lagi@site2.org
ServerName http://www.site2.org
ServerAlias site2.org

# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /home/myusername/public/site2.org/public

# Log file locations
LogLevel warn
ErrorLog /home/myusername/public/site2.org/log/error.log
CustomLog /home/myusername/public/site2.org/log/access.log combined
</VirtualHost>


/etc/apache2/sites-enabled shows shortcuts to both domains.


error.log in site2.org shows:

Quote:
[Thu Jun 14 06:47:05 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration, referer: http://site2.org/
[Thu Jun 14 06:47:59 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration
[Thu Jun 14 07:10:45 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration
[Thu Jun 14 07:24:58 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration, referer: http://184.173.197.229/~lagi/site2.org/
[Thu Jun 14 07:24:59 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration, referer: http://184.173.197.229/~lagi/site2.org/
[Thu Jun 14 07:25:13 2012] [alert] [client 173.255.175.181] /home/myusername/public/site2.org/public/.htaccess: Invalid command 'Action', perhaps misspelled or defined by a module not included in the server configuration, referer: http://184.173.197.229/~lagi/site2.org/testing.html


Top
   
PostPosted: Thu Jun 14, 2012 4:19 am 
Offline
Junior Member

Joined: Wed Jun 13, 2012 2:38 am
Posts: 27
I realize that most of the errors are from when I was making stupid attempts to reach the second site via IP without modifying hosts file on local machine. My latest errors are not even showing up in the log. All I get after changing hosts file is Internal Server Error page, I think 404.


Top
   
PostPosted: Thu Jun 14, 2012 4:28 am 
Offline
Junior Member

Joined: Wed Jun 13, 2012 2:38 am
Posts: 27
it was .htaccess error! Sorry. I was being very dense.


Top
   
PostPosted: Thu Jun 14, 2012 4:32 am 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
This is wrong...

Code:
ServerName http://www.site1.org
ServerAlias site1.org

ServerName http://www.site2.org
ServerAlias site2.org


Your ServerName should be without the http:// part, just the hostname. so

Code:
ServerName www.site1.org
ServerAlias site1.org

ServerName www.site2.org
ServerAlias site2.org



Good you figured it out.

_________________
Kevin a.k.a. Dweeber


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group