Solaris 10 OS如何迅速安装Apache + Mysql + php
发布时间:2021-12-21 00:15:43 所属栏目:MySql教程 来源:互联网
导读:小编给大家分享一下Solaris 10 OS如何快速安装Apache + Mysql + php,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧! 设定、测试与启动 Apache2 Solaris 10 已经内置安装了 Apache 2.xx,只需要做一些设定便可以使用。 1. 首先用 Root 了登
小编给大家分享一下Solaris 10 OS如何快速安装Apache + Mysql + php,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧! 设定、测试与启动 Apache2 Solaris 10 已经内置安装了 Apache 2.xx,只需要做一些设定便可以使用。 1. 首先用 Root 了登入文字模式系统 ( Console Mode ) 2. 复制 /etc/apache2/httpd.conf-example 到 /etc/apache2/httpd.conf # cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf 3. 编辑 /etc/apache2/httpd.conf ·设定你所需要的 ServerName 服务器名称,预设为 127.0.0.1 ·在 ServerAdmin 设定正确的 E-mail 地址 4. 使用以下指令启动 Apache # svcadm enable apache2 然后,试一试从新启动 Solaris ,看一看 Apache 能不自动启动。基本网页文件位置为 /var/apache2/htdocs 。 设定、测试与启动 MySQL Solaris 10 已经内置安装了 MySQL。安装者必须要用 Root 身份登入系统。以下的安装步骤可以在 /usr/sfw/src/mysql/Docs 目录中找到。 1.用 root 身份 login 到 Console mode 中,并且进行数据库的事前准备。BmXLinux联盟 # /usr/sfw/bin/mysql_install_dbBmXLinux联盟 Preparing db tableBmXLinux联盟 Preparing host tableBmXLinux联盟 Preparing user tableBmXLinux联盟 Preparing func tableBmXLinux联盟 Preparing tables_priv tableBmXLinux联盟 Preparing columns_priv tableBmXLinux联盟 Installing all prepared tablesBmXLinux联盟 060118 21:24:03 /usr/sfw/sbin/mysqld: Shutdown CompleteBmXLinux联盟 2.建立 mysql user 和 group ,并且更改数据目录的群组。BmXLinux联盟 # groupadd mysqlBmXLinux联盟 # useradd -g mysql mysqlBmXLinux联盟 # chgrp -R mysql /var/mysqlBmXLinux联盟 # chmod -R 770 /var/mysqlBmXLinux联盟 # installf SUNWmysqlr /var/mysql d 770 root mysql 3.预设 MySQL 设定文件位置为 /var/mysql/my.cnf 4.复制 MySQL 设定文件到预设位置BmXLinux联盟 # cp /usr/sfw/share/mysql/my-medium.cnf /var/mysql/my.cnf 5.手动启动 mysqlBmXLinux联盟 # /usr/sfw/sbin/mysqld_safe --user=mysql & 6.设定 MySQL 的 root user密码 ( 下文中的 new-password 为你想要的密码,你可以自行更改为你喜欢的密码。因为安全理由,切密不要使用 new-password 为你的密码,一定要更改 ) BmXLinux联盟 # cd /usr/sfw/binBmXLinux联盟 # ./mysqladmin -u root password 'new-password'BmXLinux联盟 # ./mysqladmin -u root -h `hostname` password 'new-password' 7.测试 MySQL ServerBmXLinux联盟 # ./mysqlshow -pBmXLinux联盟 Enter password: new-passwordBmXLinux联盟+-----------+BmXLinux联盟| Databases |BmXLinux联盟+-----------+BmXLinux联盟| mysql |BmXLinux联盟| test |BmXLinux联盟+-----------+BmXLinux联盟 # ./mysql -u root -pBmXLinux联盟 Enter password: new-passwordBmXLinux联盟 Welcome to the MySQL monitor. Commands end with ; or g.BmXLinux联盟 Your MySQL connection id is 3 to server version:4.0.20-standardBmXLinux联盟 Type 'help;' or 'h' for help. Type 'c' to clear the buffer.BmXLinux联盟 BmXLinux联盟 mysql> show databases;BmXLinux联盟+-----------+BmXLinux联盟| Databases |BmXLinux联盟+-----------+BmXLinux联盟| mysql |BmXLinux联盟| test |BmXLinux联盟+-----------+BmXLinux联盟 2 rows in set (0.00 sec)BmXLinux联盟 BmXLinux联盟 mysql> quit;BmXLinux联盟 Bye 9.然后,试一试从新启动 Solaris ,看一看 MySQL 能不自动启动。预设 MySQL 设定文件位置为 /var/mysql/my.cnf 。 下载与设定 PHP 1.用 root 身份 login 到 Console mode 中。 2.检查清楚 PATH 是否包含 /opt/csw/bin 和 /usr/sfw/bin,如果没有,请自行加上。BmXLinux联盟 # bash BmXLinux联盟 # export PS1='u:w#'BmXLinux联盟 root:/# echo $PATHBmXLinux联盟 /opt/csw/bin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin 3.安装 pkg-getBmXLinux联盟 root:/# mkdir /usr/local/srcBmXLinux联盟 root:/# cd /usr/local/srcBmXLinux联盟 root:/usr/local/src# wget http://www.blastwave.org/pkg_get.pkgBmXLinux联盟 root:/usr/local/src# cp pkg_get.pkg ..BmXLinux联盟 root:/usr/local/src# pkgadd -d pkg_get.pkg all BmXLinux联盟 BmXLinux联盟 You may use and copy this software without charge, as you see fit.BmXLinux联盟 The software is copyright (C) Philip Brown, Nov 2002BmXLinux联盟 BmXLinux联盟 Dont forget to update /opt/csw/etc/pkg-get.conf with your nearest archive site.BmXLinux联盟 The selected base directorymust exist before installationBmXLinux联盟 is attempted.BmXLinux联盟 BmXLinux联盟 Do you want this directory created now [y,n,?,q] yBmXLinux联盟 Usingas the package base directory.BmXLinux联盟 ## Processing package information.BmXLinux联盟 ## Processing system information.BmXLinux联盟 2 package pathnames are already properly installed.BmXLinux联盟 ## Verifying disk space requirements.BmXLinux联盟 ## Checking for conflicts with packages already installed.BmXLinux联盟 ## Checking for setuid/setgid programs.BmXLinux联盟 BmXLinux联盟 This package contains scripts which will be executed with super-userBmXLinux联盟 permission during the process of installing this package.BmXLinux联盟 BmXLinux联盟 Do you want to continue with the installation of[y,n,?] yBmXLinux联盟 BmXLinux联盟 Installing pkg_get - CSW version of automated package download tool asBmXLinux联盟 BmXLinux联盟 ## Installing part 1 of 1.BmXLinux联盟 /opt/csw/bin/pkg-getBmXLinux联盟 /opt/csw/etc/pkg-get.conf.cswBmXLinux联盟 /opt/csw/share/man/man1m/pkg-get.1mBmXLinux联盟 /var/pkg-get/admin-fullautoBmXLinux联盟 [ verifying class]BmXLinux联盟 ## Executing postinstall script.BmXLinux联盟 BmXLinux联盟 Installing /opt/csw/etc/pkg-get.conf.csw to pkg-get.confBmXLinux联盟 Installation ofwas successful.BmXLinux联盟 BmXLinux联盟 root:/usr/local/src# cd /BmXLinux联盟 root:/# 4.检查是否安装好 pkg-get 和 wget的位置 BmXLinux联盟 root:/# which pkg-getBmXLinux联盟 /opt/csw/bin/pkg-getBmXLinux联盟 root:/# which wgetBmXLinux联盟 /usr/sfw/bin/wget 5.安装完整的 wget 软件BmXLinux联盟 root:/# pkg-get -i wgetBmXLinux联盟注意:将会出现大量文字,不用担心,只要完成安装就可以。 6.移除旧版本的 wgetBmXLinux联盟 root:/# cd /usr/sfw/binBmXLinux联盟 root:/usr/sfw/bin# mv wget wget.origBmXLinux联盟 root:/usr/sfw/bin# exitBmXLinux联盟 # bashBmXLinux联盟 # export PS1='u:w#'BmXLinux联盟 root:/# 7.检查wget新的位置是否正确BmXLinux联盟 root:/# which wgetBmXLinux联盟 /opt/csw/bin/wget 8.检查 GNU Autoconf 的版本是否为 2.59 或以上BmXLinux联盟 root:/# which autoconf && autoconf --version | head -2BmXLinux联盟 /opt/csw/bin/autoconfBmXLinux联盟 autoconf (GNU Autoconf) 2.59BmXLinux联盟 Written by David J. MacKenzie and Akim Demaille.BmXLinux联盟如果不是为 2.59 或以上版本或根本没有这个程序,执行以下指令:BmXLinux联盟 root:/# pkg-get -i autoconf (编辑:好传媒网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |