Link to home
Start Free TrialLog in
Avatar of Arachnidsweb
Arachnidsweb

asked on

Dns Issues with a Dedi server + CPanel

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.
ASKER CERTIFIED SOLUTION
Avatar of giltjr
giltjr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arachnidsweb
Arachnidsweb

ASKER

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.
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.
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>
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.
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..
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
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?
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.
Glad to see you got it solved.  Thanks for the points.