2015-04-27lamp the first part-environment construction

Source: Internet
Author: User

Automatic installation

[Learning Notes] LAMP Automatic Installation Script

Http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=7882&highlight=lamp%2B%2B%B0%B2%D7%B0

Http://www.apelearn.com/bbs/thread-8119-1-1.html

Manual Installation

Preparatory work

Turn off SELinux

Empty iptables

1. Install MySQL
cd/usr/local/src/
wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.72-linux-x86_64-glibc23.tar.gz
Tar zxvf mysql-5.1.72-linux-x86_64-glibc23.tar.gz
MV Mysql-5.1.72-linux-x86_64-glibc23/usr/local/mysql
Useradd-s/sbin/nologin MySQL
Cd/usr/local/mysql
Mkdir-p/data/mysql
Chown-r Mysql:mysql/data/mysql

Cd/usr/local/mysql
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql

(pwd:/usr/local/mysql)

Error: http://www.plob.org/2011/03/10/78.html install epel-release libmcrypt-devel libaio pcre-devel perl libxml2-devel Openssl-devel bzip2-devel freetype-devel libjpeg-devel libpng-devel compat-libstdc*

[email protected] mysql]#/scripts/mysql_install_db--user=mysql--datadir=/data/mysql
Warning:the host ' wuhan-242 ' could not being looked up with RESOLVEIP.
This probably means that your libc libraries is not compatible
With this binary MySQL version. The MySQL daemon, mysqld, should work
Normally with the exception that host name resolving won't work.
This means, should use IP addresses instead of hostnames
When specifying MySQL privileges!
Installing MySQL system tables ...
Ok
Filling Help Tables ...
Ok

[[email protected] httpd-2.2.29]# echo $?
0
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
CP Support-files/mysql.server/etc/init.d/mysqld
chmod 755/etc/init.d/mysqld
Vim/etc/init.d/mysqld

#修改

Basedir=/usr/local/mysql

Datadir=/data/mysql

Chkconfig--add mysqld
Chkconfig mysqld on
/etc/init.d/mysqld start

Starting MySQL error! Couldn ' t find MySQL Manager (/usr/local/mysql/bin/mysqlmanager) or server (/usr/local/mysql/bin/mysqld_safe)
The file is not moving when MV
Check the PWD where Mysqlmanager is located
Test
NETSTAT-LNP |grep 3306
2. Installing Apache
PWD:/usr/local/src/

wget http://archive.apache.org/dist/httpd/httpd-2.2.16.tar.gz
Tar zvxf httpd-2.2.16.tar.gz
CD httpd-2.2.29
./configure--prefix=/usr/local/apache2--enable-mods-shared=most--enable-so

[[email protected] httpd-2.2.29]# echo $?
0

Configure:error:in '/USR/LOCAL/SRC/HTTPD-2.2.21/SRCLIB/APR ':

Configure:error:no acceptable C compiler found in $PATH

See ' Config.log ' for more details.

When you execute./configure, you may encounter the above error, which is primarily a GCC package that is not installed. For this problem, use Yum to install GCC.

Make && make install

Service httpd Start

[[email protected] httpd-2.2.29]# service httpd start
HTTPD: Unrecognized service

/usr/local/apache2/bin/apachectl start

Http://blog.sina.com.cn/s/blog_5093fd500101bzk4.html

Httpd:could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1 for ServerName

[OK]

Http://www.cnblogs.com/52linux/archive/2012/03/24/2415637.html

/etc/httpd/conf/httpd.conf

/usr/local/apache2/conf/httpd.conf

Remove the #ServerName localhost:80 comments from the inside.

[email protected] httpd-2.2.29]# service httpd restart
stopping httpd: [OK]
Starting httpd: [OK]

Test Browser Input 111.47.123.72

650) this.width=650; "title=" 2 "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" 2 "src=" Http://s3.51cto.com/wyfs02/M01/72/9C/wKiom1XoNrWSG7OAAAA09jvyPrc113.jpg "" 244 "height="/>

650) this.width=650; "title=" 1 "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" 1 "src=" Http://s3.51cto.com/wyfs02/M02/72/9C/wKiom1XoNrXBcj_5AAAsCG_aTjM783.jpg "" 244 "height="/>

PS aux |grep httpd

NETSTAT-LNP |grep 80
3. Install PHP

PWD:/usr/local/src/

wget http://mirrors.sohu.com/php/php-5.3.29.tar.gz
Tar zxf php-5.3.29.tar.gz
CD php-5.3.28
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freety Pe-dir--with-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-na Tive-ttf--enable-mbstring--enable-sockets--enable-exif--disable-ipv6
echo $?

1

Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Configure:error:Cannot find OpenSSL ' s <evp.h>

Configure:error:Please Reinstall the BZIP2 distribution

Configure:error:jpeglib.h not found.

[email protected] php-5.3.28]# yum install-y libxml2*

[email protected] php-5.3.28]# yum install-y bzip2*

[email protected] php-5.3.28]# yum install-y openssl-dev*

[email protected] php-5.3.28]# yum install-y libmcrypt*

(Yum install libxml2-devel libjpeg-* libpng-devel freetype-devel gd-devel libmcrypt-devel openssl-devel bzip2*)

Solve

Yum install-y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freet Ype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl Curl-deve L e2fsprogs e2fsprogs-devel krb5 krb5-devel OpenSSL openssl-devel openldap openldap-devel nss_ldap openldap-clients openl Dap-servers

http://blog.csdn.net/default7/article/details/32312061
echo $?
Make && make install

/usr/bin/ld:cannot Find-lltdl

Collect2:ld returned 1 exit status

Make: * * [libphp5.la] Error 1
Http://blog.sina.com.cn/s/blog_65d94e4c010195ys.html
Thank for using PHP.
4. Configure Apache with PHP
Vim/usr/local/apache2/conf/httpd.conf
Found it:
AddType application/x-gzip. gz. tgz
Under this line, add the following:
AddType application/x-httpd-php. php
Found it:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Change the line to read:
<ifmodule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
Found it:
#ServerName www.example.com:80
Modified to:
ServerName localhost:80

[email protected] htdocs]#/usr/local/apache2/bin/apachectl-t
Syntax OK
5. Test parsing PHP
vim/usr/local/apache2/htdocs/1.php
Write:
<?php
echo "PHP parsing normal";
?>
After saving, continue testing:
Curl localhost/1.php

650) this.width=650; "title=" "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" src= "Http://s3.51cto.com/wyfs02/M00/72/9C/wKiom1XoNrbD_zxHAAB-x7AFBzw374.jpg" "244" height= "146"/>

[email protected] htdocs]#/usr/local/apache2/bin/apachectl restart
HTTPd not running, trying to start
(98) Address already in use:make_sock:could not bind to address [::]:80
(98) Address already in use:make_sock:could don't bind to address 0.0.0.0:80
No listening sockets available, shutting down
Unable to open logs
Http://blog.sina.com.cn/s/blog_637e04c901011bmm.html

Vi/etc/services Viewing port numbers
Extended Learning:
mysql5.5 source code Compilation installation http://www.aminglinux.com/bbs/thread-1059-1-1.html
mysql5.6 Source Installation Error http://www.aminglinux.com/bbs/thread-7743-1-1.html
httpd-2.4 version Compilation installation method http://www.aminglinux.com/bbs/thread-7283-1-1.html
Apache startup script joins system Services list http://www.aminglinux.com/bbs/thread-7344-1-1.html
Apache Expansion Module Installation http://www.aminglinux.com/bbs/thread-848-1-1.html
How to specify the use of Worker/prefork http://www.lishiming.net/thread-944-1-1.html
Apache3 mode of operation (default 2.2 is Prefork, 2.4 is event) http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html
Apache Dynamic and static http://www.cnblogs.com/eoiioe/archive/2008/12/23/1360476.html (2.0 and 2.2) http://blog.sina.com.cn/s/ Blog_6238358c01017gdu.html
php5.5, 5.6 Compile and install method http://www.aminglinux.com/bbs/thread-7284-1-1.html
Httpd.conf detailed http://www.php100.com/html/webkaifa/apache/2009/0418/1192.html
Error installing MySQL Unable to initialize missing libstdc++.so.5 http://www.aminglinux.com/bbs/thread-6580-1-1.html

MySQL initialization encountered problems

Http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=7993&highlight=mysql%2B%B3%F5%CA%BC%BB%AF

650) this.width=650; "title=" 3 "style=" border-top:0px; border-right:0px; border-bottom:0px; border-left:0px; Display:inline "border=" 0 "alt=" 3 "src=" Http://s3.51cto.com/wyfs02/M01/72/9C/wKiom1XoNrbStClPAABRvHpP2Bk960.jpg "" 244 "height="/>

[[email protected]support-files]# Ps-a|grep MySQL
18144? 00:00:00 Mysqld_safe
18246? 00:09:56 mysqld
[[email protected]support-files]# Ps-a|grep MySQL
18144? 00:00:00 Mysqld_safe
18246? 00:09:56 mysqld
[[email protected]support-files]# kill-9 18144
[[email protected]support-files]# kill-9 18246
[[email protected]support-files]# Ps-a|grep MySQL
[[email protected]support-files]#/etc/init.d/mysqld Start
Starting MySQL. success!
[[email protected]support-files]#

http://blog.csdn.net/red10057/article/details/7624538

[Learning Notes] LAMP Automatic Installation Script

Http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=7882&highlight=lamp%2B%2B%B0%B2%D7%B0

No such file or directory
Note that there is no such file or directory
You can search in the/usr/local/mysql directory to see if there's mysql_install_db.

2015-04-27lamp The first part-environment construction

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.