จะลงแซมบ้า บนโซลาลิสเครื่อง lxx-xx16 มาหลายทีแล้ว แต่ว่ามีปัญหาหลายๆอย่าง จนกิ๊บอัพไปหลายครา คราวนี้เอาจริง คอมไพล์เอง ไม่ใช้จากแพคเกจแล้ว พอดีก็มีปัญหาอีกที่ว่า ไอ่ /usr/local มันถูกเมาท์โดย NFS ทำให้เราไม่อยากจะเข้าไปแก้ ก็เลยต้องลงใน $HOME/sys เอาละกัน
คำสั่งคอนฟิก
./configure --prefix=$HOME/sys/opt/samba --with-acl-support --with-quotas --with-included-popt --localstatedir=$HOME/sys/var/lib/samba --with-piddir=$HOME/sys/var/run --with-logfilebase=$HOME/sys/var/log/samba --with-privatedir=$HOME/etc/samba/private --with-configdir=$HOME/etc/samba
--with-ldap=no --with-ads=no
คอมไพล์ไม่ผ่าน สุดท้ายต้องใช้ package pkgadd -d samba...pkg.bz
มันจะติดตั้งไปที่ /opt/samba. เป็น Samba เวอร์ชั่น 3.0.22
samba-3.0.20a-1-noads-sunos5.9-sparc.pkg:
./configure --prefix=/opt/samba --with-acl-support --with-quotas --with-included-popt --localstatedir=/var/lib/samba --with-piddir=/var/run --with-logfilebase=/var/log/samba --with-privatedir=/etc/samba/private --with-configdir=/etc/samba --with-ldap=no --with-ads=no ขั้นต่อมาแก้ /etc/samba/smb.conf เพิ่มส่วนที่ต้องการแชร์ลงไป ตัวอย่างเช่น
[myshare]
comment = My FileServer
path = /some/where/to/share
valid users = my_user_name
public = no
writable = yes
printable = no
create mask = 0700 or 0644
directory mask = 0700---
create mask = 0644 The option create mask specifies and sets the necessary permissions according to the mapping from DOS modes to UNIX permissions. With this option set to 0644, all file copying or creating from a Windows system to the Unix system will have a permission of 0644 by default.
- directory mask = 0755
The option directory mask specifies and set the octal modes, which are used when converting DOS modes to UNIX modes when creating UNIX directories. With this option set to 0755, all directory copying or creating from a Windows system to the Unix system will have a permission of 0755 by default.
และเพื่อความปลอดภัย อย่าลืม disable anonymous เพิ่มบรรทัดนี้เข้าไปในส่วน [global]
restrict anonymous = 2
client plaintext auth = no
---
ขั้นต่อมาก็เช็ค smb.conf ว่าโอมั้ย
# /opt/samba/bin/testparm
จากนั้นก็ต้องแก้ไข inetd เล็กน้อยเพื่อให้มัน start Samba daemons:
Most of Samba's services are provided by means of three servers or daemons: smbd is the Samba server, nmbd is the NetBIOS name server and swat is a Web-based Samba configuration tool. These deal with incoming connections on ports 137, 139 and 901 respectively and we need to tell the Solaris internet daemon, inetd, to start the appropriate Samba daemons whenever an incoming request is received on these ports.
Edit /etc/services and make the following changes.
Immediately after the line which reads:
sunrpc 111/tcp rpcbind
insert the two lines:
netbios-ns 137/udp # Samba nmbd
netbios-ssn 139/tcp # Samba smbd
and, after the line which reads:
ldaps 636/udp # LDAP protocol over TLS/SSL (was sldap)
insert the line:
swat 901/tcp # Samba swat
Now edit /etc/inetd.conf and add the following three lines to the end of the file:
netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
swat stream tcp nowait.400 root /usr/local/samba/bin/swat swat
If you have TCP wrappers installed (see Installing and configuring TCP Wrappers on Solaris), the three lines to be added should read:
netbios-ssn stream tcp nowait root /usr/sbin/tcpd /usr/local/samba/bin/smbd smbd
netbios-ns dgram udp wait root /usr/sbin/tcpd /usr/local/samba/bin/nmbd nmbd
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/local/samba/bin/swat swat
Tell the inetd daemon to re-read its configuration file:
# pkill -HUP inetd
and Samba is installed and working.ระวัง: ถึงแม้เวลาเรา ps -ef | grep smbd ดูโพรเสสแล้วไม่เจอ แล้วก็คิดว่ามันไม่เวิร์คตรงไหน?
จริงๆมันรันอยู่แล้ว เราต้องลอง connect เข้าไปดูถ้า connect ติดถึงจะมี smbd รันให้เห็นกะตา
นอกจากนี้เรายังสามารถให้ swat ได้ที่ http://localhost:901/ แต่ผมยังไม่ได้ลอง
เย่ สำเร็จ เท่านี้ก็มีไฟล์เซิร์ฟเวอร์ให้ถลุงแล้ว
ลง PostgreSQL ใน Mac OS X
อ้างอิงจาก: http://developer.apple.com/internet/opensource/postgres.html
เริ่มจากลง readline ใน Fink ด้วยคำสั่ง
$ sudo /sw/bin/fink install readline
แล้วก็ดาวน์โหลด postgresql มา ครั้งนี้เราโหลด 8.1.4 มา
./configure --prefix=$HOME/sys/usr/local/pgsql --with-includes=/sw/include --with-libraries=/sw/lib --enable-multibyte --enable-unicode --enable-locale --with-java --with-openssl --with-pam --with-bonjour
จากนั้นก็อาจจะ make check เพื่อความชัวร์ แต่ไม่จำเป็น install ได้เลยโดย make install
su -l postgres
$POSTGRESQL/bin/initdb -D $POSTGRESQL/data
Success. You can now start the database server using:
./bin/postmaster -D ./data
or
./bin/pg_ctl -D ./data -l logfile start
PostgreSQL ships with fairly lax access rules. If you’ll be using your
database in a production environment, or on any kind of shared server,
you should add at least a basic level of security. User authentication
rules are defined in the file /usr/local/pgsql/data/pg_hba.conf. As explained in the PostgreSQL documentation,
you can edit this file to password-protect user accounts, change
authentication methods for local and remote connections, and enable or
disable user access to various parts of the system.
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all postgres 127.0.0.1 255.255.255.255 md5
host samegroup all 127.0.0.1 255.255.255.255 md5
local all postgres md5
local samegroup all md5
After editing the file, I need to create a password for the “postgres” superuser, and restart the database server so the changes will take effect:
postgres@mail:~> psql test
test=# alter user postgres with password 'your_password';
test=# \q
For 8.0+, in postgresql.conf uncomment the line starting:
listen_addresses = 'localhost'
Then tighten up security a bit by editing pg_hba.conf and adding this line:
host dspace dspace 127.0.0.1 255.255.255.255 md5
# Jakarta Tomcat 4.x/5.x or equivalent, such as Jetty or Caucho Resin.
Note that DSpace will need to run as the same user as Tomcat, so you might want to install and run Tomcat as a user called 'dspace'. สำหรับกรณีนี้เราไม่
You need to ensure that Tomcat has a) enough memory to run DSpace and b) uses UTF-8 as its default file encoding for international character support. So ensure in your startup scripts (etc) that the following environment variable is set:
JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"You also need to alter Tomcat's default configuration to support searching and browsing of multi-byte UTF-8 correctly. You need to add a configuration option to the element in [tomcat]/conf/server.xml:
URIEncoding="UTF-8"
e.g. if you're using the default Tomcat config, it should read:
URIEncoding="UTF-8" /> Jetty and Resin are configured for correct handling of UTF-8 by default.
First, a Word on Directories and Path Names
DSpace uses three separate directory trees. Although you don't need to know all the details of them in order to install DSpace, you do need to know they exist and also know how they're referred to in this document:
- the source directory, referred to as
[dspace-source] - the install directory, referred to as
[dspace] - the web deployment directory. If you're using Tomcat, this will be
[tomcat]/webapps/dspace (with [tomcat] being wherever you installed Tomcat--also known as $CATALINA_HOME). This directory is generated by the web server when it unpacks dspace.war, and should never be edited.
-
Download the latest DSpace source code release and unpack it:
gunzip -c dspace-source-1.x.tar.gz | tar -xf -
-
Copy the PostgreSQL JDBC driver (.jar file) into [dspace-source]/lib. Download it directly from the PostgreSQL JDBC site. Make sure you get the driver for the version of PostgreSQL you're running and for JDBC2. เราลองใช้ JDBC3 ถ้าไม่เวิร์คเราจะกลับมาใช้ 2
-
Create a dspace database, owned by the dspace PostgreSQL user:
createuser -U postgres -d -A -P dspace ; createdb -U postgres -O dspace -E UNICODE dspace
เราเปลี่ยนคำสั่ง createdb โดยให้ postgres ซึ่งเป็น DB admin ครีเอท เพราะไม่สามารถให้ dspace DB user create ได้โดยตรง
As the dspace UNIX user, compile and install DSpace:
cd [dspace-source] ; ant fresh_install
ติดตั้ง handle server
- Run
/dspace/bin/dsrun net.handle.server.SimpleSetup /dspace/handle-server. Follow the instructions, answering relatively simple questions. Another option might be to run /dspace/bin/make-handle-config after configuring dspace.cfg, but we did not do this. - Mail the file
/dspace/handle-server/sitebndl.zip to hdladmin@cnri.reston.va.us. They will quickly create your global identifier and email you with the appropriate information. - Once you receive the email, you must edit the Handle configuration file (
/dspace/handle-server/config.dct). Just as the DSpace instructions say, เพิ่ม "storage_type" = "CUSTOM" และก็ "storage_class" = "org.dspace.handle.HandlePlugin" ลงไปในส่วนของ server_config. - While still in
config.dct, update any lines that say something like YOUR_NAMING_AUTHORITY with the appropriate number as sent to you in the email from the Handle admin people. For instance, here at UTK we have a line that reads "server_admins" = ( "300:0.NA/1785" ). We made this change in three places, under server_admins, backup_admins, and replication_admins. - Edit
/dspace/config/dspace.cfg, changing handle.prefix to whatever number you were assigned (in our case, the line reads handle.prefix = 1785), and changing if necessary handle.dir to point to the right place, usually /dspace/handle-server.
====================================================================
[echo] The DSpace code has been installed, and the database initialized.
[echo]
[echo] To complete installation, you should do the following:
[echo]
[echo] * Install the DSpace UI (dspace.war) and OAI-PMH (dspace-oai.war)
[echo] Web applications from the 'build' directory in the appropriate
[echo] place for your servlet container. e.g. '/opt/tomcat/webapps'
[echo]
[echo] * Make an initial administrator account (an e-person) in DSpace:
[echo]
[echo] /Users/jojo/sys/usr/local/dspace/bin/create-administrator
[echo]
[echo] * Start up your servlet container (Tomcat etc.)
[echo]
[echo] You should then be able to access your DSpace's 'home page':
[echo] https://bossanova.jaist.ac.jp:8080/dspace
[echo]
[echo] You should also be able to access the administrator UI:
[echo]
[echo] https://xxx.xxx.xxx.xxx:8080/dspace/dspace-admin
====================================================================
ปัญหา!!!!
สตาร์ทอัพ DSpace ไม่ได้เพราะเหมือนกับว่า หลังรันคำสั่งแล้วมันจะให้ใส่ passphrase ซึ่งไม่สามารถใส่ได้
ทางแก้: ลองใหม่โดยไม่ encrypt key ด้วย passphrase ก็จะสามารถสตาร์ทได้
== ไม่จำเป็นต้องติดตั้งใหม่ทั้งหมด ==
หลังจาก Handle-server เอย การ customize ไฟล์ input-forms.xml เอย ลงตัวแล้ว
เราสามารถเคลียร์ db เก่าโดยไม่ต้องลงใหม่ทั้งหมด (fresh_install) ด้วยการ:
1. ลบ dspace database ทิ้ง
2. ไปที่ [dspace-src] แล้ว $ ant setup_database && $ ant load_registries
3. ไปที่ [dspace] แล้ว $ ./bin/create-administrator