SoFunction
Updated on 2025-03-09

Steps to establish a linux website


Steps to establish a linux website
1. Install Linux. If you need to use dual network cards in the future, it is best to insert two network cards before installing.
1) Install Linux
2) After installation, enter X_window to configure the second network card
Enter X_window, add eth1 in the turbolinux control center - network configuration - network interface
Use ifconfig to check whether the interrupts of eth0 and eth1 are the same. If different, the installation will be successful (you can also use unplugging the network cable.
Method to check whether the installation is successful)
[Installation] How to make the kernel detect two network cards often encounter this kind of problem, it is actually very simple:
When you have two network cards, add them
append = "ether=0,0,eth1"
When you insert three pieces, it is:
append = "ether=0,0,eth1 ether=0,0,eth2"
As an example:
boot = /dev/hda
#compact # faster, but won“t work on all systems.
delay = 50
vga = normal # force sane state
append= "ether=0,0,eth1"
# ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /zImage
root = /dev/hda1
label = linux
read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends
I don't know what to do when network card irq and iobase (especially when PCI network card, like 3c590...)
When you know the network card irq and iobase, it is better to specify it:
For example: two blocks 3c590:
append="ether=9,0xfce0,eth0 ether=5,0xfcc0,eth1"
Note: If it has been compiled into a module, it should be in /etc//(in TurboLinux
Yes /etc/)
Add a similar line:
/sbin/modprobe ne io=io1,io2
2. After Linux installation is completed, create users and groups
groupadd dba(group name)
groudadd oinstall(group name)
useradd oracle (username)
Enter etc directory and edit group
Join oinstall(group):x:501 racle(user)
dba(group):x:502racle(user)
3. Configure environment parameters
Method 1: Use root permission to edit /root/.bash_profile
Copy the edited .bash_profile to /home/oracle
chown oracle:dba /home/oracle/.
Method 2: Use root permissions to edit /root/.bashrc
Join umask 022
Enter /etc
Edit profile
Edit the content in ./root/.bash_profile and /etc/profile as follows:
PATH=$PATH:$HOME/bin
ENV=$HOME/.bashrc
USERNAME=""
umask 022
NLS_LANG="simplified chinese".zhs16gbk
ORACLE_HOME=/u1/oracle/8i
ORACLE_BASE=/u1/oracle
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin:.
DISPLAY=127.0.0.1:
export USERNAME ENV PATH
export ORACLE_HOME ORACLE_BASE ORACLE_SID
export LD_LIBRARY_PATH NLS_LANG
export DISPLAY
4. Install oracle8.1.6
1) Copy oracle8.1.6 file
<1> Hang the optical drive with root permissions
Method 1: mount /dev/cdrom /mnt
Method 2: mount -t iso9660 /mnt
<2>Copy oracle file
cd /mnt
Method 1: cp oracle / (copy oracle file to / directory as oracle user)
Method 2: cp /u2/.
2) Unlock oracle file
tar xvf (Expand package file)
tar xzvf (unzip and expand the packaged file)
3) Install oracle8.1.6
Give u1 and u2 the permission to oracle:dba
chown -R oracle:dba /u1
chown -R oracle:dba /u2
<1> Install oracle client -- for web server and db server are not on the same server
(1) Install oracle
Log in with oracle user
Enter X_window
Start the terminal
cd /Oracle8iR2
Run ./runInstaller to start the installation
Welcome:
Press next
File Locations:
Press next
UNIX Group Name:
Enter dba and press next
An error occurred, prompting to run /u1/oracle/8i/ with root permissions
CTRL+ALT+F2, open a new console (character window)
Log in as root
[root@wapdb /root]# cd /u1/oracle/8i/
At this time, there is a file in the /u1/oracle/8i/ directory. Run it
[root@wapdb /8i]# ./
CTRL+ALT+F7, return to the installation interface (graphics window)
Press the Retry button to continue the installation.
Available Products:
Select Oracle8i Enterprise Edition 8.1.6.1.0, select Install client (client) and press next
(This step is suitable for installation with the database server and the WEB server on different machines)
Installation Types:
Select Typical (128MB), press next, and at this time, a progress ruler appears in the upper right corner of the screen.
Here you can choose to create and install the language
Database Identification:
Global Database Name: Enter dba (can be any)
SID: Keep orcl
Press next
Database File Location:
In this example, set to "/u1/oracle/8i/", press Next, then the progress ruler in the upper right corner of the screen continues to go ahead.
Enter
Summary appears to give a summary of the product you want to install
Press Install, the Install screen appears, wait... You can see the installation and other log files prompted at the bottom of the window.
Record, available for future inquiries.
The Setup Privileges window pops up
Tip: Before the installation continues, you need to run a script as root
“/u1/oracle/8i//”,
CTRL+ALT+F2, return to the second terminal window that just ran
Execute the file with root permissions.
[root@wapdb /8i]# sh
Screen display:
Enter the full pathname of the local bin directory:[/usr/local/bin]:
Enter
The system starts to execute some actions. After the execution is completed, press CTRL+ALT+F7 to return to OUI and press OK.
(2) Configure oracle
Enter /u1/oracle/8i/bin
Run the netasst or netca command to start the OUI to configure
Set
You can also directly modify and
The fastest way is to COPY database server-side into /u1/oracle/8i/network/admin.
Log in as ORACLE user
[oracle@wapserver /]$ cd $ORACLE_HOME/network/admin
[oracle@wapserver admin]$ ftp #
Log in to oracle server using FTP to ORACLE
And use oracle users.
ftp>cd /u1/oracle/8i/network/admin
ftp>get
ftp>bye
File configuration
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.2(web server IP address))
(PORT =1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
File configuration
EXTPROC_CONNECTION_DATA.WEBQINMAI =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.16(db server IP address))
(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
ORCLbig =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.16(db server IP address))
(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
<2> Install oracle server side -- for web server and db server using one server, db server
superior
(1) Install oracle
Log in with oracle user
Enter X_window
Start the terminal
cd /Oracle8iR2
Run ./runInstaller to start the installation
Welcome:
Press next
File Locations:
Press next
UNIX Group Name:
Enter dba and press next
An error occurred, prompting to run /u1/oracle/8i/ with root permissions
CTRL+ALT+F2, open a new console (character window)
Log in as root
[root@wapdb /root]# cd /u1/oracle/8i/
At this time, there is a file in the /u1/oracle/8i/ directory. Run it
[root@wapdb /8i]# ./
CTRL+ALT+F7, return to the installation interface (graphics window)
Press the Retry button to continue the installation.
Available Products:
Select Oracle8i Enterprise Edition 8.1.6.1.0, select Install server (server side) and press next
Installation Types:
Method 1: Select Typical (540MB) and press next. At this time, a progress ruler appears in the upper right corner of the screen.
Here you can choose to create and install the language
Database Identification:
Global Database Name: Enter dba (can be any)
SID: Keep orcl
Press next
Database File Location:
Any directory, set to "/u1/oracle/8i/" in this example, press Next, at this time, the progress ruler in the upper right corner of the screen
keep going
Summary appears to give a summary of the product you want to install
Press Install, the Install screen appears, wait... You can see the installation and other log prompted at the bottom of the window.
File directory, available for future query.
The Setup Privileges window pops up
Tip: Before the installation continues, you need to run a script as root
“/u1/oracle/8i//”,
CTRL+ALT+F2, return to the second terminal window that just ran
Execute the file with root permissions.
[root@wapdb /8i]# sh
Screen display:
Enter the full pathname of the local bin directory:[/usr/local/bin]:
Enter
The system starts to execute some actions. After the execution is completed, press CTRL+ALT+F7 to return to OUI and press OK.
Database Creation Progress starts and gradually carry out the following 4 processes
Creating and starting Oracle instance
Copying database files
Initializing database
Database creation completed
The above 4 processes are completed and the Oracle Database Configuration Assistant Alert window pops up
Tip: The database is created and tells you some basic information about the database
global databse name:dba
database system identifier(SID):orcl
SYS account password:change_on_install
SYSTEM account password:manager
Press OK
End of Installation, press Exit to exit OUI, complete the installation
Method 2: Select CUSTUM (?MB) (custom installation), press next,
oracle universal install
welcome Press next
filelocations: destination path: /u1/oracle/8i Press next
unix group name: enter dba and press next
Run /u1/oracle/8i/ with root and press Retry
Availabli Products Select oracle8i Enterprise Edition8.1.6.1.0 Press next
Installation type Select custom Press next
Available product components
Select product languages ​​plus simplified chinese Press next
component locations Press next
privileged operating system groups dba press next
create database Select no Press next
summary
Run /u1/oracle/8i/ with root and press yes
end of installation press exit
Enter /u1/oracle/8i/bin
Run dbassist
create a database press next
Select custom Press next
Select online transaction processing (OLTP) Press next
15 Press next
Select shared server mode Press next
Select all Press next
global database name:orcl
sid:orcl
initialization filename:/u1/oracle/8i/admin/orcl/pflie/initorcl。ora
compatible parameter:8.1.0
change character set:zhs16gbk
Press next
Always next
Choose creat database now
(2) Configure oracle
Enter /u1/oracle/8i/bin
Run netasst (for server) or netca (for client)
You can also directly modify and
File configuration
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.16(db server IP address))
(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
File configuration
EXTPROC_CONNECTION_DATA.WEBQINMAI =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.2(web server IP address))
(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
ORCLbig =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 211.94.129.16(db server IP address))
(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
4) Configure hosts file
Add db server address to the hosts file

5. Configure related network services
1) Install apache and php
<1>Uninstall the original apache
View the apache version
rpm -aq | more
Uninstall apache
rpm -e --nodeps apache-1.3.9-7
<2> Install apache and php
Configure apache_1.3.14
[root@wapdb /www]# tar zxvf apache1.3. #Decompress apache
[root@wapdb /www]# cd /www/apache_1.3.14 #Enter the apache decompressed directory.
[root@wapdb /apache_1.3.14]# ./configure --prefix=/www (web page storage path)
Install PHP4
[root@wapdb /www]# tar zxvf php- 4.0. #Decompress php
[root@wapdb /www]# cd php-4.0.3
[root@wapdb /php-4.0.3]#./configure --with-apache=../apache_1.3.14 \
--with-oracle=/u1/oracle/8i \
--with-oci8=/u1/oracle/8i \
--enable-track-vars
[root@wapdb /php-4.0.3]# make #Compiled
[root@wapdb /php-4.0.3]# make install # Install
[root@wapdb /php-4.0.3]# cp -dist /usr/local/lib/ #copy ini text
File to lib directory
Install apache
[root@wapdb /php-4.0.3]# cd /www/apache_1.3.14
[root@wapdb/apache_1.3.14]# ./configure --prefix=/www \
--activate-module=src/modules/php4/
[root@wapdb /apache_1.3.14]# make
[root@wapdb /apache_1.3.14]# make install
Configure apache
[root@wapdb /apache_1.3.14]# cd /www/conf
[root@wapdb /conf]# vi
Modify the file
Remove comments in the following lines:
ServerName http://. . . . . . . This must be removed from comments
Listen:8888 (where it is the domain name, or IP address)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Modify the following two lines: (can be used for accessing users, generally use nobody)
User apache
Group oracle
DirectoryIndex index,htm (files and file types that can be accessed on the home page)
(Directory level access denied)
Options -indexes
Options -Indexes
[root@wapdb /conf]# vi
Modify the file, add WAP support, and add the following lines:
text/ WML
text/ WMLC
image/ WMLP
application/ WMLC
application/ WMLSC
2) FTP settings
<1> Create an FTP user
useradd -g dba (group name) qmupload (user name)
If you want to add users to multiple groups useradd -G dba,oinstall qmupload
<2> Change the startup path of the newly created FTP user to /www/htdocs under /etc/passwd
<3> Enter /etc to edit ftpaccess
limit real 2 Any|Any 0900-2100
upload /var/ftp * no (users who come from FTP cannot upload)
upload /var/ftp /www/htdocs yes real 0666 (Users who come from FTP can only be in /www/htdocs
Upload down)
Edit ftphosts (visited IP address)
allow qmupload (user name) 211.94.129.3 (visiting IP address)
Edit ftpusers (visited users)
oracle (user name)
6. Import and export data
1) Import data
When rebuilding the system, the main operations of importing qinmai user data (generally, only imp is required to import):
(1) create tablespace qinmai_data
datafile ‘/u2/qinmaidata/' size 800m
online
default storage(
initial 10m
next 10m
minextents 2
maxextents 50);
(2) create user qinmai identified by ********* (Password) CWZZMinke$101
default tablespace qinmai_data
temporary tablespace temp;
(3) grant create session to qinmai ;
grant dba to qinmai;
(4) imp(at the operating system prompt)
Username: qinmai
Password: *******
Import file: (Enter the data file name to import)
Enter the insert buffer size: Enter
List only the contents of the imported file: Enter
Since the object already exists, the creation error is ignored: yes
Import permission: Enter
Import table data: Enter
Import the entire export file: yes
2) Export data
At the operating system prompt, type: exp
Username: qinmai
Password: *******
Enter
Export file: (Enter the data file name to import)
(1) E (full database) (2) U (user) or (3) T (table) (default is (2) U), enter
Export permission: Enter
Export table data: Enter
Compression area: Enter
User to export: qinmai
Enter
7. Conduct safety inspections
1) Delete unused users
Enter /etc and edit the passwd file
Translate lp, sync, shutdown, halt, mail, news, uucp, operator, games, gopher, etc.
Delete users who don't usually use it
2) Check whether there are suspicious ports and service startups
3) Turn off unused ports and services
4) Do access control
Add ALL:0.0.0.0/0.0.0.0 in /etc/ (access prohibited)
Or ALL:ALL@ALL PARANOID
Add in /etc/(access license)
FTP: Licensed IP address
PING: Licensed IP address
1521 (port): The licensed IP address
For example: ALL: 127.0.0.1
ALL : 211.94.129.1
ALL : 211.94.129.3
ALL : 211.94.129.2
ALL : 211.94.129.16
Add and delete FTP and Telnet services in /etc/.