Linux 기초 (4) - LAMP 환경 구축

6309 단어 linux가상 컴퓨터
\ # Linux 단계 학습 중점 1. Linux 상용 명령 2. Linux 시스템 관리 3. Linux 네트워크 응용 4. LAMP 제품 급 환경 구축 5. Apache 서버 설정 6. LNMP 환경 빠 른 배치 - Nginx 서버 설정
\ # \ # 목표 1. 리 눅 스 시스템 을 이용 하여 개발 하 는 능력 2. 리 눅 스 서버 의 일반적인 관리 운영
\ # # 나 흘 째 LAMP 제품 급 환경 구축
 1.        
 2.Apache    
 3.MySQL    
 4.PHP    
 5.    

\ # \ # # 1. 보조 형 패키지 설치 1. 설치 전 준비: 1) 스냅 샷 초기 화 설치 2) IP 닫 기 SELINUX 2. yum 소스 설치 gcc - c + + yum - y install gcc gcc - c + 3. 방화벽 설정 닫 기 4. 리 눅 스 시스템 에 소스 패키지 전송 압축 풀기 vim tar. sh
 	chmod 777 tar.sh
 	./tar.sh
 	cd /lamp
 5.      
	df -h  

   libxml2
 yum -y install python-devel
 
 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/libmcrypt/
  make 
  make install
  
    libltdl,  libmcrypt     ,    
  cd /lamp/libmcrypt-2.5.8/libltdl
 ./configure --enable-ltdl-install
 make
 make install
			
   mhash	
 cd /lamp/mhash-0.9.9.9
 ./configure 
 make
 make install
 
   mcrypt
 cd /lamp/mcrypt-2.6.8
 LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/lib  \
 ./configure --with-libmcrypt-prefix=/usr/local/libmcrypt
 make 
 make install
 
   zlib
 cd /lamp/zlib-1.2.3			
./configure
 make
 make install  

libpng cd / lamp / libpng - 1.2.31 을 설치 합 니 다. / configure -- prefix = / usr / local / libpng make make make 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/jpeg6/man/man1
 
 cd /lamp/jpeg-6b
 ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
 make	
 make install
 
   freetype
 cd /lamp/freetype-2.3.5
 ./configure --prefix=/usr/local/freetype/
 make
 make install

\ # \ # \ # 2. 아파 치 서비스 설치
  Apache
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

     
/usr/local/apache2/bin/apachectl start
ps  aux | grep httpd
netstat –tlun | grep :80
    192.168.184.252   It works!

     
vim /etc/rc.local
/usr/local/apache2/bin/apachectl start

\ # \ # 3. MySQL 서비스 설치
  ncurses
yum -y install ncurses-devel

  cmake bison
yum -y install cmake bison

  MySQL
1.     
  groupadd mysql
  useradd -g mysql mysql
  
  cd /lamp/mysql-5.5.48
  cmake  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql    -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.  
  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
  
  /usr/local/mysql/scripts/mysql_install_db --user=mysql


3.  
/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/mysql/bin/mysql -u root -p 

\ # \ # \ # 4. PHP 소프트웨어 설치
yum -y install "libtool*"

  php
cd /lamp/php-7.0.7
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/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
 
  php.ini  
mkdir /usr/local/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

/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl start

vim /usr/local/apache2/htdocs/test.php    


       192.168.184.252/test.php


    
vim /etc/profile
export PATH="/usr/local/php/bin:$PATH"
export PATH="/usr/local/mysql/bin:$PATH"
export PATH="/usr/local/apache2/bin:$PATH"

source /etc/profile 

openssl 설치 (확장 모듈 컴 파일 설치 방법) yum - y install openssl - devel  cd / lamp / phop - 7.0.7 / ext / openssl mv config0. m4 config. m4 를 설치 해 야 합 니 다. 그렇지 않 으 면 오류 가 발생 합 니 다. config. m4 / usr / local / phop / bin / phopize. / configure -- with - openssl -- with - phop - config = / usr / local / phop / bin / phop - config make make install
vim  /usr/local/php/etc/php.ini
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20151012/"
extension="openssl.so";

apachectl stop
apachectl start

    192.168.184.252/test.php      openssl   

  phpMyAdmin

cp -r /lamp/phpMyAdmin-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'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'http';

   192.168.184.252/phpmyadmin/index.php

숙제
1.  LAMP           
2.  Memcache      
3.    PHP           
4.  Samba     /usr/local/apache2/htdocs/  
5.  Apache        

6.        1.      Linux        
               2.         Linux MySQL  
               3.      
  vim /usr/local/php/etc/php.ini
  		display_errors=on


          
  define('ROOT','http://192.168.184.174/bbsV0.1');
  ...
  define('PWD','123456');

​ ​
​ ​ ​ ​ ​ ​ ​ ​ ​
​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​

좋은 웹페이지 즐겨찾기