This instruction assumes that you have basic knowledge of the use of Unix and / Or Linux And you have already installed and installed your Sun Solaris server. If you do not, please check my other instructions to install a Sun Solaris server and return to this instruction. I'll be here waiting for you!
Okay, have started, and as always, suppose you've installed and got pkg-working with blastwave as a reflection.
Let's take a look at the available packages to install first.
# Pkg-get -a | Grep mysql
This should produce a good list of packages. I am going to install mysql 5 for this instruction.
# Pkg-get set up mysql5
This should install some packages that mysql will depend on. So let it run for a while, it may take some time after you connect to your internet. Go ahead and select "y" for all questions.
It should be done successfully and say something like this:
Bash-3.00 # ## Implementing postinstall script.
Bash-3.00 # Configure Service in SMF
MySQL 5 is using a service management system. FMRI is:
Svc: / net / cswmysql5: default
No database was found in the default location.
If you need to build the original database,
See / select / csw / mysql5 / share / mysql / quick_start-csw
If you are using location database location, start mysql manually.
Now it's not good. It even went ahead and created our SMF file so we can use the Solaris 10 SMF system. But you will notice that it could not find the database. That's what we're going to do next. We intend to use the blastwave configuration script. Run it at the place mentioned above:
Bash-3.00 # / opt / csw / mysql5 / share / mysql / quick_start-csw
Then you should get a little output on Your terminal looks like this:
This is a blastwave quick start script to install a MySQL5 database directory.
The basic file is / opt / csw / mysql5.
The default database file is / opt / csw / mysql5 / var.
If you have not installed a partition for the database and you want one; Now it's time to quit this script and create and fix the partition.
If you have not installed my.cnf file and you do not want one of the sample files; Now it's time to quit and create the file /opt/csw/mysql5/my.cnf.
Data file: Default is / opt / csw / mysql5 / var
Follow the instructions on the screen. You can go by default for everything, but you may want to choose one of my.cnf files. The default one uses min-small.cnf for a small notebook server. You may want to go with one of the default configs for a server that has more memory.
You should get performance feedback and then a message on how to run mysql server. You're almost there! Just enter the following in your management test:
# Svcadm enable cswmysql5
Then check if everything is ok.
# Svcs | Grep mysql
You should get an answer like this:
Online 0:22:05 svc: / network / cswmysql5: default
If you get another domain like offline or maintenance, it means This you have a problem and you need to check mysql log files or SMF log files to see why it's not starting.
Let's try to connect to my mysql server. Now, if your URL is like this:
/ Usr / sbin: / usr / bin: / opt / csw / bin /
You will not be able to call mysql from the command line. I would recommend adding symbolic links to mysql executable.
# ln -s / opt / csw / mysql5 / bin / mysql / opt / csw / bin / mysql
Now you can open mysql server by typing mysql.
It should be registered directly. Enter a risk to exit mysql server. Now leave a root password for my mysql server. Do the following:
# / Opt / csw / mysql5 / bin / mysqladmin-you password password and new password & # 39;
Now let's check this login:
Just try typing mysql on the management percentage and see what happens. You should be denied for the user root.
Try again as follows:
# Mysql -u root -p
Then when you request your password, enter what you add to the above command.
You should be logged in. Now you're done. You have a password that protects MySQL server and it is now running and fully functional.
ADDITIONAL MYSQL SERVER SETTINGS
Suppose we want to create mysql user account to use for our websites. Now allow to create this user.
Log in to mysql as root and run these tags
Provide all rights to *. * To username @ localhost defined with & # 39; Theuserspassword & # 39; With the strength option;
Let's look at packages that are available.
# Pkg-get -a | Grabbed apache
For this tutorial, we will be installing apache2
# Pkg-install install apache2
Let this run for a while and install all necessary software. It might take a while. Just enter Yes for most questions.
Since we used pkg-get apache2 installed, it should be rather just ready to go.
Let's first create a directory to host our web directory. Since Sun Solaris likes to put a lot of your disk space on installation / export / partition, I will create a www folder in the folder / export.
# Mkdir / export / www /
Now let's change the configuration file here:
Bash-3.00 # emacs /opt/csw/apache2/etc/httpd.conf
Change parameters as You want to put. I almost installed only the ServerName and ServerAdmin variables and changed the screen root to a different location than default. Search for keywords to find the part of the configuration file that you want to edit.
DocumentRoot "/ opt / csw / apache2 / share / htdocs"
I changed this to DocumentRoot "/ export / www"
And you must change your registration list too
# This should be changed to What you put DocumentRoot to
Let's change the type of file we will serve with our server. Search for DirectoryIndex. It should look like this:
Let's add a few other pages to serve.
DirectoryIndex index.html index.php index.htm
You can add your virtual host to the end of this file as you like. More about this later.
Now let's restart apache2 server.
Let's check if it's loaded
# Svcs | Grep apache
If the answer you receive is the following, it is already running, make sure it is the cswapache2 service that runs.
Online 18:03:03 svc: / network / http: cswapache2
If it is not possible to run then you should give the following command and check again:
# Svcadm enable – Rs Cswapache2
Since we made changes to the httpd.conf file, we should release a restart command.
# Svcadm restart cswapache2
We should be ready to go. Since the file has no files in it, you should get an answer to something like this:
Index of /
Congratulations on accessing your browser and writing the IP address Solaris server bureaus. You have now got your apache server running.
Now you can install php5.
# Pkg-get -i php5
# Pkg-get -i ap2_modphp5 mod_php5 php5_curl php5_gd php5_mcrypt php5_mysql php5_mysqli phpmyadmin
Make this set up and make sure to enter "Y" to To proceed with Setup.
Now let us set up our configuration file.
# Emacs /opt/csw/php5/lib/php.ini
You must uncomment the following line (remove only the halo):
; Surname = php_mysql.dll
Change the following three lines to match the following lines in the php.ini file
Max_execution_time = 6000; Maximum time for each script, in seconds
Max_input_time = 6000; The maximum amount of each script can spread to sort request request
Memory_limit = 128M; Maximum number of memory that a script may delete
After you make changes to the php.ini file, you must restart an apache server.
Restart the apache server by issuing the command:
# Svcadm restart cswapache2
Now you can test that PHP works. Let us create a file in our default apache apache.
# Emacs /export/www/index.php
Then enter the following in the document:
Save This Sign And re-apply the browser to your Solaris server IP address. You should now get a good PHP information page loading. Congratulations, you have now installed your SAMP server.
# Pkg-get -i vsftpd
Let's first change the vsftpd config file. You must enable the options to allow local users to connect to the server.
# Emacs /opt/csw/etc/vsftpd/vsftpd.conf
You must make the following changes to your configuration file to allow your users to log in (you may need
Local_enable = YES
Write_enable = YES
Add the following line:
Anonymous_enable = NO
Local_enable = YES:
Chroot_local_user = YES
] This will force the local user who logs in to be chrooted on their home page.
The FTP server logs the user into the homepage specified in the / etc / passwd file so you need to make sure the URLs are correct. .
Let's see if vsftp is running:
# Svcs | Grep vsftpd
It should be online.
Since we made changes On the vsftp config file we allow to restart vsftpd server.
# Svcadm Restart cswvsftpd
Since we have already installed phpmyadmin with pkg-get, it should be already on our server. You can find to find the folder, but it should be in the default folder. Let us transfer it to our www folder
#mv / opt / csw / apache2 / share / htdocs / phpmyadmin / export / www / phpmyadmin
Now you should be able to upload phpmyadmin with By visiting http: // yourserverip / phpmyadmin
Let's change our configuration file:
# Cp /export/www/phpmyadmin/config.sample.inc.php / export / www / Phpmyadmin / config.inc.php
# Emacs /export/www/phpmyadmin/config.inc.php
You must change the following lines:
$ Cfg ['blowfish_secret'] = & # 39; Setanythinghere & # 39 ;; / * You must fill in this for a cake! * /
// $ cfg ['Servers'] [$ i] ['controluser'] = & nbsp; Amysqlusername & # 39 ;;
// $ cfg ['Servers'] [$ i] ['controlpass'] = & nbsp; Amysqlpassword & # 39 ;;
After this all your set is set! Just go back to http: // yourserverip / phpmyadmin
Now you should connect to mysql server and give you a login screen. Login with mysql user and everything should work at this point.
It completes this teaching.
Source by Josh Bellendir