




已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linu 下一些常用 工具的安装说明1. Jdk for linux安装# chmod a+x jdk-6u12-linux-i586-rpm.bin /赋予执行权限# sh jdk-6u12-linux-i586-rpm.bin /默认安装在/usr/java/jdk2# vi /etc/profile /设置环境变量添加以下内容:# source /etc/profile /立即生效# ls s f /usr/java/jdk1.6.0_12/jre/bin/java /创建软件连接# ls s f /usr/java/jdk1.6.0_12/bin/javac# java version /查看版本如下:2. Apache-Ant安装下载地址:安装Ant之前必须先安装JDK# tar zxvf apache-ant-1.8.3-bin.tar.gz# mv apache-ant-1.8.3 /usr/local/# vi /etc/profile# source /etc/profile /使用刚才设置生效#ant -version /测试是否安装成功3. MySql for linux源码安装 (不同版本安装要求会不同)-创建mysql组-# groupadd mysql # useradd -g mysql mysql # cd /usr/local# tar -zxvf mysql-5.1.55.tar.gz# cd mysql-5.1.55 # ./configure -prefix=/usr/local/mysql # make # make install # cp support-files/f /etc/f# cd /usr/local/mysql# chown -R root . #改当前目录的拥有者为root。注意,最后有个 “.”,表示当前目录# chown -R mysql /usr/local/mysql/var #-R表示递归之下的所有目录(版本不同有些没有var而是data)# chgrp -R mysql /usr/local/mysql #改变目录所属为mysql# bin/mysqld_safe -user=mysql & #启动mysql初始化(&表示在后台执行) # bin/mysqladmin -uroot password 123456 #更改root登录密码 -把mysql加入到系统服务中-# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql# chkconfig -add mysql #加入到系统服务中,就可以通过service mysql|start|stop|status|restart进行管理 -把mysql加入环境变量 (.bashrc与profile有区别)方法一(局部): # cd /root# cp .bashrc .bashrc.bak #先备份一份# vi .bashrc #按i进入可编辑状态在最后加入:export PATH=/usr/local/mysql/bin:$PATH:.# source /.bashrc #回到终端再输入此命令,以使刚修改的起作用,代表用户主目录# env #查看一下是否生效方法二(全局) :# vi /etc/profile /加入mysql 环境变量# source /etc/profile-Linux开放3306端口-# service iptables stop# vi /etc/sysconfig/iptables 按i进入可编辑状态,在最后加入-A RH-Firewall-1-INPUT -m state -state NEW -m tcp -p tcp -dport 3306 -j ACCEPT# service iptables start -给root用户开启mysql远程访问权限-# shutdown -hr now #重启电脑# ps -e | grep mysql #查看mysql是否已随开机启动,或者输入:service mysqld status# mysql -uroot -p #进入mysql(此处必须是配置了mysql的环境变量才能直接使用)mysql rant all on *.* to root% identified by 123456;#grant 权限 on 数据库名.表名 to 用户登录主机 identified by 用户密码;mysql lush privileges; #可以让操作即时启效或(update user set host = % where user = root; /这个命令执行错误时可略过flush privileges; select host,user from user; )4. Python for linux查看当前python版本Python V升级 yum install gcc g+ openssl-devel zlib-devel赋执行权限# chmod 775 Python-2.7.3.tar# tar -zxvf Python-2.7.3.tar 或者tar -jxvf Python-2.6.5.tar.bz2# cd Python-2.7.3# ./configure# make & make install 默认安装在/usr/local/lib/Python2.7# /usr/local/bin/python2.7 V 查看版本# mv /usr/bin/python /usr/bin/python.bak 备份之前的软连接# ln -s /usr/local/bin/python2.7 /usr/bin/python 建立新的软连接# python V 指向否成功修改yum配置# vi /usr/bin/yum yum是基于python2.4才能正常工作将文本编辑显示的#!/usr/bin/python修改为#!/usr/bin/python2.4,保存修改即可.5. Sysbench for linux1.准备环境: 更新依赖软件: yum install gcc libtool 在 /projects/sysbench 下载源码包2.安装#tar-zxvfsysbench-0.4.12.tar.gz#cdsysbench-0.4.12#./autogen.sh#./configureprefix=/usr/local/sysbench -with-mysql-includes=/usr/local/mysql/include-with-mysql-libs=/usr/local/mysql/lib#make&makeinstall./autogen.sh 清理环境,该操作只有sysbench-0.4.12有在安装过程中可能会遇到三个问题:一是在编译时会报libtools错误如图解决方法:运行yum install libtool二是在运行sysbench时报如下错误(sysbench无法找到mysql库文件)如图:解决方法:将libmysqlclient.so.xx文件所在的目录append至/etc/ld.so.conf文件或添加环境变量exportLD_LIBRARY_PATH=/usr/local/mysql/lib三是报如下错误:# sysbench -test=oltp -db-driver=mysql -mysql-host=localhost -mysql-socket=/tmp/mysql.sock -mysql-user=root -mysql-table-engine=innodb -oltp-table-size=100000000 prepare sysbench 0.4.12: multi-threaded system evaluation benchmarkFATAL: unable to connect to MySQL server, aborting.FATAL: error 1049: Unknown database sbtestFATAL: failed to connect to database server!解决方法是加-mysql-db option(数据库名称),告诉sysbench往哪个数据库中装填数据6. Php5.3.8 for linux更新安装php5.3.8所依赖库yum -y install gcc gcc-c+ php-gd autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel pcre-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers# ./configure -prefix=/usr/local/php -with-config-file-path=/usr/local/php/etc -enable-trans-sid -with-xml -with-mysql=mysqlnd -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib -enable-xml -disable-rpath -enable-discard-path -enable-safe-mode -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-curl -with-curlwrappers -enable-mbregex -enable-fastcgi -enable-fpm -enable-force-cgi-redirect -enable-mbstring -with-gd -enable-gd-native-ttf -with-openssl -with-mhash -enable-pcntl -enable-sockets -with-ldap -with-ldap-sasl-with-apxs2=/usr/local/apache/bin/apxs使用php支持apache最后从解压目录中copy php.ini. development 改名为 php.ini# make & meke install # /usr/local/php/sbin/php-fpm /启动php-fpm安装过程中出现的问题:configure: error: LDAP SASL check failed. Please check config.log for more information.原因是64位系统需要使用64位的库,重新指定一下库的引用解决方法: 暂时是去掉 编译 -with-ldap -with-ldap-sasl7. nginx for linux# yum y install gcc gcc-c+ autoconf automake zlib zlib-devel# yum y install openssl openssl-devel pcre pcre-devel# tar zxvf nginx-1.2.5.tar.gz# cd nginx-1.2.5# ./configure -prefix=/usr/local/nginx -with-pcre -with-http_stub_status_module -with-http_gzip_static_module -with-http_ssl_module -http-proxy-temp-path=/tmp/nginx/http-proxy-cache# make & make install# mkdir -p /tmp/nginx/http-proxy-cacheNginx启动 /usr/local/nginx/sbin/nginx 或添加 c 指定nginx.conf的路径。Nginx停止 /usr/local/nginx/sbin/nginx -s stopnginx重启 /usr/local/nginx/sbin/nginx -s reload由于nginx的配置文件比较大,所以这里通过include的方式将模块化配置文件引入到主配置文件中,主配置文件在安装的nginx目录的conf目录中,名称为nginx.conf。其他模块化配置文件在conf/extra/目录下,分别是basic.conf、gzip.conf、location.conf。下面是各文件内容的示例 nginx.confuser www www; #使用的用户和组worker_processes 2;#指定工作衍生进程数(一般为cpu总核数的两倍)error_log logs/error.log debug;#错误日志存放目录,按级别分为(debug|info|notice|warn|error|crit)pid logs/nginx.pid#指定pid存放的路径eventsuse epoll;#linux下推荐使用epoll,nginx可以高并发连接得益于使用了epoll(linux)和kqueue(freebsd)网络I/O模型,而apache使用的是传统的select模型,其比较稳定的prefork模式为多进程,需要经常派生子进程,所消耗的CPU等服务器资源比nginx高的多。worker_connections 1024;#允许连接数http#通过include方式引入各模块 include /usr/local/nginx/conf/extra/basic.conf; include /usr/local/nginx/conf/extra/gzip.conf; include /usr/local/nginx/conf/extra/location.conf; basic.confinclude mime.types;default_type application/octet-stream;#charset gb2312;#统一设置网站字符集,慎用,尽量在HTML中通过META标签设置。server_names_hash_bucket_size 128;#指定服务器名称哈希表的框大小,默认值取决于cpu缓存client_header_buffer_size 32k;#设置客户端请求header头缓冲区大小,1K默认,与COOKIE有关。large_client_header_buffers 4 32k;#客户端请求不能大于这个值,否则会报414或400错误。client_max_body_size 8m;#客户端请求内容的最大值,即客户端请求header头信息中设content-length的最大值,默认为1M,如果超过该指令设置的最大值,将返回413。sendfile on;#是否启动sendfile()函数。tcp_nopush on;#是否允许在linux上使用TCP_CORK套接字选项,依赖于sendfile on.keepalive_timeout 60;#默认值,使客户端与服务器端连接持续有效,IE中浏览器自身限制60S。tcp_nodelay on;#是否允许使用套接字选项TCP_NODELAY,依赖于keep-alive连接。log_format main $remote_addr - $remote_user $time_local $request$status $body_bytes_sent $http_referer$http_user_agent $http_x_forwarded_for;access_log /usr/local/nginx/logs/access.log main; #设置访问日志输出格式和路径 gzip.confgzip on;# 开启GZIP模块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; location.confserver listen 8080; #监听服务器的8080端口 server_name localhost; #访问地址 IP方式和域名方式 index index.html index.htm; log_not_found off; error_page 500 502 503 504 /50x.html; location = /50x.html root /usr/local/nginx/html; #location #此标识必须有;实例部署时需要在此标识后追加内容 启动nginx;打开 :8080, 能看到nginx的欢迎信息,安装成功!killall php-fpm/usr/local/php/sbin/php-fpm8. Flash player下载install_flash_player_11_linux.x86_64.tar.gz 安装的版本根据系统环境而定,以本人系统64位为例:#tar zxvf install_flash_player_11_linux.x86_64.tar.gz只有一个” libflashplayer.so”的文件,将此文件移动到火狐的插件目录查找火狐插件目录#find /usr name mozilla /如有多个目录根据系统情况而定#mv libflashplayer.so /usr/lib64/mozilla/plugins重启火狐即可/?p=349. Apache for linux下载: /download.cgi#tar zxvf httpd-2.4.6.tar.gzrootlocalhostapache#tarjxvfhttpd-2.4.6.tar.bz2/解压apache的压缩包rootlocalhostapache#cdhttpd-2.4.6/定位到httpd-2.4.6文件夹下rootlocalhosthttpd-2.4.6#ls/查看显示httpd-2.4.6文件夹下内容rootlocalhosthttpd-2.4.6#./configure-help|more/查看安装apache配置参数rootlocalhosthttpd-2.4.6#./configure-prefix=/usr/local/apache-enable-so/配置apache路径,后面跟-enable-so参数表示让apache核心装载DSOrootlocalhosthttpd-2.4.6#make/编译apache出错了!提示:configure:error:APRnotfound.Pleasereadthedocumentation在apache官网上可以下载到apr-1.4.6.tar.gz解决aprnotfound问题APR和APR-UTIL的下载地址:/download.cgirootlocalhostapache#tar-zxfapr-1.4.8.tar.gzrootlocalhostapache#cdapr-1.4.8rootlocalhostapr-1.4.8#./configure-prefix=/usr/local/aprrootlocalhostapr-1.4.8#makerootlocalhostapr-1.4.8#makeinstall安装完成后,再来编译apacherootlocalhosthttpd-2.4.6#make 又出错了!提示:configure:error:APR-utilnotfound.Pleasereadthedocumentation好吧!还是上面的apache官网地址再下载apr-util-1.5.2.tar.gz解决APR-utilnotfound问题rootlocalhostapache#tar-zxfapr-util-1.5.2.tar.gzrootlocalhostapache#cdapr-util-1.5.2rootlocalhostapr-util-1.5.2#./configure-prefix=/usr/local/apr-util-with-apr=/usr/local/apr/bin/apr-1-configrootlocalhostapr-util-1.5.2#makerootlocalhostapr-util-1.5.2#makeinstall再来编译apache时加上:-with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util 再次出错!提示:configure:error:pcre-configforlibpcrenotfound.PCREisrequiredandavailablefrom/, 我X!linux安装软件之间关联性有时能让人崩溃。rootlocalhostapache#./configurehelp|greppcre-with-pcre=PATHUseexternalPCRElibrary下载地址:/pcre/下载pcre-8.30.zip,列表文件较多,一般浏览器会有搜索功能,你可ctrl+f搜索定位后下载。rootlocalhostapache#unzip-opcre-8.30.ziprootlocalhostapache#cdpcre-8.30rootlocalhostpcre-8.30#./configure-prefix=/usr/local/pcrerootlocalhostpcre-8.30#makerootlocalhostpcre-8.30#makeinstall在次编译Apache时加rootyahoohttpd-2.3.12-beta#./configure-prefix=/usr/local/apache -with-apr=/usr/local/apr -with-apr-util=/usr/local/apr-util/-with-pcre=/usr/local/pcre/注意,这里后面跟的参数,一定要与前面安装apr和apr-util的路径一致。rootlocalhosthttpd-2.4.1#makerootlocalhosthttpd-2.4.1#makeinstall报错:make2: * htpasswd Error 1make2: Leaving directory /usr/local/directadmin/custombuild/httpd-2.0.63/supportmake1: * all-recursive Error 1make1: Leaving directory /usr/local/directadmin/custombuild/httpd-2.0.63/supportmake: * all-recursive Error 1解决办法:#mv /usr/lib/libm.a /usr/lib/libm.a.bak#mv /usr/lib/libm.so /usr/lib/libm.so.bak#mv /usr/lib/libexpat.so /usr/lib/libexpat.so.bak#ln -s /usr/lib64/libm.a /usr/lib/libm.a#ln -s /usr/lib64/libm.so /usr/lib/libm.so#ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so分析:由于我的CENTOS 是 64bit的,在编译配置中并没有指定 -with-included-apr的具体引用路径,导致找不到相应的库文件,而 -with-included-apr 默认是查找/usr/lib下的库文件,而,正确的引用应该是/usr/lib64下的。这类情况在64bit下非常常见,其它错:make install时出错:/bin/sh /usr/local/httpd-2.2.3/srclib/apr/libtool -mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apache2/liblibtool: install: error: cannot install libaprutil-1.la to a directory not ending in /usr/local/apache2/lib make2: * install Error 1解决方法:1、执行make clean后,重新编译安装启动apacherootlocalhostbin#pwd/usr/local/apache/binrootlocalhostbin#apachectlstop停止rootlocalhostbin#apachectlstart启动查看80端口是否被占用rootlocalhostconf#netstat-an|grep:80查看apache启动服务是否启动rootlocalhostbin#ps-aux|grephttpdWarning:badsyntax,perhapsabogus-?See/usr/share/doc/procps-3.2.7/FAQroot28660.01.2251649556?Ss22:450:00/usr/sbin/httpd-kstartapache28670.00.7253005556?S22:450:00/usr/sbin/httpd-kstartapache28680.00.6253005444?S22:450:00/usr/sbin/httpd-kstartapache28690.00.6253005444?S22:450:00/usr/sbin/httpd-kstartapache28700.00.7253005556?S22:450:00/usr/sbin/httpd-kstartapache28710.00.6251644796?S22:450:00/usr/sbin/httpd-kstartapache28720.00.6251644796?S22:450:00/usr/sbin/httpd-kstartapache28730.00.6251644796?S22:450:00/usr/sbin/httpd-kstartapache28740.00.6251644796?S22:450:00/usr/sbin/httpd-kstartroot31410.00.04244676pts/1R+22:480:00grephttpd下面访问一下apache默认页是否能打开。http:/ip:80/index.html又提示了错误:难道是端口被占用了?修改apache的配置文件/usr/local/apache/conf/httpd.conf配置文件rootlocalhostconfvihttpd.conf找到下面一行:Listen80把80改成其它端口,如8080、8800只要没被占用就行。找到下面一行:ServerN:80改成本机ip加端口号,如:05:80端口改来改去,一直都报那个错误。由于之前没有在linux下安装apache的经验,与是想找一下apache默认运行的哪个页面。于是,找到了,./apache/htdocs/index.html文件(受tomcat的误导)!其实不然,真正运行的是/var/www/html目录下的文件Youdonthavepermissiontoaccess/index.htmlonthisserver真正的错误在这句提示上。因为我方位的文件权限不足够。那给文件加个权限吧!在/var/www/html创建个文件index.htmlrootlocalhosthtml#chmod766index.htmlOk!再来方位apache,页面正常打开了!过程很纠结,结局很美好!-小结-需要安装的文件:apr-1.4.6apr-util-1.4.1.tar.bz2pcre-8.30.zip/usr/local/apacheapache的安装目录/usr/local/apache/conf/httpd.conf配置文件/usr/local/apache/bin/apachectlstop/start停止/启动程序/var/www/html/在这个文件夹下创建可以访问的页面系统:CentOS6.2服务器:Httpd2.2.21卸载系统自带的httpd:rpm -qa|grep httpdrpm -ehttpd-2.2.15-15.el6.centos -nodepsrpm -ehttpd-tools安装过程:下载httpd-2.2.21.tar.gz tar zxvfhttpd-2.2.21.tar.gz cdhttpd-2.2.21./configure -prefix=/usr/apache -sysconfdir=/etc/httpd -enable-so -enable-modules-shared=all -with-mpm=workermakemake install说明:-with-mpm=worker 指定apache的进程模型为worker,默认情况下,进程模型为prefork,改为worker后会改善apache的性能;安装目录可以自己指定;安装过程如果出错的话,自己解决吧 这是基本功启动停止:/usr/apache/bin/apachectl start/usr/apache/bin/apachectl stop检查配置错误:/usr/apache/apachectl -t/usr/apache/apachectl configtest目录说明: bin目录是apache执行文件的目录 cgi-bin是cgi网页程序存放的
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025广东河源市源城区选调公办中小学教师15人笔试参考题库附答案解析
- 2025广东佛山市平洲二中教师招聘笔试参考题库附答案解析
- 2025云南省大理州宾川县妇幼保健院招聘编外人员(3人)笔试参考题库附答案解析
- 2025年铝板购销合同模板
- 中班音乐教案大全
- 2025安徽宿州市本级就业困难人员公益性岗位招聘5人笔试参考题库附答案解析
- 2024年9月电信职员工作总结范例(3篇)
- 2025沈阳店铺转让合同范本
- 2025年农夫山泉产品代理协议合同
- 旅游业景区数字化营销策略
- 三农村集体经济组织内部审计操作手册
- 2025年1月浙江省高考地理试卷(含答案)
- 锂电池项目经济效益及投资价值分析
- 2025年中国维生素C咀嚼片市场供需格局及未来发展趋势报告
- 广东省汕头市金平区2021-2022学年八年级下学期期末英语卷
- 物流行业固废处理方案
- 测绘项目投标技术文件范例
- 申请报建户外货梯的申请书
- 项目5 5.1 植物的光合作用(1)(课件)-《植物生产与环境》(高教版第4版)
- 康复科讲课课件
- 《蒙牛乳业集团财务共享服务中心优化研究》
评论
0/150
提交评论