Setting up phpMyAdmin in OpenSolaris

Recently, some one posted a question in a mailing list as to how to get phpMyAdmin working within OpenSolaris. So, here is a quick write up on how to get this done. Hope, you find this useful

Install and configure AMP stack within OpenSolaris

  • Install  OpenSolaris from LiveCD. You can download your copy from here
  • Install Web Stack components from OpenSolaris repository by doing something like
    • Open a command line terminal window and enter the below command . This will download components like Apache 2.2, MySQL 5.0 and PHP 5.2 from the repository.
      • pfexec pkg install amp
  • Let us register these downloaded packages with Solaris Service Management Framework (SMF) by doing something like
    • (from a command line terminal window)
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/network/http-apache22.xml
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/mysql.xml
      • pfexec /usr/sbin/svccfg -s /var/svc/manifest/application/database/memcached.xml
  • Finally, let us start Apache and MySQL services by doing something like
    • (from a command line terminal window)
      • pfexec /usr/sbin/svcadm enable http:apache22
      • pfexec /usr/sbin/svcadm enable mysql:version_50

 With this, you should have successfully configured an AMP stack for OpenSolaris. If you would like to try out some sample php pages, you could very well write these php pages under default apache document root directory ( /var/apache2/2.2/htdocs )

Note that within OpenSolaris the Apache document root directory - location in your hard disk where apache web server looks to serve incoming requests from your browser - needs special privilege to write to. Now, within OpenSolaris, you can get this privilege by prefixing with 'pfexec' command ahead.

For example, if I had to write a sample hello world php within OpenSolaris, I would do something like

pfexec vi /var/apache2/2.2/htdocs/hello.php

and save the following contents. Now, you should be able to access this page from http://localhost/hello.php

  <?php

   echo "Hello World";

  #Now, let us get the php server information

  echo phpinfo();

   ?>

Configuring phpMyAdmin within OpenSolaris 

Now, let us go ahead and download phpMyAdmin from here and unpack the downloaded tar ball to say /var/www. Again, from a command line terminal window, this is easily done - as shown below :

  •  Download phpMyAdmin to a local directory which is not accessible by every one to say /var/www
    • pfexec wget  phpmyadmin-2.11.6
    • pfexec mkdir -p /var/www
    • cd /var/www & pfexec gtar jxvfp ~/phpmyadmin-2.11\*
    • pfexec mv /var/www/phpmyadmin-2.11\* /var/www/phpmyadmin
  • Now, you might want to download this phpmyadmin.conf to Apache 2.2 configuration location and restart Apache Web Server. This configuration snippet instructs apache to to load phpMyAdmin from /var/www
    • wget phpmyadmin.conf
    • pfexec cp phpmyadmin.conf /etc/apache2/2.2/conf.d
    • pfexec /usr/sbin/svcadm restart http:apache22
  • Finally, you should be able to access phpMyAdmin from your browser by doing something like
    • http://localhost/myadmin


 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Sharing what little I know

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today