Procedure for creating a linux website

Source: Internet
Author: User
For details about how to create a linux website-Linux Enterprise Application-Linux server application, see the following section. 1. install Linux. If you need to use dual NICs later, you 'd better plug in two NICs before installation.
1) install Linux
2) After installation, configure the second Nic In X_window.
Go to X_window and add eth1 to the turbolinux Control Center-network configuration-network interface.
Use ifconfig to check whether eth0 and eth1 have the same interruptions. If they are different, the installation is successful (you can also unplug the network cable.
Check whether the installation is successful)
[Installation] How to Make the kernel detect that two NICs often encounter such problems is actually very simple:
When you have two NICs, add
Append = "ether = 0, eth1"
If you have inserted three blocks, it is:
Append = "ether =, eth1 ether =, eth2"
Example:
Boot =/dev/hda
# Compact # faster, but won "t work on all systems.
Delay = 50
Vga = normal # force sane state
Append = "ether = 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 shoshould be mounted read-only for checking
# Linux bootable partition config ends
This is the practice when you do not know the NIC irq and iobase (especially when the PCI Nic is like 3c590 ...)
When you know the ENI irq and iobase, you should specify the following:
Example: Two 3c590:
Append = "ether = 9, 0xfce0, eth0 ether = 5, 0xfcc0, eth1"
Note: If the module has been compiled, it should be in/etc/rc. d/rc. modules (in TurboLinux
Yes/etc/conf. modules)
Add a similar line:
/Sbin/modprobe ne io = io1, io2
2. After Linux is installed, create users and groups
Groupadd dba (group name)
Groudadd oinstall (group name)
Useradd oracle (user name)
Go to the etc directory and edit the group
Add to oinstall (group): x: 501 racle (User)
Dba (group): x: 502 racle (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 permission to edit/root/. bashrc
Add umask 022
Enter/etc
Edit profile
In./root/. bash_profile and/etc/profile, edit the content 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. Install oracle8.1.6
1) copy the oracle8.1.6 File
<1> use root permission to suspend the optical drive
Method 1: mount/dev/cdrom/mnt
Method 2: mount-t iso9660/mnt
<2> copy an oracle File
Cd/mnt
Method 1: cp oracle/oracle.tar (copy oracle files to/directory as oracle users)
Method 2: cp oracle.tar/u2 /.
2) unlock the oracle File
Tar xvf oracle.tar (expand the package file)
Tar xzvf oracle.tar.gz (decompress and expand the package file)
3) install oracle8.1.6
Grant u1 and u2 the oracle: dba permission
Chown-R oracle: dba/u1
Chown-R oracle: dba/u2
<1> install the oracle client. It is used when the web server and the db server are not on the same server.
(1) install oracle
Log on with an oracle user
Go to X_window
Start the terminal
Cd/Oracle8iR2
Run./runInstaller to start Installation
Welcome:
Press next
File Locations:
Press next
UNIX Group Name:
Enter dba and press next
Error. The system prompts you to run/u1/oracle/8i/orainstRoot. sh with the root permission.
CTRL + ALT + F2 to open a new console (character window)
Log On As root
[Root @ wapdb/root] # cd/u1/oracle/8i/
At this time, there is a file orainstRoot. sh in the/u1/oracle/8i/directory to run it.
[Root @ wapdb/8i] #./orainstRoot. sh
CTRL + ALT + F7, return to the installation page (Graphic window)
Click Retry 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 on different machines with the database server and WEB server)
Installation Types:
Select Typical (128 MB) and press next. A progress ruler is displayed in the upper-right corner of the screen.
You can select the language for installation.
Database Identification:
Global Database Name: Enter dba (optional)
SID: retain orcl
Press next
Database File Location:
Any directory. In this example, set it to "/u1/oracle/8i/" and press Next. Then, the Progress ruler in the upper right corner of the screen continues before
Into
The following is a Summary of the products you want to install.
Press Install, and the Install screen appears. Wait... you can see the installation and other log files prompted at the bottom of the window.
For future query.
The Setup Privileges window is displayed.
Tip: run a script as root before the installation continues.
"/U1/oracle/8i // root. sh ",
CTRL + ALT + F2, return to the first terminal window just running
Run the file as root,
[Root @ wapdb/8i] # sh root. 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 netasst or netca command to start OUI for configuration
Set
You can also directly change listener. ora and tnsnames. ora.
The fastest way is to COPY the tnsnames. ora on the database server 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 #
Use FTP to log on to the oracle server.
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 address ))
(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 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 the oracle server-for web server and db server to use one server, db server
Upper
(1) install oracle
Log on with an oracle user
Go to X_window
Start the terminal
Cd/Oracle8iR2
Run./runInstaller to start Installation
Welcome:
Press next
File Locations:
Press next
UNIX Group Name:
Enter dba and press next
Error. The system prompts you to run/u1/oracle/8i/orainstRoot. sh with the root permission.
CTRL + ALT + F2 to open a new console (character window)
Log On As root
[Root @ wapdb/root] # cd/u1/oracle/8i/
At this time, there is a file orainstRoot. sh in the/u1/oracle/8i/directory to run it.
[Root @ wapdb/8i] #./orainstRoot. sh
CTRL + ALT + F7, return to the installation page (Graphic window)
Click Retry to continue the installation,
Available Products:
Select Oracle8i Enterprise Edition 8.1.6.1.0, and click next
Installation Types:
Method 1: select Typical (540 MB) and press next. A progress ruler is displayed in the upper-right corner of the screen.
You can select the language for installation.
Database Identification:
Global Database Name: Enter dba (optional)
SID: retain orcl
Press next
Database File Location:
In this example, set the directory to "/u1/oracle/8i/" and press Next. Then, the Progress ruler is displayed in the upper-right corner of the screen.
Continue
The following is a Summary of the products you want to install.
Press Install, and the Install screen appears. Wait... you can see the Installation log prompted at the bottom of the window.
File directory for future query.
The Setup Privileges window is displayed.
Tip: run a script as root before the installation continues.
"/U1/oracle/8i // root. sh ",
CTRL + ALT + F2, return to the first terminal window just running
Run the file as root,
[Root @ wapdb/8i] # sh root. 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.
Starting from Database Creation Progress, perform the following four steps
Creating and starting Oracle instance
Copying database files
Initializing database
Database creation completed
The preceding four processes are completed. The Oracle Database Configuration Assistant Alert window is displayed.
The prompt is: the database has been created to tell 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 and complete Installation
Method 2: Select CUSTUM (? MB) (customized installation), Press next,
Oracle universal install
Welcome press next
Filelocations: In destination path:/u1/oracle/8i press next
Unix group name: Enter dba and press next
Run/u1/oracle/8i/orainstRoct. sh with root and press Retry
Availabli Products select oracle8i Enterprise Edition8.1.6.1.0 and press next
Install ation type select custom and press next
Available product components
Select prodact versions ages plus simplified chinese and press next
Component locations press next
Privileged operafing system groups dba press next
Select no in the creat database and press next.
Summary press install
Run/u1/oracle/8i/root. sh with root and press yes
End of installation press exit
Enter/u1/oracle/8i/bin
Run dbassist
Create a database press next
Select m and press next
Select online transaction processing (OLTP) and press next
15. Press next
Select shared server mode and press next
Select All and 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
Keep going next
Select creat database now
(2) Configure oracle
Enter/u1/oracle/8i/bin
Run netasst (for servers) or netca (for clients)
You can also directly change listener. ora and tnsnames. ora.
Listener. ora 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 ))
)
)
)
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 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 the hosts file
Add the db server address to the hosts file
5. Configure related Network Services
1) install apache and php
<1> uninstall the original apache
View 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 # decompress apache
[Root @ wapdb/www] # cd/www/apache_1.3.14 # enter the apache decompression directory.
[Root @ wapdb/apache_1.3.14] #./configure -- prefix =/www (webpage storage path)
Install PHP4
[Root @ wapdb/www] # tar zxvf php-4.0.3pl1.tar.gz # 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 # compile
[Root @ wapdb/php-4.0.3] # make install # Installation
[Root @ wapdb/php-4.0.3] # cp php. ini-dist/usr/local/lib/php. ini # copy ini
To the 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
Modify the httpd. conf file
Remove comments from the following lines:
ServerName http ://....... The comment must be removed.
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 rows: (the user that can be accessed, generally using nobody)
User apache
Group oracle
DirectoryIndex index AND htm (accessible files and file types on the home page)
(Deny directory-level access)
Options-indexes
Options-Indexes
[Root @ wapdb/conf] # vi mime. types
Modify the mime. types file and add WAP support. Add the following lines:
Text/vnd. WAP. WML
Text/vnd. WAP. WMLscript WMLC
Image/vnd. WAP. WBMP WMLP
Application/vnd. WAP. 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 a user to multiple groups of useradd-G dba, oinstall qmupload
<2> change the startup path/home/qmupload of the new 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 on FTP cannot upload files)
Upload/var/ftp/www/htdocs yes real 0666 (FTP users can only access/www/htdocs
Next upload)
Edit ftphosts (accessible IP addresses)
Allow qmupload (User Name) 211.94.129.3 (access IP address)
Edit ftpusers (Access denied)
Oracle (user name)
6. Import and export data
1) import data
During System Reconstruction, the main operations for importing qinmai user data (generally, only imp can be performed for importing ):
(1) create tablespace qinmai_data
Datafile '/u2/qinmaidata/qinmai2001.dbf' size 800 m
Online
Default storage (
Initial 10 m
Next 10 m
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: qmxxxx. dmp (enter the data file name to be imported)
Input buffer size: Press ENTER
Only list the content of the imported file: Press ENTER
The error "yes" is ignored because the object already exists.
Import Permission: Press ENTER
Import table data: Press ENTER
Import the entire exported file: yes
2) Export data
At the operating system prompt, type: exp
Username: qinmai
Password :*******
Enter
Export File: mqxxxx. dmp (enter the data file name to import)
(1) E (complete database) (2) U (User) or (3) T (table) (default: (2) U), press ENTER
Export Permission: Press ENTER
Export table data: Press ENTER
Compression Area: Press ENTER
User to export: qinmai
Enter
7. Perform Security Check
1) Delete unnecessary users
Go to/etc and edit the passwd file.
Lp, sync, shutdown, halt, mail, news, uucp, operator, games, gopher, etc.
Delete unnecessary users
2) Check for suspicious ports and Service Startup
3) Disable unused ports and services
4) Implement Access Control
Add ALL: 0.0.0.0/0.0.0.0 to/etc/hosts. deny (Access prohibited ).
Or ALL: ALL @ ALL PARANOID
Add in/etc/hosts. allow (access permit)
FTP: licensed IP Address
PING: licensed IP Address
1521 (port): licensed IP Address
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 or delete FTP and Telnet services in/etc/inetd. conf.
Related Article

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.