How to install Apache, PHP and MySQL 5 within Indiana (Open Solaris Developer Preview)
Now with the release of OpenSolaris distribution, Please refer to Setting up AMP Stack for OpenSolaris for steps in configuring Apache, MySQL and PHP runtime in OpenSolaris.
Couple of days back, Open Solaris Developer Preview 2, was released to the general public. I am told that this preview (aka beta) release is based on the same milestone build (Nevada build 79b) that Open Solaris Developer Express 01/08 was released with. So, naturally I got curious and tried it out on my laptop and here is my feedback
On the positive side - Installation experience is very smooth. Also, fonts look sharp and even wireless on my laptop works out of the box as well.On the not so positive side - Web Stack components like Apache, PHP and MySQL are not installed as part of default install. So, one will need to manually download and install / configure these components. Now, the tricky part is knowing the exact name of these packages to download as the current Indiana 'pkg' command is unable to search by common names like 'apache' or 'php' etc.
After some poking around, I found the list of additional packages available at Indiana repository and from then, it was a breeze to find the right instructions to download and configure these components. Thought, I would share my experience here. So, here in this blog, I will go through the list of steps needed to configure a Web Stack (Apache , PHP and MySQL) stack on my Solaris Developer Preview (aka Indiana).
- Using a 'terminal' window, download and install Web Stack components like Apache , PHP and MySQL as shown below. Note, You will need to have a high speed internet connection to download and install these packages.
If you are curious as to what we what are we doing here - here is a brief explanation
|
|
pkg - new package command that can download and install specified packages from Indiana package repository.
SUNWapch22 - Apache 2.2
SUNWphp524core SUNWphp524usr -> PHP 5.2.4 core runtime and its dependent header files.
SUNWmysql5 - MySQL 5.0 database core runtime files.
SUNWapch22m-php5 - Glue to bond PHP 5.2.4 runtime within Apache
SUNWphp524-mysql - Glue to bond PHP 5.2.4 runtime with MySQL database.
For Developer Preview 2 (aka beta) release, I guess, we need to provide these correct package names to the 'pkg' command. Hopefully, going forward , with subsequent releases, we should be able to get the following command working
pfexec pkg install apache php mysql
Configuring MySQL for Indiana
Though, the above command successfully installed the MySQL database, there are still some some post installation steps necessary. Unlike Solaris Developer Express, where these below steps are automatically done for us, within Solaris Developer Preview 2, we will need to perform the following manual configuration to successfully configure MySQL database within Indiana. Again, I am hoping that with Developer Preview 3, these steps should no longer be needed.
Create MySQL user and group and allocate MySQL data directory '/var/mysql' to this user for security purposes
|
|
Now, let us initialize MySQL database and try to start the server.
|
|
Yup - this is all should be required to run Apache , MySQL and PHP within Indiana. With this pre configuration, you should be now ready to deploy either a wiki site like Media Wiki on Indiana or a content management site like Drupal on Indiana just as you would with SXDE 01/08.


Eeeeeeexcellent!
Posted by Mikael Gueck on February 20, 2008 at 12:06 AM PST #
Thanks for nice info, just try to instal Indiana.
Posted by Romych (Russia) on March 26, 2008 at 07:05 AM PDT #
I think this is really informative article on Indiana. I liked it style of guidance
Posted by PHP lover on July 17, 2008 at 12:35 AM PDT #
after i have ran the pkg command, what is next? i have tried executing this command: pfexec groupadd -g mysql, but i was getting this
UX: groupadd: ERROR: invalid syntax.
usage: groupadd [-g gid [-o]] group
Please help. Sorry, I am very new to OpenSolaris environment.
Thanks,
Sam
Posted by sam on August 22, 2008 at 02:51 PM PDT #
please use groupadd mysql (no need for -g) and the rest of the commands should be the same.
- sriram
Posted by Sriram Natarajan on August 25, 2008 at 01:04 PM PDT #
Hi Sriram,
Thanks for responding to my inquiry. I have tried executing the commands again; however, I am this message:
sam@opensoltst1:~$ pfexec groupadd mysql
UX: groupadd: ERROR: mysql is already in use. Choose another.
So, I have tried this instead and I did not get any message.
sam@opensoltst1:~$ pfexec groupadd mysql2
After this, I just went thru the list of the commands and I have noticed that the command line started just showing $ and not sam@opensoltst1:~$. Anyway, how do I use the last command to create a password for mysqladmin? Is it like this?
pfexec /usr/mysql/5.0/bin/mysqladmin -u root password 'mysql1'
Please advice.
What happens after all this? How do I start the database or apache or PHP? Where is the directory for all these programs? Sorry, I am very new to this environment.
Regards,
Sam
Posted by sam on August 27, 2008 at 06:12 PM PDT #
Hi
No worries. looks you are using OpenSolaris which already has included mysql within the user account.
pl. note that this blog that you are using for reference is quite old and was originally written for a beta release of opensolaris. hence, some of the instructions mentioned here does not apply.
please check out this link
http://blogs.sun.com/natarajan/entry/getting_ruby_or_amp_apache
how to set root password for mysql
/usr/mysql/5.0/bin/mysql -u root -p password <give a new password here>
how to start/stop apache
svcadm enable http:apache22 (start)
svcadm disable http:apache22 (stop)
svcadm restart http:apache22 (simply restart if you made any config changes)
config files are under /etc/apache2/2.2
how to start/stop mysql
svcadm enable mysql:version_50 (start)
svcadm disable mysql:version_50 (stop)
Posted by Sriram Natarajan on August 27, 2008 at 06:36 PM PDT #
Hi Sriram,
Thanks for the info again. I am able to start apache and php together. Now, I am trying to change the DocumentRoot in httpd.conf to point to "/webs" instead of "/var/apache2/2.2/htdocs." However, I think it is still pointing to it. Where else do I need to change the path?
# httpd.conf
# DocumentRoot "/var/apache2/2.2/htdocs"
DocumentRoot "/webs"
# <Directory "/var/apache2/2.2/htdocs">
<Directory "/webs">
Also, how do I point all my web files to this directory ("/webs"). Somehow, when I save the file using the Text Editor that came with OpenSolaris, I can only pick my home directory, but could not find the webs directory. Please advice.
Thanks,
Sam
Posted by sam on August 28, 2008 at 01:57 PM PDT #
yes, you are making the change at the right place . you might have forgotten to restart apache after your change
svcadm restart http:apache22
you could also do some thing like - as we now provide a frame work to have customizations spread out within conf.d
create a file like below
pfexec vi /etc/apache2/2.2/conf.d/mywebsite.conf
and create the following file
<VirtualHost *:80>
DocumentRoot /webs
<Directory /web>
#do whatever you want..
</Directory>
</VirtualHost>
and finally restart the server
svcadm restart http:apache22
Posted by Sriram Natarajan on August 28, 2008 at 02:45 PM PDT #
Hi Sriram,
I found a sample conf file in apache and here is what I have done.
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/webs"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "/webs/logs/error_log.log"
CustomLog "/webs/logs/access_log.log" common
</VirtualHost>
What happens after I have re-started the apache? Does the MySQL here have a GUI or do I need to download the MySQL browser? Please advice.
Regards,
Sam
Posted by sam on August 29, 2008 at 01:07 PM PDT #
you can use phpMyAdmin , if you would like to - check out this blog on how to get phpMyAdmin - http://blogs.sun.com/jyrivirkki/entry/updated_phpmyadmin_package
once you have installed phpmyadmin, you will need to copy
/etc/apache2/2.2/samples-conf.d/phpmyadmin.conf /etc/apache2/2.2/conf.d
svcadm restart http:apache22
you will be able to configure your mysql through a browser by doing some thing like
http://localhost/phpmyadmin (provide root with no password to login to phpmyadmin). once you are logged in , you might want to protect your database by configuring a root password for mysql database.
hope this helps
Posted by Sriram Natarajan on August 29, 2008 at 01:53 PM PDT #
Dude nice article.
Posted by Askar Ali Khan on October 10, 2008 at 02:44 AM PDT #
Its help me much.. Start from i dont know anything but im curios and want to try in layered tech server...
Thanks a lot...
Posted by Busby Seo Test on November 23, 2008 at 08:05 AM PST #
Hello, I already install Apache+PHP+Mysql on my opensolaris VPS as you describe above, but the problem is my server can't execute PHP file, it show the source code when i try to access it. Am I missing something? I really new to opensolaris.
Please give me some advice...
Posted by hamdi on December 03, 2008 at 01:27 AM PST #
Hamdi - if the server is unable to load PHP files, please take a look at the apache server log files . it should point you with information as to why the server is not able to successfully execute php files
pfexec less /var/apache2/2.2/logs/errors
and scroll through for the last few lines.
typically , if you installed apache / php / mysql through
pfexec pkg refresh
pfexec pkg install amp
followed by
svcadm enable http:apache22
then all the necessary glue should be there and php should start out of the box
Posted by Sriram Natarajan on December 03, 2008 at 10:45 AM PST #
I'm done with that step but still can't execute php
and when I look in /etc/php/5.2 , no such php.ini file
I tray to remove and reintsall amp but still not solve my problem
php.ini still not present in /etc/php :(
Posted by hamdi on December 05, 2008 at 01:42 AM PST #
Thanks for the great info. Just what I was looking for.
Posted by vardis on December 05, 2008 at 03:32 AM PST #
Hi Hamdi - this is because you probably have opensolaris 2008.05 - where php is installed under /etc/php5/5.2.4 . with the recent release of opensolaris 2008.11 , php is now installed under /etc/php/5.2
if you have not gone too much into development, may I recommend you to download opensolaris 2008.11 and try it out. opensolaris 2008.11 - released just now includes apache 2.2.9 , php 5.2.6 while opensolaris 2008.05 uses php 5.2.4
Posted by Sriram Natarajan on December 05, 2008 at 05:20 AM PST #
Thanks... now I able to setup my server.
one more question, how to setting nginx, php and mysql on opensolaris?
I try to search over the web and not found any good tutorial, can u make that tutorial too...
Posted by hamdi on December 17, 2008 at 06:21 AM PST #
Now i am going to learn much...hope your article will help me to install the MySQL. Thanks so much
Posted by Busby SEO Test on December 25, 2008 at 09:50 PM PST #
How can i want to install Java Media Framework on opensolaris 2008.11?
i try to install the plugin for JavaFX 1.0 but i get this error message,*" Some plugin requrid compatibility javafx.sdk,no plugin providing javafx.sdk could be found the fllowing plugin is affected JavaFX 1.0"* can you help me please. thanks for your good works...
Posted by Douglas K N Gaisie on December 31, 2008 at 01:56 AM PST #
i have tried your tips, but i still have an error :( anyway i'll keep try it.
Posted by busby seo test!!! on January 12, 2009 at 11:33 PM PST #
Thanks a lot this help me much..and now I able to setup my server.
Posted by Busby SEO on January 13, 2009 at 03:30 AM PST #
wow.. this is the complete info that i got..
thanks dude for sharing this info :)
Posted by Inventory Management Software on January 20, 2009 at 06:25 PM PST #
Hi Sriram,
I have everthing setup in Sun xVM. Thanks for all your help. Now I have a question regarding setting up the MySQL in NetBeans 6.5. Is there a MySQL GUI for OpenSolaris 2008.05? I have executed all that you have mentioned above. Now, I have a username called mysql with password. How do I know that everything is working? Also, I am trying to create a new database using NetBeans 6.5 and I am getting some error. Could you please help or direct me to a link for this?
Regards,
Sam
Posted by Sam on January 21, 2009 at 10:01 AM PST #
Glad you got it all working . you could test if mysql is working fine by connecting from the command line
/usr/mysql/bin/mysql -u root
this should let you to mysql shell where you can verify your sql queries (quit or CTRL-D to exit from here)
if you need to manage Mysql, then you could use PHPMyAdmin as
mentioned in my other blog
http://blogs.sun.com/natarajan/entry/phpmyadmin_within_opensolaris
with this, you should be able to administer mysql through a browser.
now, for netbeans - pl. note that netbeans is an ide. it cannot and need not talk to a database.
i am not sure, exactly what you are trying to do. in any case, you can either write to webstack-discuss@opensolaris.org (requires subscription to this mailing list or simply post a question to our forum - where we developers answer it for you )
forum url -
http://forums.sun.com/forum.jspa?forumID=980&start=0
Posted by Sriram Natarajan on January 21, 2009 at 12:56 PM PST #
hope your article will help me to install the MySQL. thank for sharing
Posted by seotest on January 26, 2009 at 05:46 AM PST #
it's a great explanation. it's so clear. thank you.
Posted by Kampanye Damai Pemilu Indonesia 2009 on February 06, 2009 at 12:55 PM PST #
Hi Sriram,
I have just recently installed the Opensolaris 2008.11 and the amp and amp-dev from Package Manager. Everything was installed and working. However, I notice that I always need to restart the apache server whenever I change something on my test.php page. It does not show up on the test.php when I reload the page on the web. Please advice.
Regards,
Sam
Posted by sam on March 04, 2009 at 10:12 AM PST #
Hi
We noticed a bug . can you kindly comment out apc by commenting the below line
extension=apc.so
within /etc/php/5.2/conf.d/apc.ini
and then restart apache . this should fix it for now.
with opensolaris build 110 (yet to be publicly available) will fix this - where in you can use apc and still your changes will instantly show up.
either you can wait until opensolaris 2009.06 - official build shows up in june or wait a month for build 110 to be publicly released and upgrade to it. new build releases will be announced in indiana-discuss@opensolaris.org mailing list
Posted by Sriram Natarajan on March 04, 2009 at 10:18 AM PST #
Hi Sriram,
Thanks for replying right away. That fixed it. I will wait for the 2009.06 version. I have two sessions running right now 2008.05 and 2008.11. Both are okay at this time.
Regards,
Sam
Posted by sam on March 04, 2009 at 10:25 AM PST #
Hi Sriram,
I have just recently re-formatted my hard drive and re-installed all the programs again. I have also installed Opensolaris 2008.11 in the VirtualBox as well. However, when I added the Virtual Definition to it, I could only get/pick the resolution to 1024x768. I could not set it to any higher resolution because this was already the highest setting. Sorry, my question may not be related to this blog. Please help.
Regards,
Sam
Posted by sam on April 09, 2009 at 07:28 PM PDT #
hi - it is alright. i think, what you probably need is
a) if you don't have virtual box 2.2, please uninstall this current version and go ahead and download virtual box 2.2
b) now, once the virtualbox 2.2 installation is completed go to settings for opensolaris virtual machine and click on 'enable 3d acceleration' (under general tab).
now, if you start the virtual machine, hopefully, 3d accel should kick in and help you get a higher resolution
if you still have issues, please write to virtualbox forum -
http://forums.virtualbox.org/viewforum.php?f=11
Posted by Sriram Natarajan on April 09, 2009 at 07:38 PM PDT #
dear sriram,
rajen@opensolaris$ pfexec groupadd mysql
UX: groupadd: ERROR: mysql is already in use. Choose another.
-> How to create/modify the /var/mysql directory as mysql user home directory for mysql?
and
-> How to create a password for mysql root login?
please guide me if i where wrong and correct me bcos to this im totally new.
Regards
Rajendra
Posted by Rajendra on April 10, 2009 at 08:40 AM PDT #
Dear SriRam,
Here one major doubt i have , right now working in opensolaris platform
Please guide me to step by step installation of Web-server? (as Apache/php/mysql)and
also for Q-shell in Open Solaris?.
Waiting for ur reply as i need to implement very urgently in my company.
Thanks and regards
Rajendra
Posted by Rajendra on April 10, 2009 at 08:49 AM PDT #
hi rajendra
please download opensolaris 2009.06 (preview build 111) from http://www.genunix.org/
once you have successfully installed build 111, you will need to run the following command
pfexec pkg amp
this will install apache, mysql and php runtime for you. you don't have to create any user or anything else
now, to start apache you will need to do the following
svcadm enable apache22
to start mysql 5.0, you will need to do the following
svcadm enable mysql:version_50
mysql 5.1 is also available within build 111. if you would like mysql51, then you will need to do the following
pfexec pkg install SUNWmysql51
svcadm enable mysql:version_51
apache document root is under /var/apache2/2.2/htdocs. to write any files underneath, please use 'pfexec'
cd /var/apache2/2.2/htdocs
/tmp/phpmy*gz | pfexec tar xvfp -
note: i don't know what is qshell
- sriram
Posted by Sriram Natarajan on April 10, 2009 at 11:11 AM PDT #
Dear Sriram,
I read the steps to install Webserver & today i will install it.
and also yesterday get a link to install Q-shell
http://www.pymonkey.org/confluence/display/PM/Solaris+Installation
Thanks for ur valuable guidance.
Regards
Rajendra
Posted by Rajendra on April 11, 2009 at 12:06 AM PDT #
Dear Sriram,
Thanks it works.
i have one more query
1.
We have a intel x86 windows 2K3 server to which i installed the Sun Solaris_10,& i want to assign the Ip address "10.1.16.29" subnet "255.255.255.128" and gateway is "10.1.16.1" and need to assign more DNS like "203.129.232.13, 202.54.29.5, 202.54.10.2 , 203.129.236.109 "
What are the exact steps need to do?
2.
I installed the OpenSolaris WebServer , in which How to assign the Public IP address?
Please help me to know the solution.
Regards
Rajendra
Posted by Rajendra on April 11, 2009 at 03:58 AM PDT #
Dear SriRam,
Please guide for Webserver previous doubts.
Regards
Rajendra
Posted by Rajendra on April 13, 2009 at 02:20 AM PDT #
Hi Sriram,
In my company, the web site is underby with delopment team.
my boss given the task to make the Webserver on which Open_solaris, through which all web development team should acccess the database which is on webserver.
i would like to know how to use the samba to communitate with open_solaris and windows_xp, target the webserver?
What will exact steps to do ?
Please Help me.
regards
rajendra
Posted by Rajendra on April 15, 2009 at 12:23 AM PDT #
from you tell me, i think you are very much misunderstood the concept of web server. please refer to this wiki link -what web server means -
http://en.wikipedia.org/wiki/Web_server
i am not a samba expert. you need to post this question to the forum that i provide you earlier
Posted by Sriram Natarajan on April 15, 2009 at 09:48 AM PDT #
Hi ShriRam,
I installed Open_solaris_10 and configured it as a
Webserver(http://10.1.16.52:80).
The problem i facing is that
when try to connect WEBSERVER from one windows_Xp host,
e.g.,
on WinXp Host, we put the address of webserver
http://10.1.16.52 ,it connects the Solaris Webserver
and it opens & shows the first page and after hangs up.
Actually it automatically DOWNS the
ethernet interface of Solaris webserver.
& and this message is popup in webserver.
Message :-(Your ethernet connection rtls0 is temporarily down)
This happens only with one winXp host.
And rest of all is normal from other winxp host
Please explain me the cause and what can be done?
Regards
Rajendra
Posted by Rajendra on April 16, 2009 at 11:59 PM PDT #
it seems to be a windows network configuration issue. i cannot help you there.
Posted by Sriram Natarajan on April 17, 2009 at 10:58 AM PDT #
Dear Sriram,
I read the steps to install Webserver & today i will install it.
and also yesterday get a link to install Q-shell
http://www.pymonkey.org/confluence/display/PM/Solaris+Installation
Thanks for ur valuable guidance.
Posted by Melayu Boleh on April 22, 2009 at 10:32 PM PDT #
Very complete explanation and source of apache, php and mysql. Indeed, we learn so much because of this article.
Posted by Make Money On The Internet on April 27, 2009 at 10:08 AM PDT #
hi, what's wrong with your article? why do you strike all?
Posted by Sulumits Retsambew on June 13, 2009 at 10:42 AM PDT #
there is nothing wrong with this blog post. however, with newer releases, this post has become outdated. i have referred my readers to my recent post on this topic - http://blogs.sun.com/natarajan/entry/setting_up_amp_stack_within (which is also mentioned at the beginning..)
Posted by Sriram Natarajan on June 13, 2009 at 03:10 PM PDT #
Thanks for the great info. Just what I was looking for.
Posted by xtcommerce Design on August 24, 2009 at 02:57 AM PDT #
I cant read clearly because of your strikethrough...
Posted by Blog Untuk Pemula on September 11, 2009 at 09:24 AM PDT #
I agree with him...I cant read well..
Posted by Blog SEO on September 11, 2009 at 09:26 AM PDT #
Penguin agree with them! :D
Posted by Blog Penguin on September 11, 2009 at 09:27 AM PDT #
hey you guys, Sriram already said that this post is outdated...
Posted by how to lose weight in 2 weeks on October 12, 2009 at 02:06 AM PDT #
Thanks for the post just I wanted to share it
Posted by shutters on November 08, 2009 at 12:54 PM PST #
Great post and draw. Thank you for sharing.!!@!
Posted by links of london on November 25, 2009 at 06:31 PM PST #
http://www.linksoflondonbest.com
http://www.linksoflondonbest.com/links-of-london-chains-c-7.html
http://www.linksoflondonbest.com/sweetie-bracelets-c-4.html
Posted by links of london on December 24, 2009 at 04:09 AM PST #