First add apache2 and mysql to the USE flag in the /etc/make.conf file:
$ emacs -nw /etc/make.conf
USE=”gtk gnome qt kde dvd alsa cdr hal howl imap maildir mysql apache2“emerge the apache package:
$ emerge apache
$ /etc/init.d/apache2 start
$ 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:
$ emerge dev-php/php mod_php
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“$ /etc/init.d/apache2 restart
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:
<?phpIf 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.
phpinfo();
?>
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$ emerge mysql mysql-administrator mysql-query-browser
>=dev-db/mysql-query-browser-1.1.17 ~x86
>=dev-cpp/gtkmm-2.8 ~x86
>=dev-cpp glibmm-2.7 ~x86
$ emerge –config mysql-4.1.14
$ /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.
from http://tabreziqbal.wordpress.com/2006/04/18/apache-php-mysql-on-gentoo/
http://beans.seartipy.com/2006/04/18/apache-php-mysql-on-gentoo/
No comments:
Post a Comment