linux系统安装php5.4个人推荐!
本帖最后由 天崖树 于 2015-2-15 15:22 编辑1、安装之前需要对内核进行优化:(四核,内存1024 32位系统 )(安装之前的优化不会可以淘宝找人做做,30rmb或者20rmb)
1.1关闭不需要的服务,可降低内存使用率(这个可以百度,我是百度)
1.2内核参数优化
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 1073741824
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 268435
fs.file-max=65535
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 10240 65000
net.core.somaxconn = 10240
net.core.netdev_max_backlog = 163840
net.ipv4.tcp_max_syn_backlog = 163840
fs.file-max=65535
fs.file-max=65535
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_max_orphans = 163840
#以下参数是对iptables防火墙的优化,防火墙不开会提示,可以忽略不理。
net.ipv4.ip_conntrack_max = 25000000
net.ipv4.netfilter.ip_conntrack_max=25000000
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=180
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait=120
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait=60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait=120
net.ipv4.tcp_timestamps=1
本帖最后由 天崖树 于 2015-2-15 15:27 编辑
推荐lnmpa 我安装完成后运行内存是170m
1 运行 yum install screen -y ( 推荐使用xshell)
(附件图片)
然后在xhsell中如下设置
完成后重新连接,这样就可以 离线安装程序了
2运行lnmp一键安装包(http://lnmp.org/install.html)(自带zend goard loader6.0php5.2或者5.3)
wget -c http://soft.vpser.net/lnmp/lnmp1.1-full.tar.gz && tar zxf lnmp1.1-full.tar.gz && cd lnmp1.1-full && ./centos.sh
提示操作就行
3运行./apache.sh 安装lnmpa
4安装php5.4 ./upgrade_lnmpa_php.sh
5安装第三方扩展
推荐:
1.1 ./eaccelerator.sh
1.2 ./memcached.sh
以上就完成了飞飞侠或小淘客的环境配置
虚拟主机管理
1、LNMPA添加虚拟主机:/root/vhost.sh2、删除虚拟主机,ssh执行:rm /usr/local/nginx/conf/vhost/域名.conf 同时需要:rm /usr/local/apache/conf/vhost/域名.conf
我配置的环境演示:http://www.tuanupin.com/i.php 我配置的环境演示:
http://www.tuanupin.com/i.php
页:
[1]