centos lnmp 安装笔记

Configure: error: Please reinstall the BZip2 distribution 

yum install bzip2 bzip2-devel

configure: error: libpng.(a|so) not found.

yum install libpng-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
When compiling PHP on a CentOS 6 machine I always get this error
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
To fix this I just add these Repos. Just choose if you are running 32bit or 64bit

*For CentOS6 32bit
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

*For CentOS6 64bit
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

And then also add this
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

And then install the libmcrypt
# yum --enablerepo=remi,remi-test install libmcrypt libmcrypt-devel

I would prefer this way since I dont want to compile the library manually and since I would also like to install the latest MySQL version which you can also install using the command below

# yum --enablerepo=remi,remi-test install mysql mysql-server


[root@host]# rpm -ivh nginx.rpm [root@host]# yum install nginx [root@host]# chkconfig nginx on [root@host]# service nginx start [root@host]# service nginx stop [root@host]# service nginx restart [root@host]# service nginx status

nginx 开启GZIP压缩

root/nginx.conf

http{...}结点

server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;

 
   

sendfile on;
tcp_nopush on;

 
   

keepalive_timeout 60;

 

tcp_nodelay on;
server_tokens off;

fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;



gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;




[root@host]# service nginx reload
[root@host]# yum install gcc
[root@host]# yum install gcc-c++

[root@host]# yum install gcc
[root@host]# yum install gcc-c++

 
   

tar -zxvf name.tar.gz
tar -jxvf name.tar.bz2

[root@host]# yum install libxml2

[root@host]# yum install libxml2-devel -y

 

 
   

[root@host]# yum install mysql mysql-server

[root@host]# yum install mysql-devel
[root@host]# service mysqld start

 

//修改密码

UPDATE user SET password=PASSWORD('123456') WHERE user='root';

FLUSH PRIVILEGES;

 

 

  1. yum install wget gcc gcc-c++ make re2c curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel zlib zlib-devel openssl openssl-devel freetype freetype-devel gd gd-devel perl perl-devel ncurses ncurses-devel bison bison-devel libtool gettext gettext-devel cmake bzip2 bzip2-devel pcre pcre-devel
 

PHP Setup

./configure --prefix=/usr/local/php  --enable-fpm --enable-sockets --with-mcrypt --enable-mbstring --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex  --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-gd --with-pdo-mysql --with-freetype-dir --enable-pdo --with-openssl

 
   
 

[root@host]# make

[root@host]# make install

make ZEND_EXTRA_LIBS='-liconv'

 

configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/

[root@host]# yum -y install curl-devel

 

Configure: error: Please reinstall the BZip2 distribution

 

[root@host]# yum install bzip2 bzip2-devel

 

 

 

 

 

 

 

 

 

那查看Configuration File (php.ini) Prath => /usr/local/lib

把php-5.4.16.tar目录中php.ini-production或者php.ini-development复制到/usr/local/lib/php.ini 

将php-fpm设置为服务启动

[root@host]# /usr/local/php/sbin/php-fpm

 

[13-Apr-2014 03:20:56] ERROR: failed to open configuration file '/opt/php/etc/php-fpm.conf': No such file or directory (2)
[13-Apr-2014 03:20:56] ERROR: failed to load configuration file '/opt/php/etc/php-fpm.conf'
[13-Apr-2014 03:20:56] ERROR: FPM initialization failed

解决办法

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

 

 

[root@host]# cd php-5.5.13/sapi/fpm/
[root@host]# cp init.d.php-fpm /etc/init.d/php-fpm

[root@host]# chmod 755 /etc/init.d/php-fpm

[root@host]# /etc/init.d/php-fpm start

[root@host]# /sbin/chkconfig --add /etc/init.d/php-fpm --(添加到开机服务列表)

[root@host]# /sbin/chkconfig php-fpm on

php-fpm的启动、停止和重启:

[root@host]# /etc/init.d/php-fpm start

[root@host]# /etc/init.d/php-fpm stop


打开80端口必须输入以下

[root@host]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

[root@host]# service iptables save

[root@host]# service iptables restart

 

 

 


安装好系统后,发现没有我习惯使用的五笔输入法。你可以在这里设置:

system->preferences->input method。

如果在安装系统时选择语言包括UK和中文了,这块应该就有五笔等汉语输入法了。


但如果没有的话,就这样操作:

1.yum install "@Chinese Support"

2.到设置输入的地方添加即可

打包/usr目录,并用gzip压缩为abcd文件
tar zcvf abcd.tar.gz /usr

打包a.txt和b.txt到abcd文件,并用bzip压缩
tar jcvf abcd.tar.bz2 a.txt b.txt

解压tgz文件:
tar zxvf abcd.tar.gz

解压tbz2文件
tar jxvf abcd.tar.bz2

 

insert into user(Host,User,Password)values("localhost","test",password("123456"));

flush privileges;


grant all privileges on hsker.* to 'test'@'%' identified by '123456';


flush privileges;

update user set host = '%' where user = 'test';

 

MySQL Daemon failed to start  

chmod 777 -R /var/lib/mysql;

 

yum install ibus-table-wubi.noarch

你可能感兴趣的:(centos)