Apache + PHP + MySQL on Gentoo
Most of the today's web applications need the combo of Apache, PHP and MySQL packages to be first installed on the system. Installing these software on a Gentoo system should be a straightforward process. Below is the complete procedure.
First add apache2 and mysql to the USE flag in the /etc/make.conf file:
USE="gtk gnome qt kde dvd alsa cdr hal howl imap maildir mysql apache2"
emerge the apache package:
sh# /etc/init.d/apache2 start
sh# rc-update add apache2 default
Test the installation by accessing the url http://localhost/ from a web browser. If you get a welcome message from apache, the installation is complete. More info here.
Now emerge PHP4 and the mod_php module for apache:
Add the configuration directive(-D PHP4) to /etc/conf.d/apache2 file and restart the apache web server:
APACHE2_OPTS="-D DEFAULT_HOST -D PHP4"
Create a sample php script in the directory /var/www/localhost/htdocs with the following contents and access it from the web browser to test the php installation:
-
<?php
-
?>
If you see a lot of information displayed about the version of PHP and other related things then PHP is installed and properly configured with the apache web server. Installation of PHP5 is also similar but be warned that still a lot of software runs only on PHP4(Eg: phpBB Bulletin Software). With a little bit of effort you can also run both PHP4 and PHP5 on the same system side by side.
Install MySQL and all the related tools:
Add the following lines to the /etc/portage/package.keywords file:
>=dev-db/mysql-administrator-1.1.5 ~x86
>=dev-db/mysql-query-browser-1.1.17 ~x86
>=dev-cpp/gtkmm-2.8 ~x86
>=dev-cpp glibmm-2.7 ~x86
sh# emerge –config mysql-4.1.14
sh# /etc/init.d/mysql start
Set a root password for mysql server when prompted by the 'emerge –config' command. You can administer the mysql server by using either the command line tools or using the graphical tool mysql-adminstrator. Similarly, the command line client mysql can be used to create and view the database schemas or the graphical tool mysql-query-browser can be used. I recommed you give these two graphical applications a try.
Other databases, like PostgreSQL, can be used instead of MySQL whenever the applications support it, but a majority of the applications support only the MySQL database. Wordpress for example doesn't support PostgreSQL.
Related Posts:
Readers who viewed this page, also viewed:
- Installing C#, Mono(.NET) & MonoDevelop in Ubuntu Dapper Drake 6.06
- Five Desktop Blog Editors for GNU/Linux Users
- Linux Bible 2007 Edition: Install/Run 10+ GNU/Linux Distributions(Ubuntu, Fedora, Gentoo etc)
- Two Applications For Easy Management Of ‘USE’ Flags In Gentoo
- Installing amazon-ecs/hpricot RubyGem on Windows Operating System
hello there,
Quotei am trying to reproduce a data server that a company uses to present information to its customers via the web. No problem. What they are using right now is Microsoft Access, connecting via ODBC to a server on line. The cool thing that they can do is have several tables linked together. Like if a certain field is updated in one table, it updates the same info automatically in another table. So, i want to reproduce this in MySQL, but i can't seem to find out how. Is there a way to pull this off on the server side ? or does that have to be done on the client side ?
thanks for any tips.
Comment by jeff — September 19, 2006 @ 8:02 pm
I don't understand your question completely, but what you are asking just needs establishing relationships among multiple talbes using primary-foreign key mappings I think. A quick googling resulted in these links:
QuoteRelationships in MySQL
MySQL and MS Access
Comment by tabrez — September 21, 2006 @ 10:33 am