Install Apache + PHP4.0 + Sybase on Linux

Source: Internet
Author: User
Tags sybase sybase database

[PURPOSE]

Use a linux web server to connect to the Sybase Database on the minicomputer. We installed a database for the experiment on the Sybase server. The database name is test. One table in test is Province, and the field is Province_id and Province.

Province_id Province
-------------------
110 Beijing
120 Tianjin

[Related software]

Redhat 7.0 Linux
Apache 1.3.12
PHP 4.0.0
Sybase 11.9.2 for Linux/Intel

[Installation process]

1. Install Red Hat 7.0

I chose Customer full installation because the X environment is required during Sybase installation.

After the installation is complete, create a working directory/home/workshop and upload all the installation files.

Sybase-common-11.9.2-3.i386.rpm
Sybase-openclient-11.1.1-3.i386.rpm
Apache_1.3.12.tar.gz
Php-4.0.0.tar.gz

2. Install Sybase's open-client.

In the/home/workshop directory:

Host_name # rpm-hiv sybase-common-11.9.2-3.i386.rpm.
Host_name # rpm-hiv sybase-openclient-11.1.1-3.i386.rpm.

The default installation path is/opt/sybase-11.9.2/, and with a sybase user, use the passwd sybase command to change the password of the sybase user.

Now, log on to your linux computer with sybase, and the computer will display

C-Shell users: 
source .cshrc
=> Start 'srvbuild'
srvbuild
Documentation towards any Sybase product can be found on our Dynaweb
pages accessible from our World Wide Web site:
We would like you to register your installation and find more
information about this Sybase Adaptive Server Enterprise release
for Linux available from:
Enjoy this Sybase Adaptive Enterprise Server installation !
bash-2.04$

In this case, start the Xwindow environment,

Bash-2.04 $ startx

In the Xwindow environment, run/opt/sybase-11.9.2/bin/dsedit, select Add New Server Entry,

Server Name: devhost (optional)
Then select add new network transport,
Transport type: TCP
Host name: 211.5.6.50 (Server ip)
Port Number: 5000 (the port listened by the Sybase server)

After that, confirm to exit.

Use the isql command to check whether the connection is successful,

Bash-2.04 $ isql-Usa-Sdevhost
1> use test
2> go
1> select * from test. Province
2> go
Province_id Province
-------------------
110 Beijing
120 Tianjin
130 Hebei
140 Shanxi
150 Inner Mongolia
210 Liaoning
220 Jilin Province
230 Heilongjiang
......
610 Shaanxi Province
620 Gansu
630 QINGHAI PROVINCE
640 Ningxia
650 Xinjiang
660 Tibet
(28 rows affected)
1>
Now the openclient installation is complete.

3. install Apache and PHP4

Host_name/home/workshop # tar-vzxf apache_1.3.12.tar.gz
Host_name/home/workshop # tar-vzxf php-4.0.0.tar.gz

Go to the apache directory and pre-compile apache

#./Configure -- prefix =/home/apache

Install Apache in the/home directory.

Go to the php Directory and compile php + sybase

# Cd ../php-4.0.0
#./Configure -- with-apache = ../apache_1.3.12
-- With-mysl = no
-- With-sybase-ct =/opt/sybase-11.9.2/
-- Enable-ftp
-- Enable-track-vars

# Make; make install
# Cp php. ini-dist/usr/local/lib/php. ini
# Cd ../apache_1.3.12
#./Configure -- prefix =/home/apache -- activate-module = src/modules/php4/libphp4.a
# Make; make install

The compilation has been completed. Now you need to modify some configuration files.

# Cd/home/apache/conf
# Vi httpd. conf

Modify the line of DirectoryIndex index.html index. php3 index. php

Remove # From the line before AddType application/x-httpd-php. php.

Add AddType application/x-httpd-php. php3

Finally, you need to modify several parameters.

ServerName
ServerAdmin
DocumentRoot "/home/apache/htdocs"

Start Apache

Cd ../bin
./Apachectl start

Now, you need to write a file so that apache can be started when the computer is started.

And you will edit/etc/rc. d/rc. sysinit, add auto_run file at the last line.
Auto_run will be created at/usr/sbin and with + x mode.

Auto_run is:
#! /Bin/sh
/Home/apache/bin/apachectl restart

The installation is complete.

[Related articles]


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.