免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3350 | 回复: 6
打印 上一主题 下一主题

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-03-30 16:38 |只看该作者 |倒序浏览
AMPS - Apache MySQL PHP Solaris 8 Installation
This page briefly documents the installation of Apache 2.0.xx, MySQL 4.0.xx and PHP 5.0.x on Sparc Solaris 8.
Disclaimer
Rapid revision is the nature of Open Source products and the versions I refer to in this document are probably already outdated. Therefore, I am not sharing this information with the promise that I will keep it current or am in any way obligated for any problems you may encounter. Because there was not much in the way of Solaris specific integration information available, I have decided to share what has worked for me in this instance. You are welcome to make use of this information at your own risk. Please exercise caution -- especially if you are unsure of the consequences of issuing certain commands with Systems Administrator priviledges. Most of the command examples can be cut and pasted, but you should Read The Fine Manual pages if you are not familiar with the possible consequences.
Assumptions:
Specific version numbers will probably have changed.
Installations are done using ksh as superuser (root).
lines starting with #: are literal examples of root commands.
Variable parameters that may be specific to your installation are shown in itallics.
Sparc Solaris 8 installed with most recent recommended patches:
#: uname -a
SunOS hostname 5.8 Generic_117000-03 sun4u sparc SUNW,UltraAX-i2
A source or build directory exists on a filesystem with plenty of free space:
#: mkdir /build
#: cd /build
Steps:
Verify all of the following SUNW* developer packages have been installed:
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWsprot
SUNWtoo
Sample command line to determine if package SUNWarc is installed:
#: pkginfo | grep SUNWarc
system SUNWarc Archive Libraries
system SUNWarcx Archive Libraries (64-bit)

Missing packagages may be found on the Solaris 8 installation CDs

The $PATH environmental variable for root should begin with the following:
/usr/local/bin
/usr/local/sbin
/usr/ccs/bin
#: echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/ccs/bin:/usr/sbin:/usr/bin

The following baseline tools are needed for this installation and are available as easily installed packages from sunfreeware.com:
perl (a suitable version is usually already installed)
#: perl -v
This is perl, version 5.005_03 built for sun4-solaris
gunzip or gzip (a suitable version is usually already installed)
#: gunzip -V
gunzip 1.2.4 (18 Aug 93)

libiconv (downloaded current version of package from sunfreeware.com)
#: gunzip libiconv-1.8-sol8-sparc-local.gz
#: pkgadd -d libiconv-1.8-sol8-sparc-local

gcc (downloaded current version of package from sunfreeware.com)
#: gunzip gcc-3.4.1-sol8-sparc-local.gz
#: pkgadd -d gcc-3.4.1-sol8-sparc-local
#: gcc --version
gcc (GCC) 3.4.1

libgcc (should be installed as part of the gcc package - located in /usr/local/lib)
Now, set these Environmental Variables:
#: CXX=`which gcc`; export CXX
#: CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
#: export CXXFLAGS
#: CC=`which gcc`; export CC
#: CFLAGS="-O3"; export CFLAGS
#: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/ssl/lib
#: export LD_LIBRARY_PATH
gmake (downloaded current version of package from sunfreeware.com)
#: gunzip make-3.80-sol8-sparc-local.gz
#: pkgadd -d make-3.80-sol8-sparc-local
After you install the GNU counterpart of a Solaris program (e.g. tar and make), be sure that your $PATH environmental variable selects the GNU version first.
#: make --version
GNU Make 3.80

gnu tar (make sure /usr/local/bin is found early in root's $PATH)
#: gunzip tar-1.14-sol8-sparc-local.gz
#: pkgadd -d tar-1.14-sol8-sparc-local
#: tar --version
tar (GNU tar) 1.14
flex (downloaded current version of package from sunfreeware.com)
#: gunzip flex-2.5.31-sol8-sparc-local.gz
#: pkgadd -d flex-2.5.31-sol8-sparc-local
#: flex --version
flex 2.5.31
bison (downloaded current version of package from sunfreeware.com)
#: gunzip bison-1.875d-sol8-sparc-local.gz
#: pkgadd -d bison-1.875d-sol8-sparc-local
#: bison --version
bison (GNU Bison) 1.875d
m4 (downloaded current version of package from sunfreeware.com)
#: gunzip m4-1.4.1-sol8-sparc-local.gz
#: pkgadd -d m4-1.4.1-sol8-sparc-local
#: m4 --version
GNU m4 1.4.1
autoconf (downloaded current version of package from sunfreeware.com)
#: gunzip autoconf-2.59-sol8-sparc-local.gz
#: pkgadd -d autoconf-2.59-sol8-sparc-local
#: autoconf --version
autoconf (GNU Autoconf) 2.59
automake (downloaded current version of package from sunfreeware.com)
#: gunzip automake-1.8b-sol8-sparc-local.gz
#: pkgadd -d automake-1.8b-sol8-sparc-local
#: pkginfo | grep -i automake
application SMCautom automake
GNU sed (downloaded current version of package from sunfreeware.com)
#: gunzip sed-4.0-sol8-sparc-local.gz
#: pkgadd -d sed-4.0-sol8-sparc-local
#: sed --version
GNU sed version 4.0
upgrade zlib to version 1.1.4 or greater. (downloaded current version of package from sunfreeware.com)
#: gunzip zlib-1.2.1-sol8-sparc-local.gz
#: pkgadd -d zlib-1.2.1-sol8-sparc-local
Test the installation of baseline tools by builing libxml2 from source:
Download the latest version from: ftp://xmlsoft.org/
#: gunzip -dc libxml2-2.6.11.tar.gz | tar xvpf -
#: cd libxml2-2.6.11
#: ./configure
#: make
#: make install

Add /dev/random functionality to Solaris 8 if it doesn't already exist.
A /kernel/drv/random patch is available from SunSolve Patch Access. An earlier versions of this patch created /dev/random. To find the SPARC/Solaris 8 patch, type 112438-03 into the SunSolve Patch Access "Enter a PatchID" search window and click the Find Patch button. This will take you to the page where the patch is described and where the patch download links are. Download the patch and install it as indicated in the instructions.
#: cd /build
#: unzip 112438-03.zip
#: patchadd ./112438-03
You will probably need to reboot your system.
#: reboot -- -r

#: cd /build

If this doesn't work (/kernel/drv/random isn't created or patch doesn't install for some reason), here is an alternative:
download ANDIrand-0.7-5.8-sparc-1 from: http://www.cosy.sbg.ac.at/~andi/SUNrand/
#: pkgadd -d ANDIrand-0.7-5.8-sparc-1

If /dev/random still doesn't exist, but /kernel/drv/random does:
#: ln -s /kernel/drv/random /dev/random

OpenSSL Installation
Download the latest OPENSSL source: http://www.openssl.org/
#: gunzip -c openssl-0.9.7d.tar.gz | tar xvpf -
#: cd openssl-0.9.7d
#: cp Makefile Makefile.orig
#: vi Makefile
replace "RANLIB=/usr/bin/ranlib" with "RANLIB=/usr/ccs/bin/ranlib"

If you successfully implemented /dev/random, add the line:
"DEVRANDOM= /dev/random"
OR
"DEVRANDOM= /kernel/drv/random"

Make sure "ERL=" is set to the fully qualified path of perl program.
Save changes and exit vi


#: ./config --prefix=/usr/local/ssl -fPIC
#: make
#: make test
#: make install
#: cd ..

MySQL installation
Create a pseudo user to run mysql:
#: cd /build
#: groupadd mysql
#: useradd -g mysql mysql
Download the latest MySQL binary for Solaris 8 from: http://www.mysql.com/
#: gunzip mysql-standard-4.0.20-sun-solaris2.8-sparc.tar.gz
#: cd /usr/local
#: tar xvpf /build/mysql-standard-4.0.20-sun-solaris2.8-sparc.tar
To complete the installation of binary MySQL:
#: ln -s mysql-standard-4.0.20-sun-solaris2.8-sparc mysql
#: cd mysql
#: scripts/mysql_install_db --user=mysql
#: chown -R root /usr/local/mysql
#: chown -R mysql /usr/local/mysql/data
#: chgrp -R mysql /usr/local/mysql
#: cp support-files/my-medium.cnf /etc/my.cnf
Try to start the MySQL server:
#: cd /usr/local/mysql/bin
#: ./mysqld_safe --user=mysql&
Set the root MySQL user password and run a few quick tests:
#: ./mysqladmin -u root password 'new-password'
#: ./mysqladmin -u root -h hostname password 'new-password'
Test the server:
#: ./mysqlshow -p
Enter password: new-password
             +-----------+
             | Databases |
             +-----------+
             | mysql     |
             | test      |
             +-----------+


#: ./mysql -u root -p
Enter password: new-password
             Welcome to the MySQL monitor.  Commands end with ; or \g.
             Your MySQL connection id is 3 to server version: 4.0.20-standard
             Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

             mysql>; show databases;
             +-----------+
             | Databases |
             +-----------+
             | mysql     |
             | test      |
             +-----------+
             2 rows in set (0.00 sec)

             mysql>; quit;
             Bye

If you would like MySQL to start and stop automatically:
#: cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
#: ln /etc/init.d/mysql /etc/rc3.d/S99mysql
#: ln /etc/init.d/mysql /etc/rc3.d/K01mysql
Apache 2 installation
#: cd /build
Download the latest source from: http://httpd.apache.org
#: gzip -d httpd-2.0.50.tar.gz
#: tar xvpf httpd-2.0.50.tar
#: cd httpd-2.0.50
#: ./configure --enable-so --with-layout=Apache --enable-ssl
#: make
#: make install
Edit the Apache configuration file
#: cd /usr/local/apache2
#: vi conf/httpd.conf
Change the following line:
Group #-1
to:
Group nobody
Test start the Apache Server
#: /usr/local/apache2/bin/apachectl start
Create the SSL Key and Certificate
#: cd /usr/local/ssl/bin
#: ./openssl genrsa -des3 1024 >; /usr/local/apache2/conf/localhost.key
Generating RSA private key, 1024 bit long modulus
.......++++++
.......................++++++
e is 65537 (0x10001)
Enter pass phrase: somephrase
Verifying - Enter pass phrase: somephrase
#: ./openssl req -new -key /usr/local/apache2/conf/localhost.key >; \
/usr/local/apache2/conf/localhost.csr
#: ./openssl req -x509 -days 3650 -key \
/usr/local/apache2/conf/localhost.key \
-in /usr/local/apache2/conf/localhost.csr >; \
/usr/local/apache2/conf/localhost.crt
Modify the ssl.conf file to use your certificate.
#: cd /usr/local/apache2/conf
#: vi ssl.conf
Find the following lines in the ssl.conf file:
DocumentRoot "/usr/local/apache2/htdocs"
ServerName new.host.name:443
SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
Change the respective lines so that they are as follows:
DocumentRoot "/usr/local/apache2/htdocs-secure"
ServerName localhost:443
SSLCertificateFile /usr/local/apache2/conf/localhost.crt
SSLCertificateKeyFile /usr/local/apache2/conf/localhost.key

#: mkdir /usr/local/apache2/htdocs-secure
Create a simple home page (e.g. Home, Secure Home)
#: vi /usr/local/apache2/htdocs-secure/index.html
Save index.html and exit vi
#: chmod a+rx /usr/local/apache2/htdocs-secure/
#: chmod a+r /usr/local/apache2/htdocs-secure/index.html
Remove the encryption from the RSA private key
#: cd /usr/local/apache2/conf
#: cp localhost.key server.key.org
#: /usr/local/ssl/bin/openssl rsa -in server.key.org -out localhost.key
#: chmod 400 localhost.key
Test the Apache https server.
#: /usr/local/apache2/bin/apachectl stop
#: /usr/local/apache2/bin/apachectl startssl
Note: when the machine is rebooted, Apache will not be restarted automatically. You can manually restart Apache using:
#: /usr/local/apache2/bin/apachectl startssl
or, alternatively, this process can be made automatic by writing a script in the /etc/init.d directory and linking it to the appropriate places in /etc/rc2.d and /etc/rc3.d. See the MySQL installation notes for an example.
PHP 5 installation
#: cd /build
Download the latest production version of PHP from http://www.php.net
#: gzip -d php-5.0.0.tar.gz
#: tar xvpf php-5.0.0.tar
#: cd php-5.0.0
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql/ \
--enable-dbase --with-libxml-dir=/usr/local/include/libxml2
#: make
#: make install
#: cp php.ini-dist /usr/local/lib/php.ini
Edit the Apache configuration file to deploy PHP
#: vi /usr/local/apache2/conf/httpd.conf
Add the following line to the AddType section:
AddType application/x-httpd-php .php
check for the following line and add it if necessary:
LoadModule php5_module modules/libphp5.so
Save and exit vi
Restart Apache to load PHP
#: /usr/local/apache2/bin/apachectl restart

论坛徽章:
0
2 [报告]
发表于 2005-03-30 16:43 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

看看人家写的,XDJM应该学习呀!!!
以后一定要写名用的是什么系统,软件用的是什么版本,安装注意的地方。要不然帖了帖子别人也用不上,没意义!!!

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之上海
日期:2016-05-05 09:45:14
3 [报告]
发表于 2005-03-30 16:57 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

顶,,,,不过9的话就更好了,和和,

论坛徽章:
0
4 [报告]
发表于 2005-03-30 17:17 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

请XDJM一起努力,参照此帖写一个Solaris9下的AMPS

论坛徽章:
0
5 [报告]
发表于 2005-04-20 16:27 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

这么好的贴子为什么不加精华啊!!顶起来。

论坛徽章:
0
6 [报告]
发表于 2005-04-30 12:06 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

安装php5.0.4的时候用
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql/ \
--enable-dbase --with-libxml-dir=/usr/local/include/libxml2

通过。可是 make 时有错误。
提示错误如下:
ld: fatal: file ext/libxml/libxml.lo: unknown file type
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

该装的软件都装了啊。
这是什么原因啊

论坛徽章:
0
7 [报告]
发表于 2005-05-10 17:21 |只看该作者

AMPS - Apache MySQL PHP Solaris 8 安装说明非常详细

实在是太好了,我就按这个做的mysql,肯定要加精了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP