New install DA > Apache is working normally when accessing the site

siniztr

Verified User
Joined
Dec 17, 2016
Messages
27
Location
Netherlands
I have a fresh install of DA on CentOS7 (also tried on Ubuntu18.04). It is currently behind a router on NAT, but DA sees the external IP fine, and all required ports (except SSH) is open on the router. When I visit the website set up, I get an Apache is working normally. I have googled and searched these forums for a while, trying many provided solutions to no avail. Some of the given solutions actually caused my apache to crash on Ubuntu, which is why I now reinstalled on CentOS.

It is a clean install, Solo license until I get everything working, no changes made (extra modules, php, etc all standard). Any idea's?
I have already tried rebuilding the conf's,
I have already tried https://docs.directadmin.com/operat...lly-adding-an-additional-ip-to-network-device
 
Check your DNS settings, if you made new changes in there please wait for the propagation of your DNS server
Are you using your own DNS settings or from your provider ?
 
The test domain that I put over is using the DNS and nameservers of the server. The hostname that the server is on is using external DNS, as that domain will not be hosted on the server.

Aside from that, it has been 2 days since making the change, the website still gives an Apache is working normally screen when I visit the site.
 
The hostname that the server is on is using external DNS, as that domain will not be hosted on the server.
In that case you will only be able to reach the hostname on the server, no domains.

For domains to be reachable, you have to either use your own nameservers (in which case you need nameserver records with the registrar) or by using external nameservers.
In the latter case only pointing to your hostname is of no use for reaching your domain.
You have to create the required DNS records for your domain to be able to reach it. So at least an A record for domain.com (where domain.com is your domain). And wise would be to also add a www.domain.com record.

If you really are running your own DNS and nameservers on your DA server, did you setup these nameservers at the registrar?

If I'm confusing or mixing up things, try giving some examples of what you're doing.
Use names like domain.com or example.com if you don't want to use real test domain. However if you give the real test domain, we probably can help better because then we can lookup things.
 
Domain a is my business website. So I have ns2.domain.com and ns2.domain.net (for now, both of these are pointing to the same IP address, which is the DirectAdmin server. These two ns2 domains are set up on a different registrar.

Domain B is the domain I then moved to the server. The nameservers for this domain point to ns2.domain.com and ns2.domain.net. The DNS for this domain are then set up on the DirectAdmin server.

Up to now, all of this works. When I do a WHOIS, I get the right nameservers. When I do a [dig domain B] I get the correct IP address. However, when I go to the website or a subdomain on the website (both point to this server), I simply get an Apache is working correctly page.

I have set up hosting panels in the past. DirectAdmin, VestaCP (a few of them), and had all of them working. VestaCP I even got working on the same network I am now as a demo for a client. So it is not like I don't know what I am doing. I just can't seem to get the apache config to work that it shows the site. I tested domain b, www domain b and subdomain.domain b. All of them get the same thing.

At first I thought it might be something with SSL, maybe the symlink from private_html to public_html wasn't working. So I turned off the force redirect and tested with http:// no luck.
 
So it is not like I don't know what I am doing.
No problem. I wasn't implying that either. But since you're here with 8 posts, stating an issue and we can't guess what your knowledge is.
So I gave an answer which is understandable for everybody.
But it's good to see you're more experienced, makes things easier. However more info was needed anyway to get an insight in what can be wrong.

I presume you're just using apache, no nginx and have used lowercase characters everywhere.
I also presume you tested with other browsers?

Let's give domain B the name example.com that works easier.

So you have example.com present. And if you lookup from other systems with nslookup example.com do you get the correct ip too?

Do you have example.com present in:
1.) /etc/virtual
2.) /etc/virtual/domains
3.) /etc/virtual/domainowners
4.) check /etc/httpd/conf/extra/directadmin-vhosts.conf if it contains a line like this:
Include /usr/local/directadmin/data/users/someuser/httpd.conf

If all this is yes, it seems apache is not translating the ip to the website somehow. I've seen something like that before on a NAT system and in that case it had something to do with ip's used for apache if i'm not mistaken, but to be honest, I'm not sure.

Running behind NAT is something I didn't work with yet, so if the above does not show I don't know but maybe it has to do something with the /etc/httpd/conf/ips.conf file. Don't know for sure if local or external ip's need to be in there on a LAN.

In that case I will just follow the thread because somebody else might help you who has experience with this.
 
Do you have example.com present in:
1.) /etc/virtual
2.) /etc/virtual/domains
3.) /etc/virtual/domainowners
4.) check /etc/httpd/conf/extra/directadmin-vhosts.conf if it contains a line like this:
Include /usr/local/directadmin/data/users/someuser/httpd.conf
  1. Yes
  2. No
  3. No
  4. Yes
The ips.conf file also contained the correct public IP. But as I am running out of time, I was able to secure a VPS, and have since moved the server there. Thank you Richard and Active8 for trying. Very much appreciate the effort. Sadly time is against me.
 
Sadly time was against you, because 2 and 3 was causing the issue. The domain should have been in there. But little use to investigate now.

Anyway, good to read that you have a VPS now, which makes live a bit easier with these things.
As for trying to help, you're welcome ofcourse!
 
Seems that I still need your assistance Richard. On the VPS (alma linux 8), same issue. 2 and 3 are empty. I did find a script to run to supposedly fix it, but when I run it, the folders are still empty. ips.conf only had IPv6 address, so I copied both sets (1 for port 80 and 1 for port 443) and changed the IP to the IPv4 address. Restarted DirectAdmin and HTTPD and still gives same Apache message.

I have run the scripts as described in this link: https://docs.directadmin.com/direct...uild-etc-virtual-domains-file-if-it-s-missing (both the ones for /etc/virtual/domains and /etc/virtual/domainowners but both folders remain empty.
 
The strange thing is, when I first added the domain to the VPS and visited the site, both the domain and subdomain were showing the DirectAdmin default index.html file. I have since uploaded the websites via FTP and when I tested, I get warning of incorrect SSL certificate (from the server itself, and not of the website) and then the same "Apache is functioning normally" message.
 
OK Update. The script to fix domainowners now attempts to fix correctly, however because the /etc/virtual/domains is empty it gives an error.
 
Thanks for the updates. However, be aware of the fact that I help a lot on the forums, but I'm not a guru. ;)

It still wonders me, why on a fresh installation, these things go wrong and you then need the script to fix things again.
Normally, you create a user. When creating the user, the /etc/virtual files are automatically filled. So if nameservers and DNS are correct, everything should point to the correct index.html file provided by DA.

From post #10 you stated everything was fine until you uploaded the website via FTP and then you got an incorrect SSL certificate warning from the server.
This might be caused by the server being on another ip on the LAN first, I'm not sure, because I don't know what happened, what's your install procedure etc. I hope there is no .htaccess file which on some odd way redirects to the old LAN server.

1.) Did you create a new certificate for your hostname?
2.) What kind of license do you have?
because I've never encountered it that a /etc/virtual/domains file keeps empty or this keeps happening.

Also I don't understand why the ipv6 is in there, unless you got ipv6 from the server.
If you don't want to use ipv6, you can better disable all ipv6 on the vps and also disable it in Directadmin:
ipv6=0

The ips.conf should also contain the ipv4 addresses.
3.) Can you check the content of both:
/usr/local/directadmin/data/admin/ip.list
and
/usr/local/directadmin/data/admin/ips/
if all ip's present on the server, are also in there.

Seems so odd to me that you might need to send in a ticket or maybe @Zhenyapan has some idea on what's going on here?
 
sometimes in the past - there was problems with fresh install and non valid hostname, DA installs was failed at middle or finished but almost all was broken. In such case for me helped to reinstall OS totally and set correct hostname. My experience told me that if something was broken and fixed - then it will broke again and again (or already broken but I didn't see it yet), so better to reinstall and receive new fully working instance.
 
This might be caused by the server being on another ip on the LAN first, I'm not sure, because I don't know what happened, what's your install procedure etc. I hope there is no .htaccess file which on some odd way redirects to the old LAN server.
The website used to sit on a shared DA platform, I downloaded it via FTP and uploaded it to the VPS. .htaccess is a standard Wordpress .htaccess that does contain some blocked IP addresses placed by security plugin.

sometimes in the past - there was problems with fresh install and non valid hostname, DA installs was failed at middle or finished but almost all was broken. In such case for me helped to reinstall OS totally and set correct hostname. My experience told me that if something was broken and fixed - then it will broke again and again (or already broken but I didn't see it yet), so better to reinstall and receive new fully working instance.
In this case it is a clean install, and I did have this issue when I was trying to install the server at first on a server in my office. So my install procedure is

DA_HOSTNAME={{hostname}} DA_EMAIL={{email}} DA_NS1={{nameserver1}} DA_NS2={{nameserver2}} ./setup.sh LICENSE_KEY

Of course, the words in brackets are filled with actual data and no brackets.
 
Also I don't understand why the ipv6 is in there, unless you got ipv6 from the server.
Yes the VPS came with IPv6, which I do use. IPv6 is pretty much dominant in the EU, or at least in the Netherlands, right now. So having IPv6 is beneficial.

3.) Can you check the content of both:
/usr/local/directadmin/data/admin/ip.list
and
/usr/local/directadmin/data/admin/ips/
Yep, both IPv4 and IPv6 are there.
 
yes, or ISO (for example ubuntu 20.04.1 has old installer and works with all my hardware, and 20.04.3 dont want to work with some brands of NVME drives) so better to install on little older kernel then upgrade. Or at DA cabinet was selected wrong license OS/kernel.
 
Sorry, forgot to mention, I have a Solo license for now, as I am currently only moving my own websites to the server. Once I am done these, and the reseller package for my customers is up for renewal I will start moving my customers over, and will then upgrade from Solo to bigger license.

In answer to Zhenyapan, The server didn't come with DirectAdmin on it. I got a clean AlmaLinux 8 server and installed DirectAdmin from install script provided by DirectAdmin.

You didn't answer question 1 and 2 yet. ;)
Totally right. I just had to do some extra work for my job, so my brain is a little fizzled.
  1. Dashboard right now doesn't have a certificate, but port 2222 is only accessible from my IP address so not vital until I can work out these bugs.
  2. Just mentioned, a Solo license. So only 1 user. Seems I can't create a separate user with this license, so trying to set everything up under Admin user. But since they are all personal websites I am moving on for now, this won't matter. Would have preferred using different account, as I don't like using Admin for anything other than actual server related tasks. But limited due to license.
 
Back
Top