Download | $ lynx http://httpd.apache.org/download.cgi |
Extract | $ gzip -d httpd-NN.tar.gz |
Configure | $ ./configure --prefix=PREFIX |
Compile | $ make |
Install | $ make install |
Customize | $ viPREFIX/conf/httpd.conf |
Test | $PREFIX/bin/apachectl -k start |
solaris 10下samp配置
本人安装的是完全版的solaris 10,之前装的core版因依赖太多,最终还是没有编译成功。其实在solaris下安装和linux下安装过程没有什么不同
使用的软件包:官网下载的,apache2.2.14 mysql-5.1.42-solaris10-i386 php-5.2.12
编译安装php提示系统中没有安装:autoconf libgcc libiconv libintl,这些软件在http://www.sunfreeware.com/indexintel10.html里找到下载安装就可以了。
我首先安装的是mysql,直接安装包解压后的 INSTALL-BINARY 的描述安装就好了
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
之后更改下密码:
./bin/mysqladmin -u root password 'new-password'
二,安装apache:
#tar xvf /tmp/httpd-2.2.14.tar
#./configure "--prefix=/usr/local/apache2" "--enable-module=so" "--enable-deflate=shared" "--enable-expires=shared" "--enable-rewrite=shared" "--enable-static-support" "--enable-static-htpasswd" "--enable-static-htdigest" "--enable-static-rotatelogs" "--enable-static-logresolve" "--enable-static-htdbm" "--enable-static-ab" "--enable-static-checkgid" "--disable-userdir"
(没有特殊需要直接#./configure "--prefix=/usr/local/apache2" "--enable-module=so" 就ok的)
#make clean #如果曾经make过
#make
#make install
三,安装php
#tar xvf php-5.2.12.tar
#cd php-5.2.12
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
./configure --prefix=/opt/apache2.2/php --with-apxs2=/opt/apache2.2/bin/apxs --with-mysql=/usr/local/mysql/ --enable-mbstring --with-mysqli=/usr/local/mysql/bin/mysql_config --with-jpeg-dir=/usr/local/jpeg/ --with-zlib --with-gd=/usr/local/ --with-png-dir=/usr/local/png/
./configure --prefix=/opt/apache2.2/php \
--with-apxs2=/opt/apache2.2/bin/apxs \
--with-mysql=shared,/usr/local/mysql \
--with-mysqli=shared,/usr/local/mysql/bin/mysql_config \
--with-pdo-mysql=shared,/usr \
--with-pear \
--with-openssl=shared \
--with-zlib=shared \
--enable-bcmath \
--with-bz2=shared \
--enable-calendar \
--with-curl=shared \
--enable-exif \
--enable-ftp \
--with-gd=shared \
--enable-gd-native-ttf \
--with-gettext=shared \
--with-gmp=shared \
--with-imap=shared \
--with-kerberos \
--with-imap-ssl \
--enable-intl \
--with-ldap=shared \
--enable-mbstring \
--with-mcrypt=shared \
--with-mhash \
--with-mm=shared \
--enable-soap \
--enable-sockets \
--with-tidy=shared \
--enable-wddx \
--with-xsl=shared \
--enable-zip \
--enable-shared
#make clean #如果曾经make过
#make
#make install
#cp php.ini-dist /usr/local/php/lib/php.ini
四,重新配置apache
配置 httpd.conf 让apache支持PHP
# vi /usr/local/apache2/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
然后重新启动apache
#bin/apachectl stop
#bin/apachectl start
在站点目录添加一个php文件,里面的内容包括:
<html><body><h1>It works!</h1>
<? phpinfo(); ?>
</body></html>
然后通过浏览器访问,能出现类似下面的也没就成功了,接下来就可以布置你的网站了