Install Apache2 + PHP5 + MySQL + Resin + SSL + GD + weba on RedhatAS3.0

Source: Internet
Author: User
Tags install openssl
Install Apache2 + PHP5 + MySQL + Resin + SSL + GD + weba on RedhatAS3.0, the latest and most complete IT technology tutorial program Development> Web Development> PHP integrated RedhatAS3.0 install Apache2 + PHP5 + MySQL + Resin + SSL + GD + weba author: Unknown Time: Source: Blog.ChinaUnix.net editor: chinaitpower abstract: install Apache2 + PHP5 + MySQL + Resin + SSL + GD + weba on RedhatAS3.0
Install Apache2.0.50 + MySQL + PHP5 + Resin + SSL + GD and webalizer on RedhatLinuxAS3.0)

Copyright Disclaimer: This article can be reproduced at will. during reprinting, please maintain the integrity of the article, and mark the original source and author information of the article in the form of hyperlinks and this statement.
Original source: bytes
Author: TROYOO beyond (troyoo@troyoo.com) draft date:

 
We assume that no server programs, such as Apache and MySQL, are selected during system installation. If it has been installed, uninstall it first. We also assume that the development tool has been installed.

Part 1: web server configuration

(1) Download Files: (assume all files are stored in ~ /Server)

Httpd-2.0.50.tar.gz
Http://apache.linuxforum.net/dist/httpd/httpd-2.0.50.tar.gz
Mysql-standard-4.0.20-pc-linux-i686.tar.gz
Http://dev.mysql.com/get/Downloads/MySQL-4.0/mysql-standard-4.0.20-pc-linux-i686.tar.gz/from/http://mysql.ihostunit.com/
Php-5.0.0.tar.gz
Http://cn.php.net/get/php-5.0.0.tar.gz/from/this/mirror
Resin-3.0.8.tar.gz
Http://www.caucho.com/download/resin-3.0.8.tar.gz
Openssl-0.9.7d.tar.gz
Ftp://ftp.openssl.org/source/openssl-0.9.7d.tar.gz
J2sdk-1_4_2_05-linux-i586-rpm.bin
Http: // 192.18.97.74/ECom/EComTicketServlet/BEGINjsecom8b.sun.com-10d7% 3A40faaebd % found/-2147483648/452386287/1/489890/489674/452386287/2ts +/westCoastFSEND/j2sdk-1.4.2_05-oth-JPR/j2sdk-1.4.2_05-oth-JPR: 3/j2sdk-1_4_2_05-linux-i586-rpm.bin
Gd-2.0.27.tar.gz
Http://www.boutell.com/gd/http/gd-2.0.27.tar.gz
 

(2) installation

1. MySQL
# Groupadd mysql
# Useradd-g mysql
# Cd/usr/local
# Gunzip <~ /Server/mysql-standard-4.0.20-pc-linux-i686.tar.gz | tar xvf-
# Ln-s mysql-standard-4.0.20-pc-linux-i686 mysql
# Cd mysql
# Scripts/mysql_install_db -- user = mysql
# Chown-R root.
# Chown-R mysql data
# Chgrp-R mysql.
# Bin/mysqld_safe -- user = mysql &
#./Mysqladmin-u root password 'password' # use mysqladmin for repair
Change the root password to 'password'

Automatically run when the system starts:
# Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
# Chkconfig -- add mysqld

Set ntsysv to enable mysql to run automatically at each startup.

After mysql is installed, you can start your mysql service.
#/Etc/rc. d/init. d/mysqld start

2. install openssl
Cd ~ /Server

# Tar-zxvf openssl-0.9.7d.tar.gz
# Cd openssl-0.9.7d
#./Configure -- prefix =/usr/local/openssl # set the installation path
# Make
# Make install

3. configure Apache

# Cd/usr/local/
# Tar-zxvf ~ Sea/server/httpd-2.0.50.tar.gz
#./Configure -- enable-so -- enable-ssl -- with-ssl =/usr/local/openssl -- enable-rewrite
# Make
# Make install
 
Generate an Apache startup file

# Cd/etc/rc. d/init. d
# Sed's/sbin/atd/local/servers/apache/bin/httpd/g' atd> httpd
# Sed's/atd/httpd/g' httpd>/tmp/txt
# Sed's/at daemon/httpd daemon/g'/tmp/txt> httpd
# Rm/tmp/txt
# Chmod 755 httpd
# Chkconfig -- level 345 httpd on
# Chkconfig -- level 0126 httpd off


Start and test the Apache server
#/Etc/rc. d/init. d/httpd start
If:
Starting httpd daemon: [OK]

It indicates that httpd has been correctly installed and is running in the background. if there are other prompts, check whether your installation steps are correct.
Enter http: // localhost or http: // yourIP to view the welcome page of apache.


3. configure J2DK
# Cd ~ /Server
# Chmod 755 j2sdk-1_4_2_05-linux-i586-rpm.bin
# Rpm-ivh j2sdk-1_4_2_05-linux-i586.rpm
Vi ~ /. Bash_profile
Change it to the following:

JAVA_HOME =/usr/java/j2sdk1.4.2 _ 05
CLASSPATH = $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/rt. jar
PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/jre/bin
BASH_ENV = $ HOME/. bashrc
USERNAME = "root"

Export USERNAME BASH_ENV PATH JAVA_NAME CLASSPATH

Log out and log on again to make the environment variable take effect.
# Exit
# Su-
# Java
# Javac

If java and javac run, the java environment variable is successfully configured.

 
4. install Resin

# Cd/usr/local
# Tar-zxvf ~ /Server/resin-3.0.8.tar.gz
# Cd resin-3.0.8/
#. /Configure -- with-java-home =/usr/java/j2sdk1.4.2 _ 05 -- with-apxs =/usr/local/apache2/bin/apxs -- with-apache =/usr/ local/apache2

# Make
# Make install
 
Use vi to create a file named test. jsp in/usr/local/servers/apache/htdocs/. its content includes:

<%
Out. println ("Hello, World! ");
%>

After saving the disk, use the browser to view http: // 202.99.11.120/test. jsp. if it is correct, you can see "Hello, World! . Otherwise, check whether Resin is running, whether the Resin parameter is modified correctly, whether the JAVA environment is installed correctly, and whether Apche is running properly.

5. install GD
# Cd/usr/local
# Tar-zxvf ~ /Server/gd-2.0.27.tar.gz
# Cd gd-2.0.27/
#./Configure -- prefix =/usr/local/gd2
# Make
# Make install

 
6. install PHP
# Cd/usr/local
# Tar-zxvf ~ /Server/php-5.0.0.tar.gz
# Music php-5.0.0 php5
# Cd php5/
#. /Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql =/usr/local/mysql -- with-gd =/usr/local/gd2 -- enable- track-vars -- enable-ftp

# Make
# Make install

Use vi to open httpd. conf and add the following in the header:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
AddType application/x-httpd-php. php3

Restart Apache for modification to take effect
#/Etc/rc. d/init. d/httpd restart

Test PHP
Use vi to create a file (info. php) in/www/troyoo.com. The content includes:

Phpinfo ();
?>

Use a browser to view the number of http: // yourIP/info. php files. If an error occurs, check whether Apache is running and whether the parameter modification is correct.

 

Part 2: web server log analysis software webalizer

Webalizer-2.01-10-src.tgz
Ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.01-10-src.tgz

# Tar zxf webalizer-2.01-10-src.tgz
#./Configure -- with-language = simplified_chinese -- with-gdlib =/usr/local/gd2 -- with-gd =/usr/local/gd2

# Perl/path/of/webalizer_patch.pl./# here to solve the garbled problem, see (http://www.troyoo.com/article/04/07/18/115309.shtml)
# Make
# Make install
# Mkdir/www/troyoo.com/usage

# Cp webalizer/usr/bin/
# Cd/etc
# Ls webalizer *
Webalizer. conf. sample
# Cp webalizer. conf. sample webalizer. conf. troyoo
# Vi webalizer. conf. troyoo
Edit the webalizer. conf. troyoo file (change the value to the following ):

LogFile/usr/local/apache2/log/access_log
OutputDir/www/troyoo.com/usage
HostName www.troyoo.com
Incremental yes
PageType htm *
PageType cgi
PageType php
HideURL *. gif
HideURL *. GIF
HideURL *. jpg
HideURL *. JPG
HideURL *. ra
IgnoreURL/taskbar *
 

Run:

#/Usr/bin/webalizer-c/etc/webalizer. conf. troyoo

Normal information:

Webalizer V2.01-10 (Linux 2.4.21-4.EL) Simplified Chinese
Use the log file/usr/local/apache2/logs/access_log (clf)
Output to/www/troyoo.com/usage
The report generation host name is 'sea'
Reading history file... webalizer. hist
Generating report ---- July 20
Generating comprehensive report
Saving the history file...
3273647 records in 33.57 seconds, 97517/sec
 
Automatic running:

Set crontab to run webalizer once every hour:
# Crontab-e
0 ***/usr/bin/webalizer-c/etc/webalizer. conf. troyoo

View results:
Http://www.troyoo.com/usage
 

Now, Apache2.0.50 + MySQL + PHP5 + Resin + SSL and webalizer have been installed on Redhat LinuxAS3.0. the root directory of the website is/www/troyoo.com, you can provide website services based on PHP and JAVA on this system.


Author: TROYOO beyond (troyoo@troyoo.com) draft date:
More information, Welcome to: http://www.troyoo.com










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.