phpmyadmin is not accessible after adding virtual host

607 views
Skip to first unread message

Tom

unread,
Sep 15, 2010, 8:26:33 AM9/15/10
to Phusion Passenger Discussions
Hi
My httpd.conf is

<VirtualHost *:80>
DocumentRoot /var/www/application/public
#RailsBaseURI /rails
RailsEnv development
Options FollowSymLinks
<Directory /var/www/application//public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>

Before adding this I could access http://localhost/phpmyadmin .
But after adding above lines what happens is it goes to rails
application and says and gives
The page you were looking for doesn't exist.

Please help to correctly configure this

Thanks
Tom

Radek Kotlarek

unread,
Sep 15, 2010, 8:33:58 AM9/15/10
to phusion-...@googlegroups.com


Hi Tom,

You need to have phpmyadmin virtualhost definition included in your httpd.conf file.
It is common to have all virtual hosts kept in /etc/httpd/conf.d, very likely your phpmyadmin directive is already there.
What is probably missing in your configuration file is NameVirtualHost *:80 before VirtualHost definition.

Regards,
Radek

Tom

unread,
Sep 16, 2010, 3:50:47 AM9/16/10
to Phusion Passenger Discussions
Hi
Thanks for your reply. Could you please explain more? Since I am a
beginner I did not understand how to include phpmyadmin virtualhost
definition . The above code I got from net and using by trial.

Thanks
Tom

Radek Kotlarek

unread,
Sep 16, 2010, 4:11:09 AM9/16/10
to phusion-...@googlegroups.com
Tom,

Add the following line before <VirtualHost *:80>:
NameVirtualHost *:80

Also add after <VirtualHost *:80>:
ServerName your.rails.domain

Reload server and test.


Regards,
Radek

Tom Mac

unread,
Sep 16, 2010, 7:33:22 AM9/16/10
to phusion-...@googlegroups.com
Hi

Sorry but that did not work. My /etc/hosts have entry (this I am doing in my localmachine)

127.0.0.1    localhost.localdomain localhost system1.example.com


My rails application is at  /var/www/application/

Now I did as you said in httpd.conf  It is now like

NameVirtualHost *:80

<VirtualHost *:80>
   ServerName system1.example.com
   DocumentRoot /var/www/application/public

   RailsEnv development
   Options FollowSymLinks
   <Directory /var/www/application//public>
     Allow from all
     Options -MultiViews
   </Directory>
</VirtualHost>

    And I did  service httpd start . Now I tried in browser

http://system1.example.com/phpmyadmin   OR
http://localhost/phpmyadmin
   
   What happens is it goes to rails application(Not phpmyadmin console)  and shows

The page you were looking for doesn't exist.

But if commentout all lines between (and including)  <VirtualHost *:80>....</VirtualHost>

And after restarting httpd service now if I try

http://system1.example.com/phpmyadmin     I get phpmyadmin login prompt





Radek Kotlarek

unread,
Sep 16, 2010, 9:11:59 AM9/16/10
to phusion-...@googlegroups.com

I experienced similar issue - after adding VirtualHost for my rails applications, I could not address my phpmyadmin through alias.

What I would suggest is to add another domain to your hosts file and create actual virtualhost definition for phpmyadmin. Depending on location of phpmyadmin on your system, it might look something like:

<VirtualHost *:80>
   ServerName phpmyadmin.example.com
   DocumentRoot /usr/share/phpMyAdmin
</VirtualHost>

Reload your Apache and then try to access phpmyadmin through phpmyadmin.example.com








--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.

Tom Mac

unread,
Sep 17, 2010, 12:00:30 AM9/17/10
to phusion-...@googlegroups.com
Hi
   Thanks a lot for your help. Now it works.

Ryan

unread,
Sep 17, 2010, 11:35:09 AM9/17/10
to Phusion Passenger Discussions
If you don't want to or can't have a dedicated vhost for phpMyAdmin
you can also add the following to a passenger vhost:

Alias /phpmyadmin /usr/share/phpmyadmin
<Location /phpmyadmin>
PassengerEnabled off
</Location>

That simply tells passenger not to serve requests to that location.

On Sep 16, 9:00 pm, Tom Mac <to.tom....@gmail.com> wrote:
> Hi
>    Thanks a lot for your help. Now it works.
>
>
>
> On Thu, Sep 16, 2010 at 6:41 PM, Radek Kotlarek <rked...@gmail.com> wrote:
>
> > I experienced similar issue - after adding VirtualHost for my rails
> > applications, I could not address my phpmyadmin through alias.
>
> > What I would suggest is to add another domain to your hosts file and create
> > actual virtualhost definition for phpmyadmin. Depending on location of
> > phpmyadmin on your system, it might look something like:
>
> > <VirtualHost *:80>
> >    ServerName phpmyadmin.example.com <http://system1.example.com/>
> >    DocumentRoot /usr/share/phpMyAdmin
> > </VirtualHost>
>
> > Reload your Apache and then try to access phpmyadmin through
> > phpmyadmin.example.com
>
> >> phusion-passen...@googlegroups.com<phusion-passenger%2Bunsubscr i...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/phusion-passenger?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Phusion Passenger Discussions" group.
> > To post to this group, send email to phusion-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > phusion-passen...@googlegroups.com<phusion-passenger%2Bunsubscr i...@googlegroups.com>
> > .

matt connolly

unread,
Sep 19, 2010, 3:39:28 AM9/19/10
to Phusion Passenger Discussions
I just figured out how to do it without using virtual hosts. Among
other things having to edit the /etc/hosts file on every machine
(which has one) is annoying...

http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/

Basically, set "PassengerEnabled Off" by default, enable it for the
<Directory> where you want it (<Location> doesn't work), and use
symlinks with the RailsBaseURI method.

-Matt

Ryan

unread,
Sep 19, 2010, 3:35:54 PM9/19/10
to Phusion Passenger Discussions
FWIW, I've got Location working in production and the Passenger docs
say the PassengerEnabled directive can appear in either a Location or
Directory block.

On Sep 19, 3:39 am, matt connolly <matt.connolly...@gmail.com> wrote:
> I just figured out how to do it without using virtual hosts. Among
> other things having to edit the /etc/hosts file on every machine
> (which has one) is annoying...
>
> http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-wi...
Reply all
Reply to author
Forward
0 new messages