Linux Prectical How To
Contents
- Linux Command
- Firewall
- environment variable
- customise firewall while install RedHat Linux
- Install Web Application on RedHat Linux
- 1. Install Apache Web Server
- 2. install JAVA 2
- 3. install tomcat
- 4.install MySQL
- About security of redhat linux
- turn on ftp server (for ever)
- linux command
- create WAR file for bustops
- Network Config
- Add a user
linux command
- setup the computer: prompt>setup
- config network interface: prompt>network config
- ?? chkconfig ipchains off ??
- service ipchains status
- service ipchains start
- service ipchains stop
- service ipchains restart
- about net work configure
- lsmod
- cd /etc/sysconfig/network-scripts
- ls
- pico ifcfg-eth0
- service network restart
- ifconfig
- lokkit
- service ipchains restart
Firewall
check firewall: service ipchains status
turn off firewall: service ipchains stops
turn off firewall from computer boot: chkconfig ipchains off
environment variable
The local environment variable is the "local" variable, it's available only for the particular instance of the shell.
The global environment variable is the shell variable which stays available ("inherited") for any program started from the current shell, including an another shell.
To set the local environment variable:
set variable_name=value (C shell)
variable_name=value (Korn or Bourne shell)
To unset the local environment variable:
unset variable_name (all shells)
To set the global environment variable:
setenv VARIABLE_NAME value (C shell)
VARIABLE_NAME=value; export VARIABLE_NAME (Korn or Bourne shell)
To unset the global environment variable:
unsetenv VARIABLE_NAME value (C shell)
unset VARIABLE_NAME (Korn or Bourne shell)
To list all environmnet variables:
env
To check a single environment variable:
echo $VARIABLE_NAME
customise firewall while install RedHat Linux
1.install
2.lokkit [enter]---customise
3.netconfig[enter]?
4.rhn_rgister[enter]
5.up2date
Install Web Application on RedHat Linux
1. Install Apache Web Server
cd /usr/local
cp /mnt/cdrom/apache_1.3.24.tar.gz ./
tar -zxf apache_1.3.24.tar.gz
mkdir apache
cd apache
cp -rf /usr/local/apache_1.3.24/* ./
cd ..
rm -rf apache_1.3.24
cd apache
./config
make
make install
/usr/local/apache/bin/apachectl start
stop apache
/usr/local/apache/bin/apachectl stop
restart apache
/usr/local/apache/bin/apachectl restart
2. install JAVA 2
RedHat Application CD
cd IBM
rpm -ivh IBMJava2-SDK-1.3-9.0.i386.rpm
cd /root
vi .bash_profile
add follow two lines:
JAVA_HOME=/opt/IBMJava2-13; export JAVA_HOME
PATH=$PATH:/opt/IBMJava2-13; export PATH
set PATH and JAVA_HOME for tomcat
3. install tomcat
tomcat 3.3.2
cd /usr/local
cp -rf /mnt/cdrom/jakarta-tomcat-3.3.2-dev.tar.gz ./
tar -zxf jakarta-tomcat-3.3.2-dev.tar.gz
mkdir tomcat
cd tomcat
cp -rf /usr/local/jakarta-3.3.2-dev/* ./
cd ..
rm -rf /usr/local/jakarta-tomcat-3.3.2-dev
cd tomca
cd bin
chmod 755 startup
chmod 755 tomcat
chmod 755 shutdown
./startup to start tomcat
./shutdown to stop tomcat
to open port 8080
prompt> ipchains -I input -j ACCEPT -p tcp -s 64.119.96.78 -d 64.119.96.77 8080
this command will not work
you must do:
prompt> setup
select firewall or prompt> lokkit[enter]
go to customize, on the line of "Other ports" put "webcache:tcp"
then type:
prompt> service ipchains restart
4.install MySQL
rpm -ivf /mnt/cdrom/MySQL-3.22.32-1.i386.rpm
rpm -ivf /mnt/cdrom/MySQL-client-3.22.32-1.i386.rpm
add password to root user:
/usr/bin/mysqladmin -u root password 'susan';
let 64.119.96.78 access MySQL on linux server as MySQL client
prompt> ipchains -I input -j ACCEPT -p tcp -s 64.119.96.78 -d 64.119.96.77 3306
3306 mysql's default tcp port number
About security of redhat linux
1. install
2. lokkit
3. netconfig[enter]?
4. rhn_register
5. up2date
?????????????????????????
after change the security rules:
ipchain restart
?????????????????????????
turn on ftp server (for ever)
- prompt>chkconfig wu-ftpd on
- check : prompt>ftp localhost
create WAR file for bustops
JAR -cvf ../deploy/emstops0.war *.*
Network Config
- list all exist network interface: ifconfig
- change IP: ifconfig eth0 664.119.96.78
- assign nstmask: ifconfig eth0 netmask 255.255.255.248
- stop network interface: ifconfig eth0 down
- start network interface: ifconfig eth0 up
- add default gateway: route add default gw 64.119.96.73
Add a User
- add user on Linux Server: take nina as a example
- add nina to www group password: ninatang
- useradd -g www nina
- vi ninapas
- nina:ninatang
- chpasswd < ninapas
- change group the user belong to: usermod -g newgroup nina
latest update : July 22, 2002
No comments:
Post a Comment