CentOS Build Install Lamp

Source: Internet
Author: User
Tags apache php mcrypt php memcached zts fully qualified domain name

Uninstall PHP to see if there are Phprpm-qa | grep php Uninstall Yum Remove php* See if there is no php.ini configuration file is necessary under the global (root directory) search under the php.* file, see if there is no, there is a delete uninstall MySQL to see if there is MySQL software: Rpm-qa | grep MySQL If there is yum remove mysql* compat-mysqlrm-rf/var/lib/mysqlrm/etc/my.cnf It is necessary to search under the global (root directory) under the My.* file, see if there are any, then delete find. -name my.* Uninstall Apache and look for httpdfind under the root directory. -name httpd close httpd Service/path/HTTPD stop list httpd related packages rpm-qa|grep httpd uninstall package rpm-e--nodeps httpd close iptables and Selinuxservice IPT Ables Stopvim/etc/sysconfig/selinux Then, modify the selinux=disable above is ready for installation below is the start of the real installation due to the Linux relationship, each software has a default installation path, such as:/usr/ Local, usually installed here, this is the path of the installation before, can pass the software of the./configure--help #查看如果要修改安装路径, you can--prefix= path to modify, here are the default, without modification, easy to view the source installation MySQL installation selected is the Source code platform download version for mysql-5.6.23.tar.gz This version to build itself, so it's best to install the tools and libraries required to compile the source and the Yum install GCC gcc-c++ Ncurses-devel Perl curses which, generally installs two kinds of packages, similar: Pcre and Pcre-develpcre provide a compiled version of the library, Pcre-devel provide the development phase of the header files and compile the project source code, So we need to install CMake, download the source code from http://www.cmake.org and compile the installation for convenience, copy cmake-nn.tar.gz to/usr/local TAR-XZVF cmake-nn.tar.gz CD Cmake-nn./bootstrapmake && make install compilation, rootAccording to the official website set up MySQL user and group new MySQL user group groupadd mysql new MySQL user useradd-r-g MySQL MySQL decompression mysql compression package, at this time method, I put the package in/usr/local tar zxvf  MYSQL-VERSION.TAR.GZCD Mysql-version compiles and installs CMake with CMake. # At this point it is possible to prompt Ncurses-devel not installed, re-yum install ncurses-develmake && make install modify MySQL directory owner and Group cd/usr/local/ Mysqlchown-r MySQL. chgrp-r MySQL. Initialize the MySQL database scripts/mysql_install_db--user=mysql modify the MySQL database file directory chown-r root. chown- R MySQL Data settings security bin/mysqld_safe--user=mysql & copy MySQL service startup profile cp/usr/local/mysql/support-files/my-default.cnf/ ETC/MY.CNF Copy the MySQL service startup script and join the path path CP support-files/mysql.server/etc/init.d/mysqld with vim open vim/etc/profile add the following: PATH =/usr/local/mysql/bin:/usr/local/mysql/lib: $PATHexport path to save the exit, and then source/etc/profile start the MySQL services service mysqld Start mysql command login ln-s/usr/local/mysql/bin/mysql/usr/bin #做个链接即可此时, can log into the database mysql-h localhost-u root- p password is empty then can repair those user name such as delete dangerous, set password ... Set the password (123456) as follows update user set Password=password (' 123456 ') where host= ' localhost '; flush privileges; Errors that may occur: Starting MySql.. The server quit without updating PID file ([failed]/mysql/server03.mylinux.com.pid). Workaround: Delete the/etc/my.cnf file first, and then start again from the scripts/mysql_install_db--user=mysql in the previous step to the end and try again at this point, the MySQL installation is successful and LAMP,LNMP is installed this way MySQL below installation apache-2.2.xx can refer to the official website manual This installs as httpd-2.2.29.tar.gz, for the convenience and the official website example, uses the httpd-2_x_nn.tar.gz to indicate if does not install PCRE,APR, Apr-util (expressed in yy), then yum install yy yy yy installation apachetar-zxvf httpd-2_x_nn.tar.gzcd httpd-2_x_nn./configure--enable-so #如果还是无 The APR was detected by the method. The Yum install Apr*make && make installs above each step to be successful, otherwise the next step does not use, if smooth, above represents the Apache installation successfully launches apache/usr/local/apache2/ Bin/apachectl Star If there are error prompts, such as could not reliably determine the server's fully qualified domain name, using localhost.localdom Ain for ServerName Modify Httpd.conf,servername www.example.com:80 #前面的 "#" to remove, restart Apache If successful, stop the Apache server and continue with the installation php/usr/ Local/apache2/bin/apachectl stop below install Apache PHP with php-5.5.23, in order to facilitate the same as the manual, with php-version.tar.gz means first install the relevant development tools Yum Install Libxml2-devel gd-devel libmcrypt-devel libcurl-devel openssl-devel from the official download, unzip TAR-XVF php-verSION.TAR.GZCD Php-version Compile the installation, first check the format of the parameters there is no problem, if there is, then modify, see below./configure--help then installed, where--WITH-APXS2=/..../APXS, Be sure to check whether the directory is not such a command, if not, then modified to and the directory under the same name, the selection of the project is to make Apache and PHP with the same version of the Apxs tool, or it will be wrong if the compile prompt, XX or xx.h does not exist, directly available Yum -y install xx xx-devel #安装相当的编译工具以下为编译安装的参数, set according to your own needs./CONFIGURE--WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS-- With-mysql--with-mysqli--enable-calendar--enable-mbstring--enable-soap--enable-sockets--enable-zip--WITH-GD-- Enable-ftp--enable-libxml--with-curl--with-openssl--with-mcrypt=/usr/local/lib which indeed MCrypt may have to install other files to complete if prompted to do so, When compiling these, you can download Libmcrypt (libmcrypt-2.5.8.tar.gz): MCrypt (mcrypt-2.6.8.tar.gz): Mhash (mhash-0.9.9.9.tar.gz): Install first Libmcrypt, then Mhash, finally mcrypt step is basically decompression, installation, such as TAR-ZXVF xxxx.gz.gzcd xxxx./configuremake && make install when installing MCrypt, is prompted by modifying Ld_library_path, the ld_library_path=/usr/local/lib is specified in the following manner./configuremake && Make Install then add the Make && make INSTALLCP php.ini-production/usr/local/lib/php.ini #配置文件路径在 Apache configuration file httpd.confLoadModule php5_module modules/libphp5.so<filesmatch \.php$> SetHandler application/x-httpd-php</ Filesmatch> Check that there is no libphp5.so file generated in the directory above the line may have been compiled to install PHP in the process has been automatically added by the system, if added, there is no need to add, The role is to increase the support of PHP and as a module to run PHP restart Apache can when the installation of Apache, with a long string of APACHECTL to launch Apache, you can add Apache to the service, and then directly with the service httpd Start to launch, the solution is as follows: cd/usr/local/apache2/bin/#进入到 apachectl script location CP apachectl/etc/rc.d/init.d/httpd #复制脚本用vim打开vim/etc /RC.D/INIT.D/HTTPD add #chkconfig:2345 to #!/bin/sh below 90#description:activates/deactivates Apache Web server save exit when using PHP program mysql_connect (' localhost ') cannot connect when switching to IP connection to use localhost connection, found in php.ini mysql.default_socket= ... Modify the absolute path of the mysql.sock after mysql.default_socket=/absolute path/mysql.sock, you can search the path of the file and then restart the system (for the sake of safety)-------------------------- ----http://blog.csdn.net/liruxing1715/article/details/8269563 installation memecached: Install LIBEVENT.ZZTAR-ZXVF libevent.zz./ Configuremake && make install installation memcached official website download TAR-ZXVF MEMCACHED-VERSION.TAR.GZCD memcached-version./ Configure–with-libevEnt=/usr/local #指定libevent位置makemake Install to view/usr/local/bin, whether the memcached file is generated if there is, the successful installation to just install on the server memcached let PHP extension, so that PHP support operation memcached, equivalent to the client installation LIBMEMCACHEDTAR-ZXVF Libmemcached-version.xx./configure-- With-memcachedmake && make install open PHP memcached extension CD memcached-version phpize #生成 configure./co Nfigure makes && make install prompts you to generate a prompt similar to the following installing shared extensions:/usr/local/lib/php/extensions /no-debug-non-zts-20121212/generates a memcached.so file in it and copies the file to cp/usr/local/lib/php/extensions/  no-debug-non-zts-20121212/memcached.so/usr/local/lib/start Memcache server-side/usr/local/bin/memcached-d-m 10-u root or /usr/local/bin/memcached-d-M 10-u root-l 192.168.141.64-p 12000-c 256-p/tmp/memcached.pid-d option is to start a daemon,-M is assigned to MEMC Ache the amount of memory used, the unit is MB, I here is 10mb,-u is running memcache user, I here is root,-l is listening to the server IP address, if there are multiple addresses, I specify the IP address of the server here 192.168.0.200,-p is set memcache listening port, I set 12000 here, preferably more than 1024 ports, the-C option is the maximum number of concurrent connections, the default is 1024, I set up here 256, according to the load of your server set,- P is set to protect theSave Memcache pid file, I here is saved in/tmp/memcached.pid, then use PHP program to connect, test under------------------------------------ 

  

CentOS Build Install Lamp

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.