ひょんな事で,Linuxサーバをインストールしたので,
せっかくなので,その時の手順です。
あちこちのサイトを参照しつつ,試行錯誤でできあがりました。
間違ってるところがあるかもしれないですが,
大体OKでしょ?
コメントの英語がめちゃくちゃですすみません。
そのうち正しく・・ なる・・ かも・・
fedora server install manual.
essential information.
ip address:xxx.xxx.xxx.xxx
sub netmask:xxxx.xxx.xxx.xxx (xx)
default gateway:xxx.xxx.xxx.xxx
dns1:xxx.xxx.xxx.xxx
dns2:xxx.xxx.xxx.xxx
host name:xxxxx
root password:xxxxxx
this server installs Fedora Core6 + Apache2.0.58 + Tomcat5.0.28(jdk1.4.2) + postgreSQL8.1.5.
Hardware is ML(cpu-64bit) of HP.
1.FEDORA is installed.
Please remove the web server and the data base from the package.
Moreover, please select the following package because it cannot be “make command”.
“Development package”, “Development of ..legacy.. software”, and “Development library”.
2.Installation of postgreSQL.
%groupadd postgres
%useradd -g postgres postgres
%password postgres
%chmod 777 /usr/local/src
%mkdir /usr/local/pgsql
%chown postgres.postgres /usr/local/pgsql
%su postgres
%cd /usr/local/src
%tar zxvf postgresql-8.1.5.tar.gz
%cd postgresql-8.1.5
%./configure –prefix=/usr/local/pgsql –enable-nls=ja
%make
%make install
“PostgreSQL installation complete” it ended correctly by this.
#making of environment variable
%vi ~/.bash_profile
———————————–
PGHOME=/usr/local/pgsql
PGDATA=$PGHOME/data
PGLIB=$PGHOME/lib
PATH=$PATH:$HOME/bin:$PGHOME/bin
export PGHOME PGDATA PGLIB PATH
———————————–
# save
%source ~/.bash_profile
%initdb –encoding=EUC_JP -no-locale
%exit
%vi /etc/ld.so.conf
#add it to the last line on a page.
———————————–
/usr/local/pgsql/lib
———————————–
# save
%cd /etc/
%ldconfig -v
%su – postgres
%vi /usr/local/pgsql/data/pg_hba.conf
# IPv4 local connections:
———————————————————————-
host all all 127.0.0.1/32 trush
host all all xxx.xxx.xxx.0/24 trust # add line
———————————————————————-
# save
%vi /usr/local/pgsql/data/postgresql.conf
# 「#listen_addresses=’localhost’」on line changes.
———————————————————————-
listen_addresses=’localhost,192.168.0.xx’ ・・・
# when it is possible to connect it from anywhere
listen_addresses=’*’
PORT=5432 #comment is removed.
———————————————————————-
# save
%pg_ctl start
or
%pg_ctl reload
%pg_ctl stop
# returns to the root.
%exit
# start script is copied.
%cd /usr/local/src/postgresql-8.1.5/contrib/start-scripts/
%cp linux /etc/rc.d/init.d/postgresql
# authority is set.
%cd /etc/rc.d/init.d/
%chmod 755 postgresql
# adds it to “service”.
%chkconfig –add postgresql
# postgresql start
%service postgresql start
# authority is without.
%chmod 755 /usr/local/src
4.Installation of Apache.
#ssl
%yum -y install openssl-devel
%mkdir /usr/local/httpd-2.0.58
%cd /usr/local/src
#64bitCPU onry
%up /usr/lib64/libexpat.so instead of /usr/lib
or
%cp /usr/lib64/libexpat.so /usr/lib
%tar zxvf httpd-2.0.58.tar.gz
%cd httpd-2.0.58
%./configure –prefix=/usr/local/httpd-2.0.58 –enable-rewrite=shared –without-ssl –without-dav_fs –without-dav
%make
%make install
#link
%ln -sfn /usr/local/httpd-2.0.58 /usr/local/httpd
#Apache Operation test
%/usr/local/httpd/bin/apachectl start
%/usr/local/httpd/bin/apachectl stop
#adds it to “service”.
%vi /usr/local/httpd/conf/httpd.conf
———————————————————————————————————
# LanguagePriority en ca cs da de el eo es et fr he hr it ha ja ko itz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
↓ja
LanguagePriority ja en ca cs da de el eo es et fr he hr it ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
———————————————————————————————————
%cd /etc/rc.d/
%vi rc.local
# last line add
———————————–
/usr/local/apache2/bin/apachectl start
———————————–
# save
# re check
%/usr/local/httpd/bin/apachectl configtest
Syntax OK
# pc restart.
5.Installation of Java.
#jdk1.4.2_13
% cd /usr/local/src
# cp j2sdk-1_4_2_13-linux-i586.bin /usr/local
# cd /usr/local
# chmod 755 j2sdk-1_4_2_13-linux-i586.bin
# ./j2sdk-1_4_2_13-linux-i586.bin
Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA 2 PLATFORM STANDARD EDITION DEVELOPMENT
KIT 5.0
…..
For inquiries please contact: Sun Microsystems, Inc.,
4150 Network Circle, Santa Clara, California 95054,
U.S.A. (LFI#143333/Form ID#011801)
Do you agree to the above license terms? [yes or no]
yes ←entry
%ln -sfn /usr/local/j2sdk-1_4_2_13 /usr/local/jdk
6.Installation of Tomcat.
#download
wget -P /usr/local/src http://ftp.kddilabs.jp/infosystems/apache/tomcat/tomcat-5/v5.0.28/bin/jakarta-tomcat-5.0.28.tar.gz
%cd /usr/local/src
%tar xzf jakarta-tomcat-5.0.28.tar.gz -C /usr/local
%ln -sfn /usr/local/jakarta-tomcat-5.0.28 /usr/local/tomcat
7.Tomcat setting
%vi /etc/profile
———————————–
export JAVA_HOME=/usr/local/jdk
export CATALINA_HOME=/usr/local/tomcat
PATH=$PATH:$JAVA_HOME/bin
———————————–
#source
%source /etc/profile
#create user
%useradd -d /var/empty/tomcat -s /bin/bash tomcat
%chown -R tomcat:tomcat /usr/local/jakarta-tomcat-5.0.28
8.Tomcat testing
%su -s /bin/bash – tomcat -c “$CATALINA_HOME/bin/startup.sh”
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk
#add to “service”
#start script is copied.
%vi /etc/rc.d/init.d/tomcat
———————————————————————-
#!/bin/sh
#
# Startup script for the tomcat
#
# chkconfig: 345 80 15
# description: Tomcat
# Source function library.
. /etc/rc.d/init.d/functions
case “$1″ in
’start’)
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo “Starting tomcat ..”
su – tomcat -c “export JAVA_HOME=/usr/local/jdk; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/local/tomcat/bin/startup.sh”
fi
;;
’stop’)
echo “Stopping tomcat ..”
su – tomcat -c “export JAVA_HOME=/usr/local/jdk; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/local/tomcat/bin/shutdown.sh”
;;
‘restart’)
$0 stop
$0 start
;;
‘jkconf’)
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo “Generating Apache mod_jk config file. ”
su – tomcat -c “export JAVA_HOME=/usr/local/jdk; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/local/tomcat/bin/startup.sh jkconf”
fi
;;
*)
echo “Usage: $0 {start|stop|restart|jkconf}”
;;
esac
exit 0
———————————————————————-
#authority is set.
%chmod 755 /etc/rc.d/init.d/tomcat
%chkconfig –add tomcat
#test
%service tomcat start
%service tomcat stop
%service tomcat restart
11.Tomcat synchronizes with Apache.
#download
%wget -P /usr/local/src http://www.meisei-u.ac.jp/mirror/apache/dist/tomcat/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz
%tar xvfz jakarta-tomcat-connectors-jk2-src-current.tar.gz
%cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2
%./configure –with-apxs2=/usr/local/apache2/bin/apxs
%make
%cp ../build/jk2/apache2/mod_jk2.so /usr/local/apache2/modules
#/usr/local/httpd/conf/httpd.conf
%LoadModule jk2_module modules/mod_jk2.so
#/usr/local/httpd/conf/workers2.properties create
%vi /usr/local/httpd/conf/workers2.properties
———————————–
[channel.socket:localhost:8009]
[shm:]
disabled=1
[uri:/jsp-exsamples/*]
———————————–
#conf/jk2.properties
%vi /usr/local/tomcat/conf/jk2.properties
———————————–
channelSocket.port=8009
———————————–
#edit server.xml
%vi /usr/local/tomcat/conf/server.xml
———————————————————————-
<Connector port=”8009″
enableLookups=”false” redirectPort=”8443″ debug=”0″
protocol=”AJP/1.3″ useBodyEncodingForURI=”true” />
———————————————————————-
#8080→7001 debug (Erase it at the end. )
———————————————————————-
<Connector port=”8080″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
debug=”0″ connectionTimeout=”20000″
disableUploadTimeout=”true”
useBodyEncodingForURI=”true”/>
↓
<Connector port=”7001″
maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″
enableLookups=”false” redirectPort=”8443″ acceptCount=”100″
debug=”0″ connectionTimeout=”20000″
disableUploadTimeout=”true”
useBodyEncodingForURI=”true”/>
———————————————————————-
以上でした。
詳しい方が,いらっしゃいましたら,やばそうなとこ教えてください!!
よろしくお願いします。
SETUP MANUAL