Forum Moderators: phranque

Message Too Old, No Replies

error establishing database connection

help with apache2 webserver

         

x3eemguy

9:18 pm on Dec 9, 2017 (gmt 0)

5+ Year Member



Hello everyone, I have recently setup an apache2 web server for my personal site but I can access the site when I enter my public ip. I get "error establishing database connection", but when i use local ip my site works fine. Any help would be appreciated. Here is some more info, it's a debian 9 stretch os, mariadb, php 7.0.19-1, apache2.

phranque

11:42 pm on Dec 9, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], x3eemguy!

have you checked the server access and error log files for clues?

x3eemguy

9:15 am on Dec 13, 2017 (gmt 0)

5+ Year Member



Hey, sorry for not replying earlier. As soon after I posted this thread I figured what was the problem. The fix: I had 2 virtual host, one was not fully setup so it showed error establishing database connection and the other was fully setup with server name as local ip, but I did not set the fully setup virtual host as default...newbies lol