#1  
Old 4th March 2008, 23:32
rick z rick z is offline
Junior Member
 
Join Date: Nov 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default ssl on phpmyadmin

Hi

I have install ubuntu 7.10 server version and install phpmyadmin using "apt-get install phpmyadmin" How could I get it to force redirect using https instead http? I look on the phpmyadmin website, but I didn't see the phpmyadmin file(s) under /var/www. I think on the ubuntu install it is on other directory.

On all my other site under /var/www/mysite I could manully type https://mysite/ without any error.

Please help...

Thanks.
Rickz
Reply With Quote
Sponsored Links
  #2  
Old 5th March 2008, 16:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

What's the output of
Code:
ls -la /var/www
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 6th March 2008, 01:45
rick z rick z is offline
Junior Member
 
Join Date: Nov 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the results. I am wondering if the install "phpmyadimin on ubuntu" is directed to some other place. What command can I use to find out what's been symbolic link to /var/www ?

root@test:~# ls -la /var/www
total 32
drwxr-xr-x 7 root root 4096 2008-03-03 00:17 .
drwxr-xr-x 15 root root 4096 2008-02-14 00:32 ..
drwxr-xr-x 2 root root 4096 2008-02-20 00:10 apache2-default
drwxr-xr-x 2 root root 4096 2008-03-03 00:17 eyeos
-rw-r--r-- 1 root root 44 2008-02-19 22:53 info.php
drwxr-xr-x 16 ftpuser www-data 4096 2008-02-21 21:07 joo
drwxr-xr-x 2 root root 4096 2008-02-28 17:37 ko
drwxr-xr-x 2 root root 4096 2008-03-02 06:25 webalizer
Reply With Quote
  #4  
Old 6th March 2008, 08:19
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default

If you are using a straight Apache configuration ( not ISP ) you can add a rewrite in your site conf file.

If you are using the default conf, add this to your /etc/apache2/sites-available/default

<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://mysite.com/phpmyadmin [R]
</Location>
</IfModule>
</IfModule>


Then restart Apache.

Last edited by thecaoticone; 6th March 2008 at 08:22.
Reply With Quote
  #5  
Old 6th March 2008, 15:25
rick z rick z is offline
Junior Member
 
Join Date: Nov 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank you for the suggestion!!!

Hi thecaoticone,

Thank you for the quick tip. I will give that a try tonight.

So for the installation using 'apt-get install phpmyadmin' it has to be done at the /etc/apache2/sites-available/default directory but not the phpmyadmin directory. You know,... I was going around the phpmyadmin's website & goolging and couldn't find this simple step that you are providing... In the phpmyadmin's website I found something like "$cfg['ForceSSL'] boolean - Whether to force using https while accessing phpMyAdmin" But I couldn’t find the configuration files. Any how… Thank you!
Reply With Quote
  #6  
Old 7th March 2008, 03:04
rick z rick z is offline
Junior Member
 
Join Date: Nov 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The http://mysite/myphpadmin did not get redirect to https after input the following code.

<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://mysite.com/phpmyadmin [R]
</Location>
</IfModule>
</IfModule>


Any suggestion?
Reply With Quote
  #7  
Old 7th March 2008, 06:16
thecaoticone thecaoticone is offline
Member
 
Join Date: Nov 2007
Posts: 89
Thanks: 1
Thanked 18 Times in 16 Posts
Default

First off, I told you wrong. The correct file is:

/etc/apache2/sites-available/000-default

not:

/etc/apache2/sites-available/default

My apologies for that mistake.

You will need to load the rewrite_mod for apache:

sudo a2enmod rewrite

You also need to change AllowOverride from None to All in the first 2 directory blocks.

A better example for this is here:

http://www.xpheas.com/mod_rewrite-Ap...Gutsy_a18.html



Here is an example of /etc/apache2/sites-available/000-default using a rewrite for phpmyadmin.

If you do not use the default conf change to the conf you created for your main site.

Quote:
NameVirtualHost xxx.xxx.x.xxx:80
<VirtualHost xxx.xxx.x.xx:80>

ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin webmaster@mysite.com

DocumentRoot /var/www/mysite/

<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /var/www/mysite/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error,crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>


<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://mysite.com/php_redirect [R]

</Location>
</IfModule>
</IfModule>

</VirtualHost>

Just a note, I came across this in the Squirrelmail configuration.

Let me know if this helped.
Reply With Quote
  #8  
Old 10th March 2008, 16:30
rick z rick z is offline
Junior Member
 
Join Date: Nov 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default it's working now.

I was able to get it re-direct to https with my new install ubuntu last weekend. Thank you so much!!!
Reply With Quote
  #9  
Old 2nd November 2009, 19:47
skara skara is offline
Junior Member
 
Join Date: Apr 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

May i grab it from deep of the grounds ? (Just in case i ever forget it myself )

Debian/Ubuntu-release of PhpMyAdmin is configured in /etc/apache2/conf.d/phpmyadmin.conf

Following forces my clients to use https vHost-independent
Quote:
<IfModule mod_rewrite.c>
<IfModule mod_ssl.c>
<Location /phpmyadmin>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/phpmyadmin [R]
</Location>
</IfModule>
</IfModule>

Alias /phpmyadmin /usr/share/phpmyadmin
... (rest stays the same)
Hope it helps anybody else too

greetz
skara
Reply With Quote
  #10  
Old 22nd October 2010, 12:12
Dixie Dixie is offline
Junior Member
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Skara

Your comment works really well

It is efficient and effective, thanks!

Dixie
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 and multiple SSL configs and name based virtual hosting Creator1326 Server Operation 11 5th October 2010 19:28
Setting up a customer SSL site catdude General 3 24th January 2008 18:34
SSL for virtual hosts on one certificate rbartz Tips/Tricks/Mods 8 20th November 2007 17:59
SSL Issue - Unable to connect to any site Menzor Installation/Configuration 4 27th May 2007 04:03
Unbearably slow access speeds CombatGod Installation/Configuration 5 30th May 2006 16:31


All times are GMT +2. The time now is 11:45.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.