安装SuSE建议添加的软件包

在使用Linux搭建一个Web网站,需要对操作系统进行必要的手工配置,需要自行安装和配置相应的软件,本文是对搭建这样环境的一些提示。

安装SuSE建议添加的软件包 Top

安装SuSE Linux作为服务器环境,在选择安装的软件包的时候,要注意勾选如下软件包: 

ImageMagick相关 

libjpeg/libjpeg-devel 
libtiff/libtiff-devel 
libpng/libpng-devel 
gd/gd-devel 
freetype 
libxml2 

lighttpd相关 
pcre/pcre-devel 
openssl/openssl-devel 
libaio 

系统工具相关 
wget 
tcpdump 
unzip/zip/unrar 
cvs/rcs/vsftpd/xinetd 
db-utils/gdbm 
sysstat/nmap/iptraf 
python/vim/lynx/curl 

ruby相关 
zlib/readline/gettext 

MySQL相关 
termcap/ncurse 

SuSE Linux的配置 Top

1、安装操作系统注意选择需要和不需要的软件包 

2、安装好以后,通过yast2在线升级 

3、定制需要和不需要启动的服务,通过yast2 

4、修改inittab,切换到init 3 

5、修改/etc/fstab,加上noatime,notail参数,提高文件IO性能 

6、修改/etc/security/limits.conf,加大操作系统参数 
C代码   收藏代码
  1. *          soft    nofile          63536  
  2. *          hard    nofile          63536  

7、修改配置文件 

删除/etc/skel/下面的东西 

编辑/etc/vimrc ,加入set tabstop=2 

编辑/etc/profile.local,加入自定义环境变量 

编辑/etc/hosts,增加本地主机解析条目 

8、touch /etc/dnsrewrite 

9、用iptables配置防火墙 

10、调整操作系统内核参数,vi /etc/sysctl.conf 

C代码   收藏代码
  1. net.ipv4.icmp_echo_ignore_broadcasts = 1  
  2. net.ipv4.conf.all.rp_filter = 1  
  3.   
  4. net.core.rmem_default=262144  
  5. net.core.wmem_default=262144  
  6. net.core.rmem_max=262144  
  7. net.core.wmem_max=262144  
  8.   
  9. net.ipv4.tcp_wmem=4096 65536 524288  
  10.   
  11. kernel.shmmax=2147483648  
  12. kernel.sem=250 32000 100 128  
  13. net.ipv4.ip_local_port_range=1024 65000  

常用软件的配置和编译选项 Top

编译MySQL 
./configure --prefix=/opt/mysql5 --with-charset=utf8 --with-extra-charsets=latin1,gbk --with-mysqld-user=mysql 
编译MySQL5.1 
./configure --prefix=/opt/mysql5 --with-charset=utf8 --with-extra-charsets=latin1,gbk --with-mysqld-user=mysql --with-plugins=innodb_plugin,myisam,heap 

编译ruby 
./configure --prefix=/usr/local/ruby 

编译lighttpd 
./configure --prefix=/usr/local/lighttpd --with-openssl 

编译ImageMagick 
./configure --prefix=/usr/local/ImageMagick 

编译FastCGI 
./configure --prefix=/usr/local/fcgi 
make && make install 

编译ruby-fcgi 
ruby install.rb config -- --with-fcgi-include=/usr/local/fcgi/include --with-fcgi-lib=/usr/local/fcgi/lib 
ruby install.rb setup 
ruby install.rb install 

编译ruby mysql 
ruby extconf.rb  --with-mysql-dir=/opt/mysql5 
make && make install 

编译php 
./configure --prefix=/usr/local/php-fcgi --with-mysql=/opt/mysql5 --with-config-file-path=/usr/local/php-fcgi \ 
--enable-fastcgi --enable-force-cgi-redirect 

编译apache2.2 
./configure --prefix=/usr/local/apache22 --enable-deflate --enable-cache --enable-proxy --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-cgi --enable-cgid --enable-so --enable-rewrite 

安装qmail邮件服务器 Top

参考qmailrocks 

注意在64bit操作系统上,需要 touch /etc/dnsrewrite ,否则qmail无法正常启动。

Apache的proxy提示 Top

Proxy_AJP方式配置Tomcat群集,并且支持HTTPSession粘着 

C代码   收藏代码
  1. <Proxy balancer://myCluster>  
  2.     BalancerMember ajp://127.0.0.1:8091 route=clone1  
  3.     BalancerMember ajp://127.0.0.1:8092 route=clone2  
  4. </Proxy>  


C代码   收藏代码
  1. ProxyPass / balancer://myCluster/ stickysession=JSESSIONID  
  2. ProxyPassReverse / balancer://myCluster/  


在ProxyPass指令中 balancer://myCluster/必须以slash结尾,否则apache会返回403错误 

Proxy_HTTP方式(不支持虚拟域的Proxy) 

C代码   收藏代码
  1. ProxyPass / balancer://myCluster/ stickysession=JSESSIONID  
  2. ProxyPassReverse / balancer://myCluster/  


在ProxyPass指令中 balancer://myCluster后面写不写slash都可以
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值