Sun Solaris 10 – How to Setup a SAMP Server + VSFTP + Phpmyadmin (Solaris Apache2 Mysql5 Php5)
This tutorial assumes you’ve some fundamental data of easy methods to use Unix and / or Linux and you’ve got already put in and setup your Solar Solaris server. You probably have not, please examine my different tutorials on establishing a Solar Solaris server and are available again to this tutorial. I shall be proper right here ready for you!
Okay let's get began, and as all the time we’re assuming you’ve put in and have pkg-get working with blastwave set as your mirror web site.
Let's check out the accessible packages to put in first.
# Pkg-get -a | Grep mysql
This could output an excellent checklist of packages. I’m going to put in mysql 5 for this tutorial.
# Pkg-get set up mysql5
This could set up a number of packages that mysql depends upon. So let this run for some time, it could take some time relying in your web connection. Go forward and choose "y" to all questions.
It ought to end efficiently and say one thing like this:
Set up of was profitable.
Bash-Three.00 # ## Executing postinstall script.
Bash-Three.00 # Configuring service in SMF
MySQL 5 is utilizing Service Administration Facility. The FMRI is:
Svc: / community / cswmysql5: default
No database listing discovered within the default location.
If it is advisable construct the preliminary database listing,
See / decide / csw / mysql5 / share / mysql / quick_start-csw
In case you are utilizing a non-default database listing location, please begin mysql manually.
Now, shouldn’t be that good. It even went forward and created our SMF file for us in order that we will use Solaris 10's SMF system. However you’ll discover that it couldn’t find the database file. In order that's what we’re going to do subsequent. We’re going to use blastwave's configuration script. Run it on the location said above:
Bash-Three.00 # / decide / csw / mysql5 / share / mysql / quick_start-csw
Then it is best to get some output to your terminal that appears like this:
That is the blastwave fast begin script to setup a MySQL5 database listing.
The bottom listing is / decide / csw / mysql5.
The default database listing is / decide / csw / mysql5 / var.
You probably have not setup a partition for the database and also you need one; Now is an efficient time to exit this script and create and mount the partition.
You probably have not setup a my.cnf file and you don’t want one of many pattern recordsdata; Now is an efficient time to exit and create the file /decide/csw/mysql5/my.cnf.
Information listing: The default is / decide / csw / mysql5 / var
Observe the onscreen instructions. You possibly can go forward with default for every little thing, however you may wish to choose one of many pattern my.cnf recordsdata. The default one makes use of the my-small.cnf which is for a small reminiscence footprint server. You may wish to go together with one of many default configs for a server that has extra reminiscence.
You need to get a hit response after which a message stating easy methods to run mysql server. You might be virtually there! Now simply kind the next at your command immediate:
# Svcadm allow cswmysql5
Then examine to see if every little thing is working effective.
# Svcs | Grep mysql
You need to get a solution like this:
On-line zero:22:05 svc: / community / cswmysql5: default
If you happen to get one other state like offline or upkeep, this implies you’ve an issue and you will want to examine your mysql log recordsdata or the SMF log recordsdata to see why it's not beginning.
Let's attempt to connect with our mysql server. Now, in case your path is presently one thing like this:
/ Usr / sbin: / usr / bin: / decide / csw / bin /
You wont have the ability to simply name mysql from the command line. I’d advocate including a symbolic hyperlink to the mysql executeable.
# Ln -s / decide / csw / mysql5 / bin / mysql / decide / csw / bin / mysql
Now let's open mysql server by typing mysql.
It ought to log us proper in. Kind exit to exit out of mysql server. Let's now set a root password for our mysql server. Achieve this like this:
# / Decide / csw / mysql5 / bin / mysqladmin -u root password 'new-password'
Now let's examine this login:
Attempt to simply kind mysql on the command immediate and see what occurs. You need to get a denied for person root.
Attempt once more like this:
# Mysql -u root -p
Then when it requests in your password give it the one you set within the above command.
Try to be now logged in. Now you might be full. You might have a password protected mysql server and it’s now working and absolutely practical.
ADDITIONAL MYSQL SERVER SETTINGS
Let's say we wish to create a mysql person account to make use of for our web sites. Let's create this person now.
Login to mysql as root and run these instructions
Grant all privileges on *. * To ausername @ localhost recognized by 'theuserspassword' with grant choice;
Let's check out the packages accessible.
# Pkg-get -a | Grep apache
For this tutorial we shall be putting in apache2
# Pkg-get set up apache2
Let this run for some time and set up all wanted software program. It would take some time. Simply enter Sure to a lot of the questions.
Since we used pkg-get to put in apache2 it ought to be just about simply able to go.
Let's first create a folder to host our internet recordsdata. Since Solar Solaris likes to place a precedence of your disk area throughout set up within the / export / partition, I’ll create a www folder within the / export folder.
# Mkdir / export / www /
Now let's edit the config file which is positioned right here:
Bash-Three.00 # emacs /decide/csw/apache2/and many others/httpd.conf
Change the variables you wish to set. I just about simply set the ServerName and ServerAdmin variables and adjusted the doc root to a distinct place then the default. Seek for the key phrases to find the portion of the config file to alter.
DocumentRoot "/ decide / csw / apache2 / share / htdocs"
I modified this to DocumentRoot "/ export / www"
And you must change the Listing itemizing as properly
# This ought to be modified to no matter you set DocumentRoot to
Let's edit the kind of recordsdata we are going to serve with our internet server. Seek for DirectoryIndex. It ought to appear like this:
Let's add another pages to serve.
DirectoryIndex index.html index.php index.htm
You possibly can add your digital hosts to the top of this file as you want as properly. Extra on this later.
Now let's restart the apache2 server.
Let's examine to ensure it's loaded
# Svcs | Grep apache
If the response you get is the next then it's already working, be certain it's the cswapache2 service that’s working.
On-line 18:03:03 svc: / community / http: cswapache2
If it's not enabled and working it is best to problem the next command and examine once more:
# Svcadm allow -rs cswapache2
Since we made modifications to the httpd.conf file we must always problem a restart command.
# Svcadm restart cswapache2
We ought to be able to go. Because the listing has no recordsdata in it but, when you go to your browser and sort the IP tackle of your Solaris server it is best to get a response with one thing like this:
Index of /
Congratulations! You might have now gotten your apache server working.
Now let's set up php5.
# Pkg-get -i php5
# Pkg-get -i ap2_modphp5 mod_php5 php5_curl php5_gd php5_mcrypt php5_mysql php5_mysqli phpmyadmin
Let this set up and ensure to hit "Y" to proceed with the set up.
Let's now configure our configuration file.
# Emacs /decide/csw/php5/lib/php.ini
You have to to uncomment the next line (simply take away the semicolon):
; Extension = php_mysql.dll
Change the next three traces to match the under traces within the php.ini file
Max_execution_time = 6000; Most execution time of every script, in seconds
Max_input_time = 6000; Most period of time every script could unfold parsing request information
Memory_limit = 128M; Most quantity of reminiscence a script could eat
After you make any modifications to the php.ini file you will want to reboot the apache server.
Restart the apache server by issuing the command:
# Svcadm restart cswapache2
Now let's check to ensure php is working. Let's create a file in our apache default listing.
# Emacs /export/www/index.php
Then kind the next in that doc:
Save this file and once more level your internet browser to your Solaris server's IP tackle. You need to now get a pleasant php information web page loading. Congratulations you’ve now setup your SAMP server.
Let's set up VSFTP
# Pkg-get -i vsftpd
Let's first edit the vsftpd config file. It would be best to allow the choices to permit native customers to connect with the server.
# Emacs /decide/csw/and many others/vsftpd/vsftpd.conf
It would be best to make the next modifications to your config file to permit your native customers to login (you may need to uncomment a few of these traces in order that they are going to be learn):
Anonymous_enable = NO
Local_enable = YES
Write_enable = YES
Uncomment the xferlog_file
Uncomment the data_connection_timeout
Add the next line:
Chroot_local_user = YES
This can pressure the native person that logs in to be chrooted to his / her dwelling listing.
The FTP server logs the person into the house listing specified by the / and many others / passwd file so it is advisable be certain the paths are right.
Let's see if vsftp is working:
# Svcs | Grep vsftpd
It ought to be in a web-based state.
Since we made modifications to the vsftp config file let's restart the vsftpd server.
# Svcadm restart cswvsftpd
Since we have now already put in phpmyadmin with pkg-get it ought to already be positioned on our server. You are able to do a discover to find the folder, nevertheless it ought to be within the default folder. Let's transfer it to our www folder
#mv / decide / csw / apache2 / share / htdocs / phpmyadmin / export / www / phpmyadmin
Now it is best to have the ability to load up phpmyadmin by going to http: // yourserverip / phpmyadmin
Let's edit our config file:
# Cp /export/www/phpmyadmin/config.pattern.inc.php /export/www/phpmyadmin/config.inc.php
# Emacs /export/www/phpmyadmin/config.inc.php
It would be best to edit the next traces:
$ Cfg ['blowfish_secret'] = 'putanythinghere'; / * YOU MUST FILL IN THIS FOR COOKIE AUTH! * /
// $ cfg ['Servers'] [$ i] ['controluser'] = 'amysqlusername';
// $ cfg ['Servers'] [$ i] ['controlpass'] = 'amysqlpassword';
After this, your all set! Simply return to the URL http: // yourserverip / phpmyadmin
Now it ought to hook up with your mysql server and offer you a login display. Login along with your mysql person and every little thing ought to be working at this level.
That concludes this tutorial.