Linux Web site setup steps _unix Linux

Source: Internet
Author: User
Tags character set dba oracle database

Steps to build a Linux web site
1, install Linux, if you need to use a dual network card, preferably before the installation of two network card plug
1) Install Linux
2 after installation, after entering the X_window configure the second network card
Enter X_window, add eth1 in Turbolinux control center-network configuration-network interface
Use Ifconfig to see if eth0, eth1 interrupts are the same, different words indicate successful installation (or you can use the Unplug network cable
method to check if the installation was successful)
[Install] How to let the kernel detect two network cards often encounter this kind of problem, in fact very simple:
When you have two network cards, add in the lilo.conf
Append = "Ether=0,0,eth1"
When you plug in three, it is:
Append = "Ether=0,0,eth1 ether=0,0,eth2"
Examples are as follows:
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
This is not aware of the network card IRQ and Iobase when the practice (especially when the PCI network card, like 3c590 ...)
When you know the NIC IRQ and Iobase, still specify the good:
For example: Two pieces of 3c590:
append= "Ether=9,0xfce0,eth0 ether=5,0xfcc0,eth1"
Note: If already compiled into a module, it should be in/etc/rc.d/rc.modules (in Turbolinux
is/etc/conf.modules)
Add a similar line:
/sbin/modprobe NE Io=io1,io2
2, after the installation of Linux, create users and groups
Groupadd dba (group name)
Groudadd Oinstall (group name)
Useradd Oracle (user name)
Enter etc directory, edit group
Join Oinstall (Group): x:501 racle (user)
DBA (Group): x:502racle (user)
3, Configuration environment parameters
Method 1: Edit/root/.bash_profile with root permissions
Copy the edit completed. Bash_profile to/home/oracle
Chown oracle:dba/home/oracle/.
Method 2: Edit/ROOT/.BASHRC with root permissions
Add Umask 022
Enter/ETC
Edit Profile
In the./root/.bash_profile,/etc/profile edited the contents are 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:o. O
Export USERNAME ENV PATH
Export Oracle_home oracle_base Oracle_sid
Export Ld_library_path Nls_lang
Export DISPLAY
4. Installation oracle8.1.6
1) Copy oracle8.1.6 file
<1> suspend optical drive with root privileges
Method 1:mount/dev/cdrom/mnt
Method 2:mount-t Iso9660/mnt
<2> Copy Oracle Files
Cd/mnt
Method 1:CP Oracle/oracle.tar (copy Oracle files to/directories with Oracle users)
Method 2:CP oracle.tar/u2/.
2) Unlock Oracle Files
Tar xvf oracle.tar (expand Package file)
Tar xzvf oracle.tar.gz (unzip and expand packaged files)
3) Installation oracle8.1.6
Give U1, U2 the right to Oracle:dba
Chown-r ORACLE:DBA/U1
Chown-r ORACLE:DBA/U2
<1> Install Oracle Clients--for Web server is not on the same server as DB server
(1) Install Oracle
Landing with Oracle Users
Enter X_window
Start terminal
Cd/oracle8ir2
Run./runinstaller Start Installation
Welcome:
Press Next
File Locations:
Press Next
UNIX Group Name:
Enter DBA, press Next
Error, prompt to run/u1/oracle/8i/orainstroot.sh with root permission
CTRL+ALT+F2, open a new console (character window)
Log in as Root
[root@wapdb/root]# cd/u1/oracle/8i/
Then there is a file in the/u1/oracle/8i/directory orainstroot.sh, run it
[root@wapdb/8i]#./orainstroot.sh
Ctrl+alt+f7, back to the Installation Interface (graphics window)
Press the Retry button and you can continue with the installation.
Available Products:
Choose Oracle8i Enterprise Edition 8.1.6.1.0, select Install Client (client) press Next
(This step is suitable to be installed on different machines with the database server and the Web server)
Installation Types:
Select Typical (128MB) and press Next when a progress ruler appears in the upper-right corner of the screen
Here you can choose to set up the installation to specify the language
Database Identification:
Global Database Name: Enter DBA (optionally)
SID: Preserve ORCL
Press Next
Database File Location:
Any directory, this example is set to "/u1/oracle/8i/", press Next, when the progress ruler in the top right corner of the screen continues
Into
Appear summary, make a summary of the products you want to install
Press install, appear install picture, wait ... Can see the window at the bottom of the prompts to install such log files
Record, available for future enquiries.
Eject the Setup Privileges window
Tip: You need to run a script with root before the installation continues
"/u1/oracle/8i//root.sh",
Ctrl+alt+f2, go back to the 2nd terminal window that just ran
Execute the file as root,
[root@wapdb/8i]# SH root.sh
Screen display:
Enter the full pathname to the local bin Directory:[/usr/local/bin]:
Enter
The system starts to perform some actions, completes, Ctrl+alt+f7 presses returns OUI, presses OK.
(2) Configure Oracle
Enter/u1/oracle/8i/bin
Run the NETASST or NETCA command to start the Oui to match
Reset
You can also change Listener.ora and Tnsnames.ora directly.
The quickest way is to copy the database server-side Tnsnames.ora to/u1/oracle/8i/network/admin.
Log on as an Oracle user
[Oracle@wapserver/]$ CD $ORACLE _home/network/admin
[Oracle@wapserver admin]$ FTP xxx.xxx.xxx.xxx #
Log on to the Oracle server using FTP to Oracle
and use Oracle users.
Ftp>cd/u1/oracle/8i/network/admin
Ftp>get Tnsnames.ora
Ftp>bye
Listener.ora file Configuration
LISTENER =
(Description_list =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.2 (Web server IP))
(PORT =1521))
)
(Address_list =
(address = (PROTOCOL = IPC) (KEY = Extproc))
)
)
)
Tnsnames.ora file Configuration
Extproc_connection_data. Webqinmai =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = IPC) (KEY = Extproc))
)
(Connect_data =
(SID = Plsextproc)
(presentation = RO)
)
)
ORCL. W =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.16 (db server IP))
(PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
Orclbig =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.16 (db server IP))
(PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
<2> Install Oracle Server side-for Web server to use with DB server on a single server, DB server
On
(1) Install Oracle
Landing with Oracle Users
Enter X_window
Start terminal
Cd/oracle8ir2
Run./runinstaller Start Installation
Welcome:
Press Next
File Locations:
Press Next
UNIX Group Name:
Enter DBA, press Next
Error, prompt to run/u1/oracle/8i/orainstroot.sh with root permission
CTRL+ALT+F2, open a new console (character window)
Log in as Root
[root@wapdb/root]# cd/u1/oracle/8i/
Then there is a file in the/u1/oracle/8i/directory orainstroot.sh, run it
[root@wapdb/8i]#./orainstroot.sh
Ctrl+alt+f7, back to the Installation Interface (graphics window)
Press the Retry button and you can continue with the installation.
Available Products:
Choose Oracle8i Enterprise Edition 8.1.6.1.0, select Install Server (server side) Press Next
Installation Types:
Method 1: Select Typical (540MB) and press Next when a progress ruler appears in the upper-right corner of the screen
Here you can choose to set up the installation to specify the language
Database Identification:
Global Database Name: Enter DBA (optionally)
SID: Preserve ORCL
Press Next
Database File Location:
Any directory, this example is set to "/u1/oracle/8i/", press Next, when the progress ruler in the upper right corner of the screen
Keep moving
Appear summary, make a summary of the products you want to install
Press install, appear install picture, wait ... You can see the installation at the bottom of the window, etc. log
The file directory, available for later queries.
Eject the Setup Privileges window
Tip: You need to run a script with root before the installation continues
"/u1/oracle/8i//root.sh",
Ctrl+alt+f2, go back to the 2nd terminal window that just ran
Execute the file as root,
[root@wapdb/8i]# SH root.sh
Screen display:
Enter the full pathname to the local bin Directory:[/usr/local/bin]:
Enter
The system starts to perform some actions, completes, Ctrl+alt+f7 presses returns OUI, presses OK.
The Database creation progress begins with the following 4 steps
Creating and Starting Oracle instance
Copying database files
Initializing database
Database Creation completed
Above 4 procedures complete, eject Oracle Database Configuration Assistant Alert window
PORT, Hint: database creation complete, tells you some basic information of 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, Exit Oui by exit, complete installation
Method 2: Choose 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 Press Next
Run/u1/oracle/8i/orainstroct.sh Press retry with root
Availabli Products Select Oracle8i Enterprise Edition8.1.6.1.0 Press Next
Install ation type Select Custom Press Next
Available Product Components
Select Prodact languages plus Simplified Chinese press Next
Component Locations Press Next
Privileged operafing System Groups DBA Press Next
creat database Select No press Next
Summary Press Install
Run/u1/oracle/8i/root.sh with Root 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
Select Creat database Now
(2) Configure Oracle
Enter/u1/oracle/8i/bin
Run NETASST (server with) or NETCA (client-side)
You can also change Listener.ora and Tnsnames.ora directly.
Listener.ora file Configuration
LISTENER =
(Description_list =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.16 (db server IP))
(PORT = 1521))
)
(Address_list =
(address = (PROTOCOL = IPC) (KEY = Extproc))
)
)
)
Tnsnames.ora file Configuration
Extproc_connection_data. Webqinmai =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = IPC) (KEY = Extproc))
)
(Connect_data =
(SID = Plsextproc)
(presentation = RO)
)
)
ORCL. W =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.2 (Web server IP))
(PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
Orclbig =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 211.94.129.16 (db server IP))
(PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)
4) Configure Hosts file
Add a DB server address in the Hosts file

5, configure the relevant 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.14.tar.gz #解压apache
[root@wapdb/www]# cd/www/apache_1.3.14 #进入apache的解压目录.
[root@wapdb/apache_1.3.14]#./configure--prefix=/www (Web page storage path)
Install PHP4
[root@wapdb/www]# tar zxvf php-4.0.3pl1.tar.gz #解压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 #编译
[root@wapdb/php-4.0.3]# make install # Installation
[root@wapdb/php-4.0.3]# CP Php.ini-dist/usr/local/lib/php.ini #拷贝ini文
Pieces 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/libphp4.a
[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 httpd.conf
modifying httpd.conf files
The following lines remove the annotation:
ServerName http://..... This must be removed from the annotation
Listen xxx.xxx.xxx:8888 (where xxx.xxx.xxx 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: (Users can be used for access, general use nobody)
User Apache
Group Oracle
DirectoryIndex index,htm (file and file type accessible on the home page)
(Deny directory level access)
Options-indexes
Options-indexes
[root@wapdb/conf]# VI Mime.types
Modify the Mime.types file, add WAP support, add the following line:
Text/vnd. Wap. WML WML
Text/vnd. Wap. WMLScript WMLC
Image/vnd. Wap. WBMP WMLP
Application/vnd. Wap. WMLC WMLC
Application/vnd. Wap. WMLCSRIPTC 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 new FTP user/home/qmupload to/www/htdocs under/etc/passwd
<3> Enter/ETC Editor ftpaccess
Limit Real 2 any| Any 0900-2100
UPLOAD/VAR/FTP * No (FTP up to the user can not upload)
Upload/var/ftp/www/htdocs Yes Real 0666 (ftp up to the user can only be in/www/htdocs
Upload below)
Edit ftphosts (allow visiting IP address)
Allow Qmupload (username) 211.94.129.3 (visiting IP address)
Edit Ftpusers (Deny visiting users)
Oracle (user name)
6, import, export data
1) Import data
When you rebuild the system, import the primary operations for Qinmai user data (the general import only implements IMP):
(1) Create tablespace qinmai_data
DataFile '/u2/qinmaidata/qinmai2001.dbf ' 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)
User name: Qinmai
Password: *******
Import file: Qmxxxx.dmp (enter the name of the data file to import)
Enter Insert buffer size: Carriage return
List only the contents of the import file: Enter
Ignore creation error because the object already exists: Yes
Import Permissions: Enter
Import Table Data: Enter
Import entire export file: Yes
2) Export Data
At the operating system prompt, type: EXP
User name: Qinmai
Password: *******
Enter
Export File: Mqxxxx.dmp (enter the name of the data file to import)
(1) E (complete database) (2) U (user) or (3) T (table) (Default (2) u), carriage return
Export permissions: Enter
Export Table Data: Enter
Compressed area: Enter
Users to export: Qinmai
Enter
7. Conduct security Checks
1 Remove Unused users
Enter/etc, edit passwd file
To LP, Sync, Shutdown, halt, mail, news, UUCP, operator, games, Gopher, etc.
Users who are not normally removed
2 Check for suspicious port and service startup
3 The unused ports and services will be turned off
4) Do access control
Add all:0.0.0.0/0.0.0.0 in/etc/hosts.deny (access ban)
or All:all@all paranoid
Add in/etc/hosts.allow (Access permission)
FTP: Licensed IP Address
PING: Licensed IP Address
1521 (port): 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 remove FTP, Telnet services in/etc/inetd.conf.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.