Author |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Wed 14 Apr '10 16:25 Post subject: mysql database drupal apache reverse proxy problem |
|
|
I installed apache2 and mysql database on a Debian system.
It is using reverse proxy on apache to redirect requests to apache2 running on any machine which is on Xen server as a Virtual host.
I tried to install Drupal on it. Every thing went fine till
I pointed my browser to
http://IP[/url] of LAN where Drupal was installed/drupal
then I see an installation page of Drupal which welcomes me
I click install in English
then it can not proceed to connect with database.
Code: |
Database configuration
Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports.
|
I have created a database and username for Drupal separately.
What should I check to.
There is one more error
Code: |
http://Public IP/some location/
|
Is showing me contents of Document Root
but there is a folder named drupal on it.
When I click on it I get error.
Code: |
Not Found
The requested URL /drupal/ was not found on this server.
Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch proxy_html/3.0.0 Server at
|
What things should I check in for?
I am also getting errors like
Code: |
Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
|
on individual DomU's what should I check in.
and on Dom0 when restarting apache2 I get following error.
Code: |
Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Wed Apr 14 15:23:05 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
|
~
~ |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 15 Apr '10 13:41 Post subject: |
|
|
Quote: |
and on Dom0 when restarting apache2 I get following error.
|
On Dom0 in httpd.conf or apach2.conf depends on your linux add also in the DomUs
Code: |
ServerName yourdomain.tld
|
Quote: |
I have created a database and username for Drupal separately.
|
Which IP do you try in the drupal setup? Is there mysql running on every DomU?
Quote: |
There is one more error
Code: |
http://Public IP/some location/
|
Is showing me contents of Document Root
but there is a folder named drupal on it.
When I click on it I get error.
|
What is in your error log about that? |
|
Back to top |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Thu 15 Apr '10 13:54 Post subject: |
|
|
Well bond I am glad that you are here .
Any how errors are no more Mysql was installed on all DomU's
The problem was php5-mysql package was missing because of which all errors were coming.
Thanks for your reply.
I have a small doubt
Dom0 is like
www.myserver.com
and DomUs are
www.myserver.com/domu1
www.myserver.com/domu2
www.myserver.com/domu3
www.myserver.com/domu4
Now servername directive in apache2.conf how should it look like
on Dom0 and DomU's since I also use reverse proxy on Apache
Here is how apache2.conf is on Dom0
Code: |
NameVirtualHost *
<VirtualHost *>
ServerName myserver.lan.org
DocumentRoot /var/www
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /domu1 http://192.168.0.11/
ProxyPass /domu2 http://192.168.0.12/
ProxyPass /domu3 http://192.168.0.13/
ProxyPass /domu4 http://192.168.0.14/
ProxyPassReverse /domu1 http://192.168.0.11/
ProxyPassReverse /domu2 http://192.168.0.12/
ProxyPassReverse /domu3 http://192.168.0.13/
ProxyPassReverse /domu4 http://192.168.0.14/
</VirtualHost>
|
When ever I do a restart of apache2 on Dom0 I get following error
Code: |
Thu Apr 15 11:19:52 2010] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Apr 15 11:19:52 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Apr 15 11:19:52 2010] [notice] Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch proxy_html/3.0.0 configured -- resuming normal operations
|
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Thu 15 Apr '10 21:48 Post subject: |
|
|
Somewhere in the includes or in the apache2.conf there must be
Code: |
NameVirtualHost *:80
|
You can comment that out. And you have to define a server name outside the vhost container. I recommend to specify a port on your vhost, but that is just my 2 cents.
So if I where you I'd change the config to
Code: |
ServerName localhost
NameVirtualHost *:80
<VirtualHost *:80>
ServerName myserver.lan.org
DocumentRoot /var/www
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /domu1 http://192.168.0.11/
ProxyPass /domu2 http://192.168.0.12/
ProxyPass /domu3 http://192.168.0.13/
ProxyPass /domu4 http://192.168.0.14/
ProxyPassReverse /domu1 http://192.168.0.11/
ProxyPassReverse /domu2 http://192.168.0.12/
ProxyPassReverse /domu3 http://192.168.0.13/
ProxyPassReverse /domu4 http://192.168.0.14/
</VirtualHost>
|
the :80 if apache is running on port 80 else put your port there.
Before using graceful to reload the server config you might use -S to check the syntax e.g. sudo apache2ctl -S |
|
Back to top |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Thu 15 Apr '10 22:36 Post subject: |
|
|
James Blond wrote: |
Code: |
NameVirtualHost *:80
|
You can comment that out. And you have to define a server name outside the vhost container. I recommend to specify a port on your vhost, but that is just my 2 cents.
|
Done
James Blond wrote: |
So if I where you I'd change the config to
ServerName localhost
NameVirtualHost *:80
|
Initially i got a message like this on restarting but at this point
I had not commented NameVirtualHost just put that servername in apache2.conf
Code: |
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Thu Apr 15 22:00:18 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
|
But when I commented that NameVirtualHost it went and had also mentioned servername in apache2.conf there was no error or warning on restarting it.
So the problem is solved.
But can you point me out to any reason as why did this happened.
Now |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 16 Apr '10 10:13 Post subject: |
|
|
You defined NameVirtualHost * for your vhost and so I think, there is / was also a NameVirtualHost *:80. Apache looks if that vhost is used, but it wasn't, cause your vhost container started with <VirtualHost *>.
My english is not the best So you might also the manual
http://httpd.apache.org/docs/2.2/vhosts/name-based.html
and
http://httpd.apache.org/docs/2.2/vhosts/
The thing with the server name is that apache looks for a server name before checking the vhosts.
(anyone may correct me if I'm wrong with this) |
|
Back to top |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Fri 16 Apr '10 19:38 Post subject: |
|
|
Well thanks for these links.
Just out of curiosity want to know I am having some error while accessing
the site which is hosted on internal IP |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 17 Apr '10 11:05 Post subject: |
|
|
Which error do you get? |
|
Back to top |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Sat 17 Apr '10 14:58 Post subject: |
|
|
This is related to you installation from drupal not apache related. You have to configure the drupal url in the different setups. |
|
Back to top |
|
velocity
Joined: 14 Apr 2010 Posts: 21
|
Posted: Sat 17 Apr '10 19:23 Post subject: |
|
|
Hi yes you are right.Even then now I am posting a solution since by now I have solved the problem.
http://swik.net/MySQL/Planet+MySQL/Operating+a+Drupal+Site+behind+a+Reverse+Proxy+Server+(Apache)/dcslr
I am posting so that if some one else faces the same problem they may get a solution.Which is mentioned on the above link you can go there directly and read it.
Code: |
When you install drupal on a server which is behind apache reverse proxy you need to tell that drupal installation about the presence of reverse proxy in your nework.
That is the core of the problem.
To achieve this you need to do do following
in your drupal installation folder go to sites/default/settings.php
and change the following
$base_url="http://www.mydomain.com/;
then
$cookie_domain = 'proxyserver.yourdomain.com';
if above both are same then place them same values
then
uncomment
$conf = array(
then
uncomment
'reverse_proxy' => TRUE,
then
'reverse_proxy_addresses' => array('192.168.0.1',),
replace it by IP of your apache reverse proxy
and uncomment below it
);
|
Hopefully it should work.
Keywords to search for this are if you are using drupal
"drupal behind apache reverse proxy" |
|
Back to top |
|