FreeBSD下的PostgreSQL 安裝進階

assistantashamedΔιαχείριση Δεδομένων

29 Νοε 2012 (πριν από 4 χρόνια και 11 μήνες)

203 εμφανίσεις

assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
1
-

13FreeBSD
下的
mod_php4
安裝進階

931027
修正

本安裝使用系統預設
(/usr/ports)
安裝
(
mod_php4
-
4.3.9,1

)
,安裝法較為簡單;

假設使用者已具有自行安裝能力

mod_php4

apache

php4
模組,使得
apache
伺服器能接受
php
語法;同時模
組內建了以
php4
完成的模組,以增強
apache
伺服器的功能

在安裝時會有內建模組選單,以供使用者選擇;已選定而未安裝的模組,會自動
安裝;這就是
FreeBSD

ports
安裝的幸福

預設模組有:
(
931027
修正:已無模
組出現
)

CTYPE,MYSQL,OVERLOAD,PCRE,POSIX,READLINE,SESSION

TOKENIZER,XML,ZLIB

增加模組:

FTP,GD,GETTEXT,IMAP,MBSTRING,MINE,OPENSSL

PDFLIB,POSTGRESQL,SNMP,SOCKETS,SYSVSEM,SYSVSHM,ZIP

切換到預設目錄

cd /usr/ports/www/mod_php4

看目錄內的資料:
(
可以不用
)

ls

結果如下:

Makefile README.ht
ml pkg
-
message work


編繹:
(
931027
修正:有變動
)

make

系統出現選單如下,使用預設值。

[ ] APACHE2 Use apache 2.x instead of apache 1.3.x

[ ] DEBUG Enable debug

[X] IPV6 Enable ipv6 support

編譯過程出現:

===> Installing for expat
-
1.95.8

===> Generating temporary packing

list

===> Checking if textproc/expat2 already installed

===> An older version of textproc/expat2 is already installed
(expat
-
1.95.6_1)


You may wish to ``make deinstall'' and install this port again


by ``make reinstall'' to upgrade it proper
ly.


If you really wish to overwrite the old port of textproc/expat2


without deleting it first, set the variable "FORCE_PKG_REGISTER"

assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
2
-


in your environment or the "make install" command line.

*** Error code 1

處理:先到目錄去移除舊版再重安裝

cd ../../textproc/expat2

make deinstall

make reinstall

會移除
expat
-
1.95.6_1

安裝
expat
-
1.95.8
;過程可參考文末。

切回原目錄,重編譯:

cd
/usr/ports/www/mod_php4

在過程中,系統會出現選單,自行依需要選取;
(
未選取
)

[ ] EXAMPLES install example files

[ ] HTMLMAN install man pages in HTML f
ormat

編譯完成出現下列訊息:

Build complete.

(It is safe to ignore warnings about tempnam and tmpnam).

安裝:

make install

安裝完成,可看到如下列文字:


Make sure index.php is part of your DirectoryIndex.


You should add the following lines to your Apache configuration file:


AddType

application/x
-
httpd
-
php .php

AddType application/x
-
httpd
-
php
-
source .phps


apache
伺服器會自動建立
(
apache
-
1.3.32

)


有關設定檔
(httpd.conf)
之修改,請參考:附件


安裝好了要執行:



/usr/local/etc/rc.d
的目錄下建立檔案:
apache.sh

#!/bin/sh

# [
-
d /usr/local/pgsql/lib ] && /sbin/ldconfig

m /usr/loc
al/pgsql/lib

/usr/local/apache/bin/apachectl start

設定可執行:

chmod 700 /usr/local/etc/rc.d/apache.sh


assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
3
-

附件

修改
apache
的設定檔
(

ports
安裝
)

ee

/usr/local/etc/apache/
httpd.conf

必需修改的部分如下:必需修改的部分如下:


找到:

ServerAdmin you@your.address

改成:

#
ServerAdmin you@your.address

Se
rverAdmin
www
@
localhost


找到:
(
通常不用改,如果無法啟動再作處理
)

#
ServerName new.host.name

改成:
(
伺服器名稱依實際名稱設定
)

#ServerName new.host.name

ServerName route.netpin


找到:

UserDir public_html

改成:

UserDir web

找到:

#<Directory /home/*/public_html>

# AllowOverride FileInfo AuthCon
fig Limit

# Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec

# <Limit GET POST OPTIONS PROPFIND>

# Order allow,deny

# Allow from all

# </Limit>

# <LimitExcept GET POST OPTIONS PROPFIND>

# Order deny,allow

#

Deny from all

# </LimitExcept>

#</Directory>

改成:
(
public_htm

改成

web
;取消到

</Directory>

止的#號
)

#
<Directory /home/*/public_html>

<Directory /home/*/web>


AllowOverride FileInfo AuthConfig Limit


Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec


<Limit GET POST OPTIONS PROPFIND>


O
rder allow,deny

assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
4
-


Allow from all


</Limit>


<LimitExcept GET POST OPTIONS PROPFIND>


Order deny,allow


Deny from all


</LimitExcept>

</Directory>

找到:
(931027
修正:已改,不需更動
)

DirectoryIndex index.html

改成:

DirectoryIndex index.phtml index.ht
ml index.htm

找到:
(931027
修正:已改,不需更動
)

#AddType application/x
-
httpd
-
php3 .php3

#AddType application/x
-
httpd
-
php3
-
source .phps

改成:

AddType application/x
-
httpd
-
php3

.php
.phtml
.php3

AddType application/x
-
httpd
-
php3
-
source .p
hps


assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
5
-

expat
的更新安裝過程:

regap1# make dein
stall

===> Deinstalling for textproc/expat2

===> Deinstalling expat
-
1.95.6_1

pkg_delete: package 'expat
-
1.95.6_1' is required by these other packages

and may not be deinstalled (but I'll delete it anyway):

fontconfig
-
2.2.90_3

XFree86
-
libraries
-
4.3.0_6

X
ft
-
2.1.2

XFree86
-
clients
-
4.3.0_5

XFree86
-
documents
-
4.3.0

XFree86
-
manuals
-
4.3.0

regap1# make reinstall

===> Installing for expat
-
1.95.8

===> Generating temporary packing list

===> Checking if textproc/expat2 already installed

/bin/sh ./conftools/mkinsta
lldirs /usr/local/lib /usr/local/include

/bin/sh ./libtool
--
mode=install /usr/bin/install
-
c
-
o root
-
g wheel libexpat.l

a /usr/local/lib/libexpat.la

/usr/bin/install
-
c
-
o root
-
g wheel .libs/libexpat.so.5 /usr/local/lib/libexpat

.so.5

(cd /usr/local/lib

&& rm
-
f libexpat.so && ln
-
sf libexpat.so.5 libexpat.so)

/usr/bin/install
-
c
-
o root
-
g wheel .libs/libexpat.a /usr/local/lib/libexpat.a

ranlib /usr/local/lib/libexpat.a

chmod 644 /usr/local/lib/libexpat.a

/usr/bin/env OBJFORMAT="elf" /sbin/ldconfig
-
m /
usr/local/lib

----------------------------------------------------------------------

Libraries have been installed in:


/usr/local/lib


If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libto
ol, and

specify the full pathname of the library, or use `
-
LLIBDIR'

flag during linking and do at least one of the following:


-

add LIBDIR to the `LD_LIBRARY_PATH' environment variable


during execution


-

add LIBDIR to the `LD_RUN_PATH' environme
nt variable


during linking

assistantashamed_ee9f2cac
-
cbe9
-
4e23
-
8660
-
9f08997207e3.doc

2013/3/16

-
6
-


-

use the `
-
Wl,
--
rpath
-
Wl,LIBDIR' linker flag


See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

--------------------------------------------
--------------------------

install
-
o root
-
g wheel
-
m 444 ./lib/expat.h ./lib/expat_external.h /usr/local

/include

/bin/sh ./conftools/mkinstalldirs /usr/local/bin /usr/local/man/man1

/bin/sh ./libtool
--
mode=install install
-
s
-
o root
-
g wheel
-
m 555 x
mlwf/xmlwf


/usr/local/bin/xmlwf

install
-
o root
-
g wheel
-
m 555
-
s xmlwf/.libs/xmlwf /usr/local/bin/xmlwf

install
-
o root
-
g wheel
-
m 444 ./doc/xmlwf.1 /usr/local/man/man1

===> Compressing manual pages for expat
-
1.95.8

===> Running ldconfig

/sbin/ldc
onfig
-
m /usr/local/lib

===> Registering installation for expat
-
1.95.8