Apache+mysql+php Kit

Source: Internet
Author: User
Tags bz2 phpinfo apache tomcat

A apache+mysql+php environment has recently been installed. After Google, we found that the installation is becoming more and more simple. No need for cumbersome configuration installation, just a simple execution of SH will be done.

Then I Google to have so many, respectively, corresponding to different platforms, the first is the Windows suite installed Easyphp,uniform Server;

Solaris has the SAMP, support each platform has XAMPP, this also is in the net reputation best, but in support Solaris10 under the question. Therefore, it is recommended that the Solaris platform use Samp. I'm here reprint a very detailed Samp installation steps

From: http://www.chinasolaris.com/viewthread.php?tid=1185&extra=page%3D1

SAMP (Solaris, Apache, MySQL, and perl/python/php) are from lamp (Linux, Apache, MySQL, and PHP) evolved from the framework of 1.
Figure 1 SAMP Frame
First, Samp download the installation process!
SAMP is installed and configured in two ways:
(1) Download, install, and configure Apache, MySQL, and Php/perl/python, respectively.
(2) Download, install and configure the Coolstack. Coolstack is one of the most commonly used and for Sun Solaris operationsSystems specifically optimized for open sourcePackage. And the focus is Apache, PHP, and MySQL. Therefore, using this package, the AMP can be run in the best state. Over hereIt is recommended to install the Coolstack package directly. Coolstack official website: http://cooltools.sunsource.net/coolstack/, you must register a valid ID before downloading to download. On the download page click on cool stack 1.2 download, here are available for differentInstallation version of the platform (SPARC, Intel x86/amd64), version 1.2 of the Coolstack download page:
Https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/DownloadSingleSoftware-Start? Productid=h.9ibe.o7lyaaaebxxugcqzu&license-x8jibe.ofkiaaaebyhugcqzu=on&s_evar4=cds&vva_ 00000000005000063844=ENGLISH&VVA_00000000005000063845=SOLARIS%2010%20OS%20 (x86)
The main packages include the following:
· Cskamp. AMP Component Package: CSKapache2, CSKPHP5, and CSKMysql32. This package has been preconfigured to ensure that it works together after installation. Where MySQL is the 32-bit version.
· Cskruntime. is a run-time package that most other packages rely on. Since it is a dependent package, it is important to note that the runtime package must be installed before other dependent packages are installed.
· Cskmysql. MySQL5 64-bit version of the package.
· Cskperl. PERL5 packages and some of the associated extension libraries.
· Cskphplibsbundle. The libraries on which the various PHP expansion packs depend, including three packages:
· Cskmemcached. Well-known distributed object cachingTools: Memcached.
· Cskruby. Ruby and RubyGems, rails packets.
· Csksquid. Web Caching Tool Squid.
· Csktomcat. Java-Pure Apache Tomcat, unlike Tomcat on tomcat.apache.org.
· Csklighttpd. Lightweight webServer lighttpd.
1 Installing Cskruntime!
# BUNZIP2 CSKRUNTIME_1.2_X86.PKG.BZ2
# Mkdir/var/tmp/cskruntime-test
# Pkgtrans cskruntime_1.2_x86.pkg/var/tmp/cskruntime-test/
# pkgadd-d/var/tmp/cskruntime-test/
The installation process is omitted.
  2 Installing Cskamp
# BUNZIP2 CSKAMP_1.2_X86.PKG.BZ2
# mkdir/var/tmp/cskamp-test/
# Pkgtrans cskamp_x86.pkg/var/tmp/cskamp-test/
# pkgadd-d/var/tmp/cskamp-test/
The installation process is omitted.
  3 Installing Cskphplibsbundle
# BUNZIP2 CSKPHPLIBSBUNDLE_1.2_X86.PKG.BZ2
# Mkdir/var/tmp/cskphplibsbundle-test
# Pkgtrans Cskphplibsbundle_1.2_x86.pkg/var/tmp/cskphplibsbundle-test
# pkgadd-d/var/tmp/cskphplibsbundle-test/
   4 Verifying the installation version
UseThe command is as follows: # pkginfo-l CSKapache2
Pkginfo-l CSKapache2
Pkginst:cskapache2
Name:apache httpd
Category:application
Arch:i386
version:2.2.6
BASEDIR:/
Vendor:apache
DESC:HTTPD is built with MPM pre-fork and modules to support PHP, SSL and Perl. Pstamp:
Instdate:8?? 07 2008 16:59
Hotline:please See http://httpd.apache.org/bug_report.html
STATUS: Install all 2
files:1378 an installed pathname
7 Shared path names
55 Catalog
92 ExecutableFile
1 Setuid/setgid executable file
59,831 used blocks (approximate)
You can see that Apache is providing the worker module, not the old PREFORK.C module.
Figures 2 and 3 are the verification interface for the PHP5 and MySQL 32-bit versions.


   ii. Initialization and startup of Mysql server
Copy configuration file
Cp/opt/coolstack/mysql_32bit/share/mysql/my-medium.cnf/etc/my.cnf
Add MySQLUsers and user groups:
# Groupadd MySQL
# useradd-g MySQL MySQL
Initialize MySQL 4 with the following command
#/opt/coolstack/mysql_32bit/bin/mysql_install_db

Figure 4 Initializing MySQL
When you initialize MySQL, a/opt/coolstack/mysql_32bit/data directory is created automatically.To set the MySQL user's access to the Data folder:
# Chown-r Mysql:mysql/opt/coolstack/mysql_32bit/data
Now it's time to start the MySQL process:
#/opt/coolstack/mysql_32bit/bin/mysqld_safe &
Its execution is shown in procedure 5.

Testing the MySQL Client
Use commands to create a simpleDatabase
#/opt/coolstack/mysql_32bit/bin/mysqladmin Create TestDB
#/opt/coolstack/mysql_32bit/bin/mysql
Welcome to the MySQL Monitor. Commands End With
Your MySQL Connection ID is 3
   Server Version:5.0.45-standard-log Source Distribution
Type ' help; ' or ' \h ' for help. Type "\c" to clear the buffer.
Mysql>
Mysql> Use TESTDB9
Database changed
mysql>#
Mysql> exit
Description: Through Coolstack installed MySQL, the character set is UTF-8, the connection proofing format is utf8_general_ci.
third, set MySQL and Apache as SMF services
SMF is a software service in the Solaris 10 operating systemManagement tools. It replaces the service run script in the/ETC/*.D of the previous operating system. For readers who have used Linux, the SMF function is similar to the "daemon" in "Ntsys", and for readers who have used Unix, this feature is a replacement for some directory/etc/rc*. The startup script in D (there is no override) and the Power Server (inetd) function. In addition, the Solaris 9 reader knows that Solaris 9 does not have this management tool, which is a new feature of Solaris 10. Set MySQL and Apache as SMF services and start with the Solaris server at the same time:
# Svcadm Enable Svc:/network/csk-mysql32:default
# Svcadm Enable Svc:/network/csk-http:cskapache2
View the MySQL and Apache service status commands as follows:
# svcs-a | grep csk-mysql32
Online 9:17:31 Svc:/network/csk-mysql32:default
There are several types of service statuses:
? Degraded, the service has started, but is running in a restricted state.
? Disabled, the service is turned off.
? Legacy_run, this service is not managed by SMF, but can be monitored by SMF.
? maintenance, maintenance status. This service has a large number of errors and should be repaired by the manager.
? Offline, the service has been started, but is offline and not running online.
? Online, the service is up and running.
? Uninitialized, the service is in the initializing state.
Iv. Testing the SAMP environment
Start the MySQL server
# Svcadm Enable Csk-mysql32
Start Apache Server
# Svcadm Enable Csk-http
Description: The MySQL and Apache server shutdown commands are followed:
Test Apache, select Menu "Application" | Internet "|"Firefox Web Browser, open Firefox, enter http://localhost in the address bar to see if Apache is running successfully. If there is a home page titled Cool Stack from the OpenSolaris Web Stack project, it shows that Apache can successfully provide the underlying HTML service. 6.

Figure 6 tests the Apache Server
test if Apache can parse the php  document. Edit a file using VI phpinfo.php
# cd/opt/coolstack/apache2/htdocs/
# vi phpinfo.php
<body> <p>hello samp!</?>
<?php phpinfo ();?;
</body>  
& Lt;/code>
Enter in the address bar  http://localhost/phpinfo.php  if a figure 7 indicates that PHP parsing was successful.

Figure 7 tests whether Apache can parse the PHP document
Common Troubleshooting:
If Apache cannot parse the PHP document, modify the PHP configuration file:/opt/coolstack/php5/lib/php.in I, add two lines:
extension= "mysql.so"
extension= "mysqli.so"
Modify Apache configuration file/opt/coolstack/apache2/conf/ httpd.conf, add a line:
LoadModule php5_module modules/libphp5.so. U ' Z4 M7 r#} "K7 F
Summary: This article uses the Solaris version is the U4 version, and the same can be applied to open Solaris, Sxde. Coolstack has 1.1, 1.2, 1.3RC Three versions this article uses 1.2. AMP is also used in a variety of Linux platforms, forming a well-known LAMP architecture. The AMP on Solaris, Samp, is now a Web development platform comparable to LAMP, WAMP (Windows + amp) and Mlap (Mac OS + amp).

Where I add red, not everyone executes the same commands. We should use this command first to see the Svcs-a|grep CSK.

Online 13:15:28 SVC:/NETWORK/HTTP:APACHE22-CSK
Online 13:15:46 SVC:/APPLICATION/DATABASE/MYSQL:MYSQL32-CSK

Then use the following commands according to the specific content, such as to my environment, then I will use

Svcadm Enable SVC:/APPLICATION/DATABASE/MYSQL:MYSQL32-CSK

Svcadm Enable SVC:/NETWORK/HTTP:APACHE22-CSK

To change their status from disable to online.

Then we launch Apache and MySQL.

Svcadm Enable APACHE22-CSK

Svcadm Enable MYSQL32-CSK

That would be good.

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.