"Linux" Lamp Environment Construction (simple version)

Source: Internet
Author: User
Tags install openssl mcrypt php software phpmyadmin

I. Ancillary PACKAGE Installation
Preparatory work: 1.          Linux system ready to restore Snapshot (initialize installation) Set IP off selinux configuration yum source 2.yum-y install GCC gcc-c++ 3. Turn off firewall 4. Copy Source Package Decompression         Vim tar.sh cd/lamp/bin/ls *.tar.gz > ls.list for tar in ' cat ls.list ' do        /BIN/TAR-ZXF $TAR done/bin/rm ls.list chmod 777 tar.sh./tar.sh 5. Sufficient space Df-h installing LIBXML2 yum-y install Python-devel must be installed cd/lamp/libxml2-2.9.1./configure--prefix=/usr/ Local/libxml2/make make install Libmcrypt cd/lamp/libmcrypt-2.5.8./configure--PREFIX=/USR/LOCAL/LIBM Crypt/make make install Libltdl Cd/lamp/libmcrypt-2.5.8/libltdl./configure--enable-ltdl-install m Ake make install installs Mhash cd/lamp/mhash-0.9.9.9./configure make make install install MCrypt cd/lamp/ mcrypt-2.6.8 ld_library_path=/usr/local/libmcrypt/lib:/usr/local/lib./configure--with-libmcrypt-prefix=/usr/loc Al/libmcrypt MAKe make install installs zlib cd/lamp/zlib-1.2.3./configure make make install install libpng CD/      lamp/libpng-1.2.31./configure--prefix=/usr/local/libpng make make install install Jpeg6 Mkdir/usr/local/jpeg6 Mkdir/usr/local/jpeg6/bin mkdir/usr/local/jpeg6/lib mkdir/usr/local/jpeg6/include mkdir-p/usr/local/jpe G6/man/man1 cd/lamp/jpeg-6b./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static make M Ake install FreeType cd/lamp/freetype-2.3.5./configure--prefix=/usr/local/freetype/make Make Install
Two. Apache Service installation
    cp  -r  /lamp/apr-1.4.6  /lamp/httpd-2.4.7/srclib/apr    cp  -r  /lamp/apr-util-1.4.1  /lamp/httpd-2.4.7/srclib/apr-util    cd /lamp/pcre-8.34      ./configure && make && make install     cd /lamp/httpd-2.4.7    ./configure --prefix=/usr/local/apache2/ --sysconfdir=/usr/local/apache2/etc/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared    make    make install    启动Apache测试:    /usr/local/apache2/bin/apachectl start    ps  aux | grep httpd    netstat –tlun | grep :80    浏览器测试 192.168.183.251    It works!    开机自启动    vim /etc/rc.local    /usr/local/apache2/bin/apachectl start
Three. mysql Service installation
    Installing ncurses yum-y Install ncurses-devel install cmake Bison yum-y install cmake bison installing MySQL 1. Groupadd mysql useradd-g mysql mysql cd/lamp/mysql-5.5.48 cmake-dcmake_install_prefix=/usr/local/mysq L-dmysql_unix_addr=/tmp/mysql.sock-dextra_charsets=all-ddefault_charset=utf8-ddefault_collation=utf8_general_ Ci-dwith_myisam_storage_engine=1-dwith_innobase_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline =1-denabled_local_infile=1-dmysql_user=mysql-dmysql_tcp_port=3306 make && make install 2. Initializing the database system    The unified table modifies the configuration file two times to authorize Cd/usr/local/mysql/chown-r MySQL.    Chgrp-r MySQL.    /usr/local/mysql/scripts/mysql_install_db--user=mysql chown-r Root. Chown-r MySQL data cp support-files/my-medium.cnf/etc/my.cnf Two-time authorization/usr/local/mysql/scripts/mysql_install_db--u Ser=mysql 3. Start service initialization password boot/usr/local/mysql/bin/mysqld_safe--user=mysql & vim/etc/rc.local/usR/local/mysql/bin/mysqld_safe--user=mysql &/usr/local/mysql/bin/mysqladmin-uroot Password 123456/usr/local/m  Ysql/bin/mysql-u root-p Login
Four. PHP Software Installation
    Yum-y Install "libtool*" cd/lamp/php-7.0.7./configure--prefix=/usr/local/php/--with-config-file-path=/usr/l ocal/php/etc/--with-apxs2=/usr/local/apache2/bin/apxs--with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr /local/jpeg6/--with-png-dir=/usr/local/libpng/--with-freetype-dir=/usr/local/freetype/--with-mcrypt=/usr/local /libmcrypt/--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-soap--enable-mbstring=all--enable-sockets-- With-pdo-mysql=/usr/local/mysql--with-gd--without-pear make && make install build php.ini Mkdir/usr/loc     Al/php/etc/cp/lamp/php-7.0.7/php.ini-production/usr/local/php/etc/php.ini vim/usr/local/apache2/etc/httpd.conf AddType application/x-httpd-php. php. phtml addtype application/x-httpd-php-source. Phps Restart Apache service:/usr/local/ Apache2/bin/apachectl stop/usr/local/apache2/bin/apachectl start test: vim/usr/local/apache2/htdocs/test.ph   P <?php phpinfo ();   ?> 192.168.183.251/test.php 

# # #五. Wrapping up Software Installation environment variables

    environment variable Vim/etc/profile export path= "/usr/local/mysql/bin: $PATH" Export path= "/usr/local/apache2/bin: $PATH"    Export path= "/usr/local/php/bin: $PATH" source/etc/profile installing OpenSSL yum-y install openssl-devel  must be installed     Cd/lamp/php-7.0.7/ext/openssl MV Config0.m4 config.m4 otherwise error: Config.m4/usr/local/php/bin/phpize not found ./configure--with-openssl--with-php-config=/usr/local/php/bin/php-config make make and install vim/usr/local/p    Hp/etc/php.ini Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20151012/" extension= "openssl.so"; /usr/local/apache2/bin/apachectl stop/usr/local/apache2/bin/apachectl Start installation phpMyAdmin cp-r/LAMP/PHPMYADMI N-4.1.4-all-languages/usr/local/apache2/htdocs/phpmyadmin cd/usr/local/apache2/htdocs/phpmyadmin CP Config.sample    . inc.php config.inc.php Vim config.inc.php $cfg [' Servers '] [$i] [' auth_type '] = ' http '; Test 192.168.183.251/phpmyadmin/index.php Project Migration: 1. SourceCode migration 2. Database Migration 3. Modify Configuration 4. Testing 

"Linux" Lamp Environment Setup (simplified version)

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.