Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: phpmyadmin + lighttpd on gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
geta
Apprentice
Apprentice


Joined: 10 May 2003
Posts: 153

PostPosted: Sat Aug 20, 2005 8:05 pm    Post subject: HOWTO: phpmyadmin + lighttpd on gentoo Reply with quote

UPDATE 2006-02-08:
As of sometime between originally writing this documentation and now there have been some changes to the phpmyadmin ebuild. It now installs php version 5 as a dependency. There is a new howto further down. I'll leave the old one in place for reference.

This tutorial is based on http://stateless.geek.nz/2005/06/27/debian-lighttpd-and-phpmyadmin/. It takes you through the gentoo-specific install steps and also tells you something about the configuration needed.

Note on webapps on gentoo
---------------------------------
Note to users - like me - who are not used to the gentoo way of handling webapps (such as phpmyadmin, typo3, mambo etc.): any webapp has two installation steps which are *automatically* handled by the ebuild:
- first install any webapp to /usr/share/webapps
- then use the utility webapp-config to copy the webapp to any virtual hosts on your machine. type "man webapp-config" to get more info on webapp-config. it really looks cool.

1. Installation
---------------
- install mysql if you haven't done so yet (AND set a mysql root password - you're probably planning on running a webserver - if not, do it anyway)
- install lighttpd: "emerge -av lighttpd"
- then install php-cgi: "emerge -av php-cgi". if you try emerging phpmyadmin first, it will install apache along as a dependency, which in this scenario, we want to avoid.
- you can now install phpmyadmin: "emerge -av phpmyadmin". Follow the instructions printed out by "emerge" to add some phpmyadmin-specific information to the mysql-database

2. Configuration
-------------------
Now you have phpmyadmin and lighttpd installed, you will have to configure /etc/lighttpd.conf:
- In the section "server.modules" uncomment "mod_alias" and "mod_fastcgi"
- Then uncomment the section "fastcgi.server". In that section change the path /usr/local/bin/php to /usr/bin/php-cgi
- Then add your own section (anywhere in the file):
Code:
alias.url =("/phpmyadmin/" => "/var/www/localhost/htdocs/phpmyadmin/")

The path in this section might not be the correct path for your machine. To check where phpmyadmin is installed on your machine, run: "webapp-config --list-installs phpmyadmin"

3. Running phpmyadmin
----------------------------
start lighttpd: "/etc/init.d/lighttpd start"
open your favourite browser and type in the url: http://localhost/phpmyadmin

Cheers,
geta
_________________
geta - pronounced: "djetta"


Last edited by geta on Wed Mar 08, 2006 8:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
MikeD
n00b
n00b


Joined: 20 Aug 2005
Posts: 1

PostPosted: Sat Aug 20, 2005 9:29 pm    Post subject: Reply with quote

Great tutorial. I was just looking for something like this the other day.
Back to top
View user's profile Send private message
COiN3D
Guru
Guru


Joined: 02 Aug 2004
Posts: 543
Location: Munich, Germany

PostPosted: Tue Aug 23, 2005 11:52 am    Post subject: Reply with quote

Hello,

interesting tutorial. Btw, I've another question. On the lighttpd website is a tutorial how to organize the vhosts with mysql. Have you tried that tutorial out? Unfortunately, lighttpd refused to start after trying out the tutorial.
_________________
e17 documentation | Be free and use Jabber as your IM! | Combine IRC and IM
Back to top
View user's profile Send private message
geta
Apprentice
Apprentice


Joined: 10 May 2003
Posts: 153

PostPosted: Fri Aug 26, 2005 5:23 pm    Post subject: Reply with quote

COiN3D wrote:
On the lighttpd website is a tutorial how to organize the vhosts with mysql. Have you tried that tutorial out? Unfortunately, lighttpd refused to start after trying out the tutorial.

Sorry mate, can't help you out on that problem. I've never done this before and I couldn't find the tutorial (the lighttpd website is quite unorganised once you start scratching beneath the surface). Maybe you'll have more luck if you open a new thread about your problem. Please don't forget to include the link to the tutorial and a copy/paste of the error message from lighty (there must be an error message). It's always easier to analyse a problem with more information :)

Cheers,
geta
_________________
geta - pronounced: "djetta"
Back to top
View user's profile Send private message
tunapants
n00b
n00b


Joined: 14 Dec 2005
Posts: 6
Location: Toronto, Ontario, Canada

PostPosted: Wed Dec 14, 2005 4:33 am    Post subject: Reply with quote

Hi -- Thanks for the tutorial.
I just wanted to add that when I followed it initially, my php-cgi wasn't configured with mysql support. This gave me some grief.
I had to enable the "mysql" USE flag for the php-cgi emerge and all went well after that.

Just in case anyone else is getting any error messages when they attempt to access mysql with php-cgi. Make sure mysql support is actually enabled.
Back to top
View user's profile Send private message
geta
Apprentice
Apprentice


Joined: 10 May 2003
Posts: 153

PostPosted: Wed Dec 14, 2005 5:56 pm    Post subject: Reply with quote

tunapants wrote:
Hi -- Thanks for the tutorial.
I just wanted to add that when I followed it initially, my php-cgi wasn't configured with mysql support. This gave me some grief.
I had to enable the "mysql" USE flag for the php-cgi emerge and all went well after that.


I've had the same sort of problem again and again. The best solution (without remerging) is to:
emerge mysql
emerge php-cgi
emerge lighttpd

You will then have php with mysql support, lighttpd with php and mysql support, provided you haven't set "-mysql" or "-php" in make.conf. Just using "emerge mysql php-cgi lighttpd" didn't work for me, so there is some dependency information that is updated after an emerge has completed.

Cheers,
geta
_________________
geta - pronounced: "djetta"
Back to top
View user's profile Send private message
geta
Apprentice
Apprentice


Joined: 10 May 2003
Posts: 153

PostPosted: Wed Mar 08, 2006 8:36 pm    Post subject: Reply with quote

This tutorial is based on http://stateless.geek.nz/2005/06/27/debian-lighttpd-and-phpmyadmin/. It takes you through the gentoo-specific install steps and also tells you something about the configuration needed.

Note on webapps on gentoo
---------------------------------
Note to users - like me - who are not used to the gentoo way of handling webapps (such as phpmyadmin, typo3, mambo etc.): any webapp has two installation steps which are *automatically* handled by the ebuild:
- first install any webapp to /usr/share/webapps
- then use the utility webapp-config to copy the webapp to any virtual hosts on your machine. type "man webapp-config" to get more info on webapp-config. it really looks cool.

---
1. Mysql, PHP5 without apache2 and lighttpd (further notes on the emerge order see section caveats below)
---
- install mysql if you haven't done so yet (AND set a mysql root password - you're probably planning on running a webserver - if not, do it anyway)
- install lighttpd: "emerge -av lighttpd" lighttpd automatically detects mysql and compiles in support for it.
- set use flags to install php5 - avoiding apache2, "useless" db systems and crypto (removing many dependencies):
Code:
dev-lang/php -apache2 -berkdb cgi -crypt -gdbm session -truetype

You can also set USE="-apache2" in /etc/make.conf to avoid apache2 support on the whole system (if you're running lighttpd this is probably what you want anyway)
- install php version 5: "emerge -av dev-lang/php"

---
2. webapp-config for lighttpd and phpmyadmin
---
- webapp-config uses apache2 as the default web server. To change this we have to edit one line in the config file, so we first "emerge -av webapp-config" and then set the following value in /etc/vhosts/webapp-config:
Code:
vhost_server="lighttpd"

- you can now install phpmyadmin: "emerge -av phpmyadmin". Follow the instructions printed out by "emerge" to add some phpmyadmin-specific information to the mysql-database

---
3. Configuration
---
Now you have phpmyadmin and lighttpd installed, you will have to configure /etc/lighttpd.conf:
- In the section "server.modules" uncomment "mod_alias" and "mod_fastcgi"
- Then uncomment the section "fastcgi.server". In that section change the path /usr/local/bin/php to /usr/lib/php5/bin/php-cgi

---
4. Running phpmyadmin
---
start lighttpd: "/etc/init.d/lighttpd start"
open your favourite browser and type in the url: http://localhost/phpmyadmin

---
5. Caveats
---
Somehow I've discovered a sort of "dependency hell" situation in stable gentoo. Lighttpd has support for php (4), phpmyadmin installs php(5) as a dependency, but because php(4) and php(5) are in different locations in the portage tree this causes hickups, when reinstalling lighttpd: Lighttpd somehow recognises that php is installed (probably through eclasses), and as a consequence sets the php USE flag on lighttpd. Because of different package tree locations it wants to reinstall php(4) which is blocked by php(5). So beware if installing php(5) before lighttpd, set USE="-php" on lighttpd. If you're using php-cgi (which you're doing if you followed my instructions) you can use php without activating support for it directly in lighttpd.
EDIT: This problem is already in bugzilla. See: https://bugs.gentoo.org/show_bug.cgi?id=121653

Cheers,
geta
_________________
geta - pronounced: "djetta"
Back to top
View user's profile Send private message
Doubleletter
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2004
Posts: 79
Location: Sharjah, UAE

PostPosted: Mon Apr 24, 2006 5:46 am    Post subject: Reply with quote

This was most helpful. Thank you
Back to top
View user's profile Send private message
eyebex
n00b
n00b


Joined: 23 Jul 2005
Posts: 65

PostPosted: Fri Sep 05, 2008 4:39 pm    Post subject: Reply with quote

After following geta's tutorial (thanks) I'm having trouble with phpmyadmin's cookie authentication: I'm accessing the server running phpmyadmin over a public Internet IP (http://<IP>/phpmyadmin/), but after pressing OK on the login page, phpmyadmin forwards me to "http://localhost/phpmyadmin/index.php?token=...". I would have expected to be forwarded to "http://<IP>/phpmyadmin/index.php?token=...". "http" authentication works fine, by the way. Any ideas?
Back to top
View user's profile Send private message
eyebex
n00b
n00b


Joined: 23 Jul 2005
Posts: 65

PostPosted: Fri Sep 05, 2008 10:39 pm    Post subject: Reply with quote

Got it, I was missing $cfg['PmaAbsoluteUri'] in my phpMyAdmin config which obviously needs to be set although it's missing in the sample configuration ...
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Sep 06, 2008 1:23 am    Post subject: Reply with quote

Nice post geta; one thing tho: you can just edit the original post to bring it up to date, no need to repost the whole thing with amendments or additions. (It's conventional to put a last modified date in the OP, or a version on the subject.) You can bump the thread at the same time with a small new post.
HTH.

edit: doh didn't realise this was a necrothread ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum