Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Sep 14, 2011 11:34 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Hi guys, if i enter http://mysite.com it shows:
Code:
It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.


If i enter www.mysite.com is fine, how to make the http://mysite.com work?

Thanks for any help.
* Maybe is a .htacces thing....


Top
   
 Post subject:
PostPosted: Wed Sep 14, 2011 12:24 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Assuming you're using Apache, what does your /etc/apache2/sites-available/000-default look like? Or, better yet, post the contents of all linked files inside /etc/apache2/sites-enabled (feel free to "censor out" your actual domain name and server paths, but make sure you keep the subdomain part of any domain names, such as "www", intact).

If I had to guess (without seeing what the actual config files look like), I'd say that ServerName and ServerAlias in the config file corresponding to your domain name only has one of these.


Top
   
 Post subject:
PostPosted: Wed Sep 14, 2011 12:42 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Inside /etc/apache2/sites-available/mysite

I see

Code:
ServerName mysite.com
ServerAlias www.mysite.com


Is that what you were guessing?
Thanks Neon


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 5:25 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Are there links to any other files in /etc/apache2/sites-enabled? If so, what do they contain?


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 5:30 am 
Offline
Newbie

Joined: Thu Sep 15, 2011 5:27 am
Posts: 2
Grevan,

You might consider adjusting ServerAlias www.mysite.com to show ServerAlias www.mysite.com mysite.com

Ensure you have a DNS entry setup for mysite.com.

Remember to reload Apache when you're done.


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 6:24 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Mercer wrote:
Grevan,

You might consider adjusting ServerAlias www.mysite.com to show ServerAlias www.mysite.com mysite.com

Ensure you have a DNS entry setup for mysite.com.

Remember to reload Apache when you're done.

You don't need to put the domain into ServerAlias when it's already in ServerName. And there is a DNS entry for mysite.com, since it does display a website (although from a different directory).

On that note, Grevan, please ensure that mysite.com is pointing to the same IP address as www.mysite.com.


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 11:00 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
1- /etc/apache2/sites-enabled
000-default
mysite.com
mysite2.com
mysite3.com

Neon, how do i ensure that mysite.com is pointing to the same IP address as www.mysite.com?


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 12:07 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Just open up a command prompt window and use the command nslookup (Windows) or host (Linux), followed by the hostname, once with the www, and once without it. Then, compare the results. If you're getting the same IP address for both lookups, you don't have to do anything.


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 12:48 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Yes, it´s getting the same IPs, but i got this message too for mysite.com:

Code:
mysite.com mail is handled by 10 mail.mysite.com


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 1:05 pm 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Not to worry, that response is normal (since the host command also checks for MX records as well as A/CNAME).

What does the 000-default file look like? Is there a reference to your domain name in any ServerName or ServerAlias directives there?

And going back to the original mysite.com file; please do double-check the spelling of your domain name in both ServerName and ServerAlias, just to be sure.


Top
   
 Post subject:
PostPosted: Thu Sep 15, 2011 2:58 pm 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
1- The 000-default file in /etc/apache2/sites-enabled:
Quote:
<VirtualHost xxxxxxxxxxx:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>


There are no ServerName or ServerAlias there.

2- I double checked the names and their are fine


Top
   
 Post subject:
PostPosted: Fri Sep 16, 2011 8:34 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
Try running apachectl -S and see what it comes up with. It should show a list of virtual hosts (without aliases).


Top
   
 Post subject:
PostPosted: Fri Sep 16, 2011 9:24 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
Neom, the command apachectl -s is not found.
Do i have to go to a certain directory to call it?


Top
   
 Post subject:
PostPosted: Fri Sep 16, 2011 10:15 am 
Offline
Senior Member
User avatar

Joined: Tue Jan 04, 2005 7:32 am
Posts: 277
Website: http://www.betadome.com/
Location: Ålesund, Norway
Skype: neonnero
Twitter: neonnero
It's usually located at /usr/sbin/apachectl, and you don't have to be in any specific directory to call it (but the /usr/sbin location would in $PATH for the root user).

Also, keep in mind that the parameter for the apachectl is an uppercase S (not lowercase).


Top
   
 Post subject:
PostPosted: Fri Sep 16, 2011 10:55 am 
Offline
Senior Member

Joined: Fri Feb 11, 2011 1:36 pm
Posts: 118
apachectl, the command is still not found, mmm


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


Who is online

Users browsing this forum: No registered users and 2 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