Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly install Apache + Mysql + php in Solaris 10 OS

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to quickly install Apache + Mysql + php in Solaris 10 OS. I hope you will get something after reading this article. Let's discuss it together.

Set up, test, and start Apache2

Solaris 10 has a built-in installation of Apache 2.xx, so you only need to make some settings to use it.

1. First, we use Root to log in to the text mode system (Console Mode).

two。 Copy / etc/apache2/httpd.conf-example to / etc/apache2/httpd.conf

# cp / etc/apache2/httpd.conf-example / etc/apache2/httpd.conf

3. Edit / etc/apache2/httpd.conf

Set the name of the ServerName server you need, default to 127.0.0.1

Set the correct E-mail address in ServerAdmin

4. Start Apache using the following instructions

# svcadm enable apache2

Then, try to restart Solaris and see if Apache starts automatically. The basic web page file location is / var/apache2/htdocs.

Set up, test, and start MySQL

MySQL is already installed in Solaris 10. The installer must log in to the system as Root. The following installation steps can be found in the / usr/sfw/src/mysql/Docs directory.

1. Login to Console mode with root identity, and prepare the database beforehand. BmXLinux Alliance

# / usr/sfw/bin/mysql_install_dbBmXLinux Alliance

Preparing db tableBmXLinux Alliance

Preparing host tableBmXLinux Alliance

Preparing user tableBmXLinux Alliance

Preparing func tableBmXLinux Alliance

Preparing tables_priv tableBmXLinux Alliance

Preparing columns_priv tableBmXLinux Alliance

Installing all prepared tablesBmXLinux Alliance

060118 21:24:03 / usr/sfw/sbin/mysqld: Shutdown CompleteBmXLinux Alliance

two。 Set up mysql user and group, and change the group of the data directory. BmXLinux Alliance

# groupadd mysqlBmXLinux Alliance

# useradd-g mysql mysqlBmXLinux Alliance

# chgrp-R mysql / var/mysqlBmXLinux Alliance

# chmod-R 770 / var/mysqlBmXLinux Alliance

# installf SUNWmysqlr / var/mysql d 770 root mysql

3. The preset MySQL setting file location is / var/mysql/my.cnf

4. Copy the MySQL configuration file to the preset location BmXLinux Alliance

# cp / usr/sfw/share/mysql/my-medium.cnf / var/mysql/my.cnf

5. Manually start the mysqlBmXLinux Alliance

# / usr/sfw/sbin/mysqld_safe-- user=mysql &

6. Set the root user password of MySQL (the following new-password is the password you want, you can change it to your favorite password. For security reasons, do not use new-password as your password, be sure to change) BmXLinux Alliance

# cd / usr/sfw/binBmXLinux Alliance

#. / mysqladmin-u root password' new-password'BmXLinux Alliance

#. / mysqladmin-u root-h `hostname` password' new-password'

7. Test MySQL ServerBmXLinux Alliance

#. / mysqlshow-pBmXLinux Alliance

Enter password: new-passwordBmXLinux Alliance +-+ BmXLinux Alliance | Databases | BmXLinux Alliance +-+ BmXLinux Alliance | mysql | BmXLinux Alliance | test | BmXLinux Alliance +-+ BmXLinux Alliance

#. / mysql-u root-pBmXLinux Alliance

Enter password: new-passwordBmXLinux Alliance

Welcome to the MySQL monitor. Commands end with; or g.BmXLinux Alliance

Your MySQL connection id is 3 to server version:4.0.20-standardBmXLinux Alliance

Type 'help;' or' h' for help. Type 'c'to clear the buffer.BmXLinux Alliance

BmXLinux Alliance

Mysql > show databases;BmXLinux Alliance +-+ BmXLinux Alliance | Databases | BmXLinux Alliance +-+ BmXLinux Alliance | mysql | BmXLinux Alliance | test | BmXLinux Alliance +-+ BmXLinux Alliance

2 rows in set (0.00 sec) BmXLinux Alliance

BmXLinux Alliance

Mysql > quit;BmXLinux Alliance

Bye

8. Set Solaris Server to run and stop MySQL Server automatically when starting and shutting down. BmXLinux Alliance

# ln / etc/sfw/mysql/mysql.server / etc/rc3.d/S99mysqlBmXLinux Alliance

# ln / etc/sfw/mysql/mysql.server / etc/rc0.d/K00mysqlBmXLinux Alliance

# ln / etc/sfw/mysql/mysql.server / etc/rc1.d/K00mysqlBmXLinux Alliance

# ln / etc/sfw/mysql/mysql.server / etc/rc2.d/K00mysqlBmXLinux Alliance

# ln / etc/sfw/mysql/mysql.server / etc/rcS.d/K00mysql

9. Then, try to restart Solaris and see if MySQL starts automatically. The default MySQL sets the file location to / var/mysql/my.cnf.

Download and set up PHP

1. Login into Console mode with root identity.

two。 Check to see if PATH contains / opt/csw/bin and / usr/sfw/bin. If not, please add it yourself. BmXLinux Alliance

# bash BmXLinux Alliance

# export PS1='u:w#'BmXLinux Alliance

Root:/# echo $PATHBmXLinux Alliance

/ opt/csw/bin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin

3. Install pkg-getBmXLinux Alliance

Root:/# mkdir / usr/local/srcBmXLinux alliance

Root:/# cd / usr/local/srcBmXLinux alliance

Root:/usr/local/src# wget http://www.blastwave.org/pkg_get.pkgBmXLinux Alliance

Root:/usr/local/src# cp pkg_get.pkg... BmXLinux Alliance

Root:/usr/local/src# pkgadd-d pkg_get.pkg all BmXLinux Alliance

BmXLinux Alliance

You may use and copy this software without charge, as you see fit.BmXLinux Alliance

The software is copyright (C) Philip Brown, Nov 2002BmXLinux Alliance

BmXLinux Alliance

Dont forget to update / opt/csw/etc/pkg-get.conf with your nearest archive site.BmXLinux alliance

The selected base directorymust exist before installationBmXLinux Alliance

Is attempted.BmXLinux Alliance

BmXLinux Alliance

Do you want this directory created now [ypenny] yBmXLinux consortium

Usingas the package base directory.BmXLinux Alliance

# # Processing package information.BmXLinux Alliance

# # Processing system information.BmXLinux Alliance

2 package pathnames are already properly installed.BmXLinux Alliance

# # Verifying disk space requirements.BmXLinux Alliance

# # Checking for conflicts with packages already installed.BmXLinux Alliance

# # Checking for setuid/setgid programs.BmXLinux Alliance

BmXLinux Alliance

This package contains scripts which will be executed with super-userBmXLinux Alliance

Permission during the process of installing this package.BmXLinux Alliance

BmXLinux Alliance

Do you want to continue with the installation of [y,n,?] YBmXLinux Alliance

BmXLinux Alliance

Installing pkg_get-CSW version of automated package download tool asBmXLinux Alliance

BmXLinux Alliance

# # Installing part 1 of 1.BmXLinux Alliance

/ opt/csw/bin/pkg-getBmXLinux Alliance

/ opt/csw/etc/pkg-get.conf.cswBmXLinux Alliance

/ opt/csw/share/man/man1m/pkg-get.1mBmXLinux Alliance

/ var/pkg-get/admin-fullautoBmXLinux Alliance

[verifying class] BmXLinux Alliance

# # Executing postinstall script.BmXLinux Alliance

BmXLinux Alliance

Installing / opt/csw/etc/pkg-get.conf.csw to pkg-get.confBmXLinux alliance

Installation ofwas successful.BmXLinux Alliance

BmXLinux Alliance

Root:/usr/local/src# cd / BmXLinux alliance

Root:/#

4. Check whether the location of pkg-get and wget is installed BmXLinux Alliance

Root:/# which pkg-getBmXLinux Alliance

/ opt/csw/bin/pkg-getBmXLinux Alliance

Root:/# which wgetBmXLinux Alliance

/ usr/sfw/bin/wget

5. Install the complete wget software BmXLinux consortium

Root:/# pkg-get-I wgetBmXLinux Alliance Note: there will be a lot of text, don't worry, just finish the installation.

6. Remove the old version of the wgetBmXLinux Alliance

Root:/# cd / usr/sfw/binBmXLinux alliance

Root:/usr/sfw/bin# mv wget wget.origBmXLinux Alliance

Root:/usr/sfw/bin# exitBmXLinux Alliance

# bashBmXLinux Alliance

# export PS1='u:w#'BmXLinux Alliance

Root:/#

7. Check that wget's new location is correct. BmXLinux Alliance.

Root:/# which wgetBmXLinux Alliance

/ opt/csw/bin/wget

8. Check whether the version of GNU Autoconf is 2.59 or above BmXLinux federation

Root:/# which autoconf & & autoconf-- version | head-2BmXLinux Alliance

/ opt/csw/bin/autoconfBmXLinux Alliance

Autoconf (GNU Autoconf) 2.59BmXLinux Alliance

Written by David J. MacKenzie and Akim Demaille.BmXLinux federation if it is not for version 2.59 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I autoconf

9. Check whether the version of GNU automake is 1.8.3 or above BmXLinux federation

Root:/# which automake & & automake-- version | head-2BmXLinux Alliance

/ opt/csw/bin/automakeBmXLinux Alliance

Automake (GNU automake) 1.8.3BmXLinux Alliance

If the Written by Tom Tromey.BmXLinux federation is not for version 1.8.3 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I automake

10. Check whether the version of GNU sed version is 4.1.4 or above BmXLinux federation

Root:/# which gsed & & gsed-- version | head-2BmXLinux Alliance

/ opt/csw/bin/gsedBmXLinux Alliance

GNU sed version 4.1.4BmXLinux Alliance

Copyright (C) 2003 Free Software Foundation, if the Inc.BmXLinux federation is not for version 4.1.4 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gsed

11. Check whether the version of gcc is 3.4.3 or above BmXLinux federation

Root:/# which gcc & & gcc-- version | head-2BmXLinux Alliance

/ usr/sfw/bin/gccBmXLinux Alliance

Gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath) BmXLinux Alliance

Copyright (C) 2004 Free Software Foundation, if the Inc.BmXLinux federation is not for version 3.4.3 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gcc

twelve。 Check whether the version of GNU Make is 3.80 or above BmXLinux federation

Root:/# which gmake & & gmake-- version | head-2BmXLinux Alliance

/ usr/sfw/bin/gmakeBmXLinux Alliance

GNU Make 3.80BmXLinux Alliance

Copyright (C) 2002 Free Software Foundation, if the Inc.BmXLinux federation is not for version 3.80or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gmake

13. Check whether the version of flex version is 2.5.4 or above BmXLinux federation

Root:/# which flex & & flex-- version | head-2BmXLinux Alliance

/ usr/sfw/bin/flexBmXLinux Alliance

If the flex version 2.5.4BmXLinux federation is not for version 2.5.4 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I flex

14. Check whether the version of GNU Bison is 1.875 or above BmXLinux federation

Root:/# which bison & & bison-- version | head-2BmXLinux Alliance

/ usr/sfw/bin/bisonBmXLinux Alliance

Bison (GNU Bison) 1.875BmXLinux Alliance

If the Written by Robert Corbett and Richard Stallman.BmXLinux federation is not for version 1.875 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I bison

15. Check whether the version of GNU M4 is 1.4.3 or above BmXLinux federation

Root:/# which gm4 & & gm4-- version | head-2BmXLinux Alliance

/ opt/csw/bin/gm4BmXLinux Alliance

GNU M4 1.4.3BmXLinux Alliance

If the Written by Rene' Seindal.BmXLinux federation is not for version 1.4.3 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gm4

16. Check whether the version of Perl is 5.8or above BmXLinux federation

Root:/# which perl & & perl-v | head-2BmXLinux Alliance

/ usr/bin/perl BmXLinux Alliance

This is perl, v5.8.4built for i86pc-solaris-64intBmXLinux federation if it is not for version 5.8 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I perl

17. Check whether the version of GNU zip is 1.3.3 or above BmXLinux federation

Root:/# which gunzip & & gunzip-V | head-2BmXLinux Alliance

/ usr/bin/gunzipBmXLinux Alliance

Gunzip 1.3.3-patch.1BmXLinux Alliance

(2002-03-08) if the BmXLinux federation is not for version 1.3.3 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gunzip

18. Check whether the version of GNU tar is 1.14 or above BmXLinux federation

Root:/# which gtar & & gtar-- version | head-2BmXLinux Alliance

/ usr/sfw/bin/gtarBmXLinux Alliance

Tar (GNU tar) 1.14BmXLinux Alliance

Copyright (C) 2004 Free Software Foundation, if the Inc.BmXLinux federation is not for version 1.14 or above or does not have this program at all, execute the following instructions: BmXLinux federation

Root:/# pkg-get-I gtar

19. Install the libxml2 version of 2.6.23BmXLinux Alliance

Before installing libxml2, it is important to note that this program cannot be installed on Driver that requires mount. BmXLinux federation because, when starting Solaris, you need to use libxml2 directly when performing automatic startup of Apache/php, but at this time, mount Driver is not started yet. Most of the time, the BmXLinux Alliance has a habit of putting / usr/local on mount driver. If you have the same habit, please be careful not to install libxml2 on / usr/local. BmXLinux Alliance otherwise, when the Solaris is started, the Apache/php cannot be started automatically and can only be started manually. BmXLinux Alliance under normal circumstances, install libxml2, the default installation path for the installer is / usr/local, which can be changed. The following example of BmXLinux Alliance will install libxml2 on / usr/slocal. BmXLinux Alliance

Root:/# cd / usr/local/srcBmXLinux alliance

Root:/usr/local/src# wget ftp://xmlsoft.org/libxml2/libxml2-2.6.23.tar.gzBmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/local/src# mkdir / usr/slocalBmXLinux alliance

Root:/usr/local/src# cp libxml2-2.6.23.tar.gz / usr/slocal/BmXLinux Alliance

Root:/usr/local/src# cd / usr/slocal BmXLinux alliance

Root:/usr/slocal# gunzip-cd libxml2-2.6.23.tar.gz | gtar xvpf-BmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/slocal# cd libxml2-2.6.23BmXLinux Alliance

Root:/usr/slocal/libxml2-2.6.2 alliance. / configure-- prefix=/usr/slocalBmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/slocal/libxml2-2.6.2alliance of gmake BmXLinux

... BmXLinux Alliance.

Root:/usr/slocal/libxml2-2.6.2percent gmake install

20. If this file / etc/apache2/httpd.conf BmXLinux federation is not available in the system

Root:/# cp / etc/apache2/httpd.conf-example / etc/apache2/httpd.conf Editor / etc/apache2/httpd.conf

§set the name of the ServerName server you need, default to 127.0.0.1

§set the correct E-mail address in ServerAdmin

21. Download the latest version of PHP (http://www.php.net/downloads.php) BmXLinux Alliance

Root:/# cd / usr/local/srcBmXLinux alliance

Root:/usr/local/src# wget http://hk.php.net/get/php-5.1.2.tar.gz/from/this/mirrorBmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/local/src# cp php-5.1.2.tar.gz.. BmXLinux Alliance

Root:/usr/local/src# cd.. BmXLinux Alliance

Root:/usr/local# gunzip-cd php-5.1.2.tar.gz | gtar xvpf-BmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/local# cd php-5.1.2BmXLinux Alliance

Root:/usr/local/php-5.1.2#. / configure-with-apxs2=/usr/apache2/bin/apxs BmXLinux Alliance

-with-mysql=/usr/sfw/-enable-dbase-with-libxml-dir=/usr/slocal BmXLinux Alliance

-- with-config-file-path=/etc/apache2-- with-gd-dir=/opt/sfw/bin BmXLinux Alliance

With-jpeg-dir=/usr/lib-- with-png-dir=/usr/lib-- with-zlib-- enable-mbstring BmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/local/php-5.1.2# gmakeBmXLinux Alliance

... BmXLinux Alliance.

Root:/usr/local/php-5.1.2# gmake install

Installing PHP SAPI module:.

Root:/usr/local/php-5.1.2# cp php.ini-dist / etc/apache2/php.iniBmXLinux alliance

Root:/usr/local/php-5.1.2#

twenty-two。 Enter the apache2 configuration file directory BmXLinux alliance

Root:/usr/local/php-5.1.2# cd / etc/apache2BmXLinux alliance

Root:/etc/apache2#

23. If you want to set options for other php, edit / etc/apache2/php.ini

24. Edit httpd.conf file BmXLinux Alliance after installing php, php will add the following sentence to / etc/apache2/httpd.conf, please check whether this sentence exists: BmXLinux Alliance

LoadModule php5_module libexec/libphp5.so BmXLinux Alliance Please manually add the following sentence to the last line of / etc/apache2/httpd.conf: BmXLinux Alliance AddType application/x-httpd-php .php

25. Launch the Apache2 and Test BmXLinux Alliance

# svcadm enable apache2BmXLinux Alliance

# svcs | grep-I apache2BmXLinux Alliance

Online 18:07:10 svc:/network/http:apache2

twenty-six。 Then, try to restart Solaris and see if Apache2 starts automatically. If it cannot be started automatically, but can only be started manually, please read the description of item 19 clearly. BmXLinux Alliance preset Apache2 sets the file location to / etc/apach3/httpd.conf.

After reading this article, I believe you have a certain understanding of "Solaris 10 OS how to quickly install Apache + Mysql + php". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report