LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 10-22-2014, 10:12 AM   #1
VolkHe
Member
 
Registered: Oct 2014
Posts: 33

Rep: Reputation: Disabled

Hello

I am running Cent OS and currently have 2 different domains setup correctly on 1 server(I set these up via cPanel years ago)

I wish to add a third but do not have a cPanel license, ideally I do not want to purchase one just to add another domain.

I located my httpd.conf file

/etc/httpd/conf/httpd.conf

I found two Virtual host blocks which apply to my other two working domains, so I copied one and edited it according to my new domain.

Quote:
<VirtualHost 11.11.11.11:80>
ServerName domain(dot)org
ServerAlias (www)domain(dot)org
DocumentRoot /home/sm/public_html
ServerAdmin webmaster[at]domain(dot)org
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/domain(dot)org combined
CustomLog /usr/local/apache/domlogs/domain(dot)org-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User sm # Needed for Cpanel::ApacheConf
UserDir enabled sm
<IfModule mod_suphp.c>
suPHP_UserGroup sm sm
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup sm sm
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid sm sm
</IfModule>
ScriptAlias /cgi-bin/ /home/sm/public_html/cgi-bin/

</VirtualHost>



I created a user sm and also a new directory /sm/public_html inside /home

I have applied the same nameservers as on my other domains, but when visiting my domain in firefox I get a generic "server not found" message.

I have checked permssions and group ownership are the same as the other domains.

drwxr-x--- 9 sm nobody 4096 (new non working domain user)
drwxr-x--- 15 d nobody 4096 (old working domain user 1)
drwxr-x--- 14 s nobody 4096 (old working domain user 2)



- I have waited 80+ hours for DNS settings to propagate
- I have restarted the server with service httpd restart
- Checked user sm exists within /etc/passwd - which it does along with my other 2 users for the other 2 domains.

When running httpd -S I get the following

Quote:
VirtualHost configuration:
11.11.11.11:80 is a NameVirtualHost
default server server2.1.org (/usr/local/apache/conf/httpd.conf:259)
port 80 namevhost server2.1.org (/usr/local/apache/conf/httpd.conf:259)
port 80 namevhost domain.org (/usr/local/apache/conf/httpd.conf:281)
port 80 namevhost 2.org (/usr/local/apache/conf/httpd.conf:314)
port 80 namevhost 1.org (/usr/local/apache/conf/httpd.conf:346)
port 80 namevhost server2.1.org (/usr/local/apache/conf/httpd.conf:383)
127.0.0.1:80 is a NameVirtualHost
default server server2.1.org (/usr/local/apache/conf/httpd.conf:383)
port 80 namevhost server2.1.org (/usr/local/apache/conf/httpd.conf:383)
wildcard NameVirtualHosts and _default_ servers:
*:443is a NameVirtualHost
default server 1.org (/usr/local/apache/conf/httpd.conf:434)
port 443 namevhost 1.org (/usr/local/apache/conf/httpd.conf:434)
*:* is a NameVirtualHost
default server server2.1.org (/usr/local/apache/conf/httpd.conf:271)
port * namevhost server2.1.org (/usr/local/apache/conf/httpd.conf:271)
port * namevhost server2.1.org (/usr/local/apache/conf/httpd.conf:383)
Syntax OK
Additionally in windows running nslookup (www)domain(org) returns

Quote:
*** Can't find server name for address 192.168.1.1: Non-existent dom
*** Default servers are not available
Server: UnKnown
Address: 192.168.1.1

*** UnKnown can't find (www)domain(org): Server failed

Last edited by unSpawn; 10-23-2014 at 10:16 AM. Reason: //Merged posts
 
Old 10-23-2014, 07:34 AM   #2
eamtrav
LQ Newbie
 
Registered: Apr 2011
Location: Germany
Distribution: OpenSUSE Debian CentOS
Posts: 6

Rep: Reputation: 0
Hello Volkswag (Foxtrot),
I thought we might be able to do more commenting over here. The NameVirtualHost configuration seems to be in order. The fact that the log files are empty & the message in the browser would indicate that the browser is not connecting with the server at all. Your DNS is not resolving. The namevhost will only answer if the browser connects with the configured name. So the web server is waiting for a http get request for the server www.domain.org. You can test the web server configuration simply by adding

11.11.11.11 www.domain.org

to your hosts file under c:\windows\system32\drivers\etc on Win7 (Mind you this hasn't changed since XP) on the browser box. After that reboot & try to connect per FireFox with http://www.domain.org

That way you can make sure that the web server is doing what it is supposed to do. (Check & see if it created any logs.) Maybe you could also post "ip a l" from the cent os box.
 
Old 10-23-2014, 11:15 AM   #3
VolkHe
Member
 
Registered: Oct 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eamtrav View Post
Hello Volkswag (Foxtrot),
I thought we might be able to do more commenting over here. The NameVirtualHost configuration seems to be in order. The fact that the log files are empty & the message in the browser would indicate that the browser is not connecting with the server at all. Your DNS is not resolving. The namevhost will only answer if the browser connects with the configured name. So the web server is waiting for a http get request for the server www.domain.org. You can test the web server configuration simply by adding

11.11.11.11 www.domain.org

to your hosts file under c:\windows\system32\drivers\etc on Win7 (Mind you this hasn't changed since XP) on the browser box. After that reboot & try to connect per FireFox with http://www.domain.org

That way you can make sure that the web server is doing what it is supposed to do. (Check & see if it created any logs.) Maybe you could also post "ip a l" from the cent os box.
Hi

I added what you said to my hosts file, I now receive the following message when going to my domain.org


Quote:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@domain.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
Does this mean its definatly a DNS error? And is this with my domain host or my web host?
Domain is hosted a name.com, server at worldstream.nl
 
Old 10-23-2014, 12:37 PM   #4
eamtrav
LQ Newbie
 
Registered: Apr 2011
Location: Germany
Distribution: OpenSUSE Debian CentOS
Posts: 6

Rep: Reputation: 0
Hi. What you have done by editing the hosts file is simply preempted the DNS lookup. Windows (or Linux) looks into the hosts file before making a DNS lookup. If it finds the address it's looking for, it uses this address & doesn't bother with DNS. The internal error means that the browser is now connecting with the server. You should find that the log files are no longer empty. What does this mean for you. Firstly, you need to look at the DNS configuration. It's not working. As soon as you remove the entry from the hosts file, the browser will not connect anymore. If I can help you with that, let me know. If you have support on the DNS, use it. Secondly, the web server configuration is not working. But now you have log files & we can try to sort that out. It's not the end of the world. If you need to sent me files that you don't wish to post, let me know & we can exchange mail addresses.
 
Old 10-24-2014, 06:35 AM   #5
VolkHe
Member
 
Registered: Oct 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eamtrav View Post
Hi. What you have done by editing the hosts file is simply preempted the DNS lookup. Windows (or Linux) looks into the hosts file before making a DNS lookup. If it finds the address it's looking for, it uses this address & doesn't bother with DNS. The internal error means that the browser is now connecting with the server. You should find that the log files are no longer empty. What does this mean for you. Firstly, you need to look at the DNS configuration. It's not working. As soon as you remove the entry from the hosts file, the browser will not connect anymore. If I can help you with that, let me know. If you have support on the DNS, use it. Secondly, the web server configuration is not working. But now you have log files & we can try to sort that out. It's not the end of the world. If you need to sent me files that you don't wish to post, let me know & we can exchange mail addresses.
Ok I understand now.

The main log shows - nano /usr/local/apache/domlogs/domain.org

Quote:
ip - - [23/Oct/2014:19:45:41 +0200] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0"
ip - - [23/Oct/2014:19:47:31 +0200] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0"
ip - - [24/Oct/2014:13:25:47 +0200] "GET /favicon.ico HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0"
ip - - [24/Oct/2014:13:25:48 +0200] "GET /favicon.ico HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0"
 
Old 10-24-2014, 07:11 AM   #6
eamtrav
LQ Newbie
 
Registered: Apr 2011
Location: Germany
Distribution: OpenSUSE Debian CentOS
Posts: 6

Rep: Reputation: 0
Then lets start by sorting out the DNS. Here's a mail address eamtrav(at)web.de. You can send me a description if the DNS environment. Use "httpd Virtual host - server offline for 4 days" as the subject of the mail & I will get it. I need to know what kind of DNS you are using, what kind access you have to the DNS & how you are configuring it. After that we can deal with the web server.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me with httpd virtual host set to mount to samba share folder. InfernalAngel Linux - Newbie 1 12-24-2010 05:45 AM
Is there anyway for one Virtual Server to access the main host, or another Virtual Se abefroman Linux - Security 5 01-08-2010 08:06 PM
do configurations in httpd.conf trickle down to the Virtual Host level fobster Linux - General 2 01-31-2008 12:53 PM
HTTPD Virtual Host limit forbidden error, how to increase? norbul Linux - Software 1 05-11-2006 05:59 AM
virtual host on httpd jkmartha Linux - Newbie 2 04-11-2005 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration