Solved

Dns Issues with a Dedi server + CPanel

Posted on 2007-03-17
10
452 Views
Last Modified: 2013-12-25
Greetings, this is going to take a bit of time to brief you on, I will try to be as clear as I can.

I host a Dedicated server in a server farm, it has no support other than me, etc.
It is sitting behind a Cisco Pix firewall, which blocks ports, etc, translates the public ips to internal.
ips:
1.2.3.4 > 10.0.0.1
2.3.4.5 > 10.0.0.2
3.4.5.6 > 10.0.0.3

The server is running Fedora Core 4, with the latest release of CPanel.

The main domain (we wil say blahblah.com) is its own dns server, so the host name of the server is the same as the domain, and the registrar points to the ip of the server for ns1 and ns2.blahblah.com
Any domains hosted on the server point to ns1 and ns2.blahblah.com
The ips for the name servers are:
ns1.blahblah.com = 1.2.3.4
ns2.blahblah.com = 1.2.3.4

now all of the domains are currently pointing to the cpanel default page, regardless of the content uploaded.

for example, www.blarg.com points to ns1.blahblah.com and ns2.blahblah.com

this is the dns entry for blag.com:

; cPanel 10.9.0-RELEASE_139
; Zone file for blarg.com
$TTL 14400
@ 86400 IN SOA ns1.blahblah.com. cha0tic.****.gmail.com. ( 2007031600 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds

blarg.com. 86400 IN NS ns1.blahblah.com.
blarg.com. 86400 IN NS ns2.blahblah.com.


blarg.com. IN A 1.2.3.4

localhost.blarg.com. IN A 127.0.0.1

blarg.com. IN MX 0 blarg.com.

mail IN CNAME blarg.com.
www IN CNAME blarg.com.
ftp IN A 1.2.3.4

----------------------------
the dns is working because I can ftp to the domain and ping it, so i know its pointing to the right ip, but I can not figure out why it wont pull up any uploaded content.

I uploaded a basic index.html file to the public_html folder for blarg.com

here is the httpd.conf seciton for blarg.com:


<VirtualHost 1.2.3.4>
ServerAlias blarg.com
ServerAdmin webmaster@blarg.com
DocumentRoot /home/blarg/public_html
BytesLog domlogs/blarg.com-bytes_log
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/blarg/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/blarg/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
ServerName www.blarg.com

User blarg
Group blarg
CustomLog /usr/local/apache/domlogs/blarg.com combined
ScriptAlias /cgi-bin/ /home/blarg/public_html/cgi-bin/
</VirtualHost>

--------------------



Any help would be greatly appreciated, I am desperate to get it back up and running since it is the replacement to an old server that had plesk on it, which I abhor due to all the bugs and poor support.

Thanks again.
0
Comment
Question by:Arachnidsweb
  • 5
  • 5
10 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 18741931
Although it may not matter that much I would suggest coding a "ServerName", say of www.blarg.com in the Virtual Host defintion.

Now to make sure I understand.

If I enter http://blarg.com  I get the cpanel page.  If I enter http://blarg.com/ijustuploaded.html  I still get the cpanel page?

Do you have any re-write rules?

Are the files actually getting uploaded to /home/blarg/public_html?

Do they have the correct permissions so that Apache can read them?
0
 

Author Comment

by:Arachnidsweb
ID: 18741939
if you go to www.blarg.com, you get the cpanel page
i fyou go to blarg.com, you get the cpanel page
if you go to blarg.com/index.html you get the cpanel page
if you go to blarg.com/index.HTM you get page not found.

The files were verified as uploaded via shell connection.

to see for your self, one of the domains is twilightofchaos.com

did not want to give out the ips and domains, but at this point im not worried since I need to get this fixed heh..

as far as the permissions go, I would asume the default permissions when uploading them would work since it is the index.html.

also I checked the index.html file in the public_html folder via shell, and it was the correct file, not the default page.

what cpanel people suggested was that the domains are simply pointing to the ip itself and not to the actual domain name, which is causing the default page to come up.
0
 

Author Comment

by:Arachnidsweb
ID: 18741947
also: there is a Cisco pix firewall between the server and the internet
but at the moment all it is doing is forwarding information he receives
basically it takes anything coming to 1.2.3.4 and shunts it to 10.0.0.1
and vice versa.


but it was this way on my other server which ran plesk, and it worked without an issue.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18742116
First you need to verify your Apache setup.  When I tried index.HTM not only did it generate a 404 error, it stated that it got another 404 error trying to follow your ErrorDocument.

O.K. the IP address you have on the virtual host definition is wrong.  It needs to be the IP address that exists on your server.

So if Public 1.2.3.4 is NAT'ed to 10.0.0.1, you need to change:

     <VirtualHost 1.2.3.4>

to

     <VirtualHost 10.0.0.1>

Just to make sure you have a virtual host defintion that looks like (after you make the address change):

<VirtualHost 10.0.0.1>
ServerAlias twilightofchaos.com
ServerAdmin webmaster@twilightofchaos.com
DocumentRoot /home/twilightofchaos/public_html
BytesLog domlogs/twilightofchaos.com-bytes_log
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/blarg/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/blarg/:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
ServerName www.blarg.com

User twilightofchaos
Group twilightofchaos.com
CustomLog /usr/local/apache/domlogs/twilightofchaos.com combined
ScriptAlias /cgi-bin/ /home/twilightofchaos/public_html/cgi-bin/
</VirtualHost>
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18742123
I would also suggest adding:

     ServerName www.twilightofchaos.com

just before the ServerAlias statement.  With this, if somebody enters www.twilighofchaos.com, it will go to the default virtualhost (which is the first virtualhost in the config file).  Which I think is what is going on now, because your Apache box does not have address 1.2.3.4 on it.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Arachnidsweb
ID: 18742236
This is what my Host said:

Thank you for taking time to contact Online Support. It appears that the DNS is not properly set for the domains, as they are still pointing to the external IP address. You will need to point them to the internal IP address that the external IP address resolves to in the PIX hardware firewall configuration. Once this is accomplished, all of your domains will point to the hosted files, rather than the cPanel default page.

So I went into the dns entry and changed the A dns entry for twilightofchaos.com to point to 10.0.0.1, now the domain resolves to 10.x.....!

*mutters and needs to find a dns for dummies book* :(

What I'm trying to do is see if there is a way to fix this though cpanel, mainly because thats how it was setup..
0
 

Author Comment

by:Arachnidsweb
ID: 18742297
okay I changed the virtualhost from the ip to 10.0.0.1, restarted the httpd service, and still wont work, but this time i get nothing, not even the cpanel default page
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18743180
Ah,  you have made progress, I think.  To me that indicates that there are no files in

     DocumentRoot /home/twilightofchaos/public_html

or that the permissions of the files are such that Apache can't read them.  What messages do you have in the access and error logs?
0
 

Author Comment

by:Arachnidsweb
ID: 18746783
solved -- it appears cpanel is not compatible with a NAT firewall, removed the firewall and it started working without a hitch, after speaking with cpanel techs, they indicated that cpanel is not designed to run behind a NAT

so im going to have to setup iptables n such.. ah well, thanks again for the help everyone, points have been allocated.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18753529
Glad to see you got it solved.  Thanks for the points.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now