centos 6 perl?centos ssh
如何在Ubuntu / CentOS 6.x上安装Bugzilla 4.4
1.安装依赖程序
安装Bugzilla相当简单。这篇文章特别针对Ubuntu 14.04和CentOS 6.5两个版本(不过也适用于更老的版本)。
为了获取并能在Ubuntu或CentOS系统中运行Bugzilla,我们要安装Apache网络服务器(启用SSL),MySQL数据库服务器和一些需要来安装并配置Bugzilla的工具。
要在你的服务器上安装使用Bugzilla,你需要安装好以下程序:
Perl(5.8.1或以上)
MySQL
Apache2
Bugzilla
Perl模块
使用apache的Bugzilla
正如我们所提到的本文会阐述Ubuntu 14.04和CentOS 6.5/7两种发行版的安装过程,为此我们会分成两部分来表示。
以下就是在你的Ubuntu 14.04 LTS和CentOS 7机器安装Bugzilla的步骤:
准备所需的依赖包:
你需要运行以下命令来安装些必要的包:
Ubuntu版本:
$ sudo apt-get install apache2 mysql-server libapache2-mod-perl2 libapache2-mod-perl2-dev libapache2-mod-perl2-doc perl postfix make gcc g++
CentOS版本:
$ sudo yum install httpd mod_ssl mysql-server mysql php-mysql gcc perl* mod_perl-devel
注意:请在shell或者终端下运行所有的命令并且确保你用root用户(sudo)操作机器。
2.启动Apache服务
你已经按照以上步骤安装好了apache服务,那么我们现在需要配置apache服务并运行它。我们需要用sodo或root来敲命令去完成它,我们先切换到root连接。
$ sudo-s
我们需要在防火墙中打开80端口并保存改动。
# iptables-I INPUT-p tcp--dport 80-j ACCEPT
# service iptables save
现在,我们需要启动服务:
CentOS版本:
# service httpd start
我们来确保Apache会在每次你重启机器的时候一并启动起来:
#/sbin/chkconfig httpd on
Ubuntu版本:
# service apache2 start
现在,由于我们已经启动了我们apache的http服务,我们就能在默认的127.0.0.1地址下打开apache服务了。
3.配置MySQL服务器
现在我们需要启动我们的MySQL服务:
CentOS版本:
# chkconfig mysqld on
# service start mysqld
Ubuntu版本:
# service mysql-server start
用root用户登录连接MySQL并给Bugzilla创建一个数据库,把你的mysql密码更改成你想要的,稍后配置Bugzilla的时候会用到它。
CentOS 6.5和Ubuntu 14.04 Trusty两个版本:
# mysql-u root-p
# password:(You'll need to enter your password)
# mysql> create database bugs;
# mysql> grant all on bugs.* to root@localhost identified by"mypassword";
#mysql> quit
注意:请记住数据库名和mysql的密码,我们稍后会用到它们。
4.安装并配置Bugzilla
现在,我们所有需要的包已经设置完毕并运行起来了,我们就要配置我们的Bugzilla。
那么,首先我们要下载最新版的Bugzilla包,这里我下载的是4.5.2版本。
使用wget工具在shell或终端上下载:
wget/pub/mozilla.org/webtools/bugzilla-4.5.2.tar.gz
你也可以从官方网站进行下载。
从下载下来的bugzilla压缩包中提取文件并重命名:
# tar zxvf bugzilla-4.5.2.tar.gz-C/var/www/html/
# mv-v bugzilla-4.5.2 bugzilla
注意:这里,/var/w/html/bugzilla/就是Bugzilla主目录.
现在,我们来配置buzilla:
# cd/var//html/bugzilla/
./checksetup.pl--check-modules
检查完成之后,我们会发现缺少了一些组件,我们需要安装它们,用以下命令即可实现:
# cd/var/www/html/bugzilla
# perl install-module.pl--all
这一步会花掉一点时间去下载安装所有依赖程序,然后再次运行checksetup.pl--check-modules命令来验证有没有漏装什么。
现在我们需要运行以下这条命令,它会在/var/www/html/bugzilla路径下自动生成一个名为localconfig的文件。
#./checksetup.pl
确认一下你刚才在localconfig文件中所输入的数据库名、用户和密码是否正确。
# nano./localconfig
# checksetup.pl
如果一切正常,checksetup.pl现在应该就成功地配置Bugzilla了。
现在我们需要添加Bugzilla至我们的Apache配置文件中。那么,我们需要用文本编辑器打开/etc/httpd/conf/httpd.conf文件(CentOS版本)或者/etc/apache2/apache2.conf文件(Ubuntu版本):
CentOS版本:
# nano/etc/httpd/conf/httpd.conf
Ubuntu版本:
# nano etc/apache2/apache2.conf
现在,我们需要配置Apache服务器,我们要把以下配置添加到配置文件里:
<VirtualHost*:80>
DocumentRoot/var/www/html/bugzilla/
</VirtualHost>
<Directory/var/www/html/bugzilla>
AddHandler cgi-script.cgi
Options+Indexes+ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
</Directory>
接着,我们需要编辑.htaccess文件并用“#”注释掉顶部“Options-Indexes”这一行。
让我们重启我们的apache服务并测试下我们的安装情况。
CentOS版本:
# service httpd restart
Ubuntu版本:
# service apache2 restart
这样,我们的Bugzilla就准备好在我们的Ubuntu 14.04 LTS和CentOS 6.5上获取bug报告了,你就可以通过本地回环地址或你网页浏览器上的IP地址来浏览bugzilla了。
centos怎么运行perl脚本
同样的网站程序在Linux下运行要比在windows下快出不少,所以决定使用Linux的发行版CentOS,本文主要讲解在CentOS下使用yum命令安装LAMP详细过程。我们使用的软件是CentOS的最新版本CentOS6.3,其他版本的也基本类似。第一步:更新系统内核(如果不想更新可以跳过本步)。首先更新系统内核到最新,因为最新版的CentOS6.3的php版本为5.3,早起版本的CentOS的php版本也比较低。执行命令:yum-yupdate注意:如果执行失败报错,可以执行修复命令:rpm–import/etc/pki/rpm-gpg/RPM-GPG-KEY*第二步:安装Apahce、Mysql、PHP及其基础扩展。执行命令:yum-yinstallhttpdphpphp-mysqlmysqlmysql-server第三步:安装PHP的其他常用扩展执行命名:yum-yinstallphp-gdphp-xmlphp-mbstringphp-ldapphp-pearphp-xmlrpc第四步:安装Apache的扩展执行命令:yum-yinstallhttpd-manualmod_sslmod_perlmod_auth_mysql执行完这四步软件就安装完成了,接下来要做一些常规的设置。第五步:设置apache/mysql-server环境开机自动启动执行命令:#设置apache为开机自启动/sbin/chkconfighttpdon#添加mysql服务/sbin/chkconfig--addmysqld#设置mysql为开机自启动/sbin/chkconfigmysqldon第六步:启动apache与msyql分别执行命令:servicehttpdstartservicemysqldstart第七步:设置mysql数据库root帐号密码mysqladmin-urootpassword'mysql的管理员密码'第八步:安装phpmyadmin从phpmyadmin官方网站:/下。解压phpmyadmin压缩包后,找到config.sample.inc.php重命名为config.inc.php,修改配置,就安装完成了。
阿里云上的centos 7.2怎么yum安装php 5.6
因之前通过网易的 centos镜像,将阿里云的 centos升级到最新版了,乘自己的项目尚未开始正式开发,遂将所有的相应环境都升级到最高。
查看 centos版本:
[root@iZ23d~]# cat/etc/centos-release
CentOS Linux release 7.2.1511(Core)
1、删除之前的 php版本:
[root@iZ23d~]# yum remove php* php-common
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
No Match for argument: php-5.4.16
No Match for argument: php-5.4.16.tar.gz
No Match for argument: php-7.0.1RC1
No Match for argument: php-7.0.1RC1.tar.gz
No Match for argument: phpMyAdmin-4.4.0.tar.gz
No Match for argument: php-common
No Packages marked for removal
2、rpm安装 Php7相应的 yum源:
[root@iZ23d~]# rpm-Uvh
Retrieving
warning:/var/tmp/rpm-tmp.LhJKKR: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing...################################# [100%]
package webtatic-release-7-3.noarch is already installed
3、直接yum安装php7:
[root@iZ23d~]# yum install php70w
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
。。。【省略】
Warning: RPMDB altered outside of yum.
Installing: php70w-common-7.0.0-1.w7.x86_64 1/3
Installing: php70w-cli-7.0.0-1.w7.x86_64 2/3
Installing: php70w-7.0.0-1.w7.x86_64 3/3
Verifying: php70w-7.0.0-1.w7.x86_64 1/3
Verifying: php70w-common-7.0.0-1.w7.x86_64 2/3
Verifying: php70w-cli-7.0.0-1.w7.x86_64 3/3
Installed:
php70w.x86_64 0:7.0.0-1.w7
Dependency Installed:
php70w-cli.x86_64 0:7.0.0-1.w7 php70w-common.x86_64 0:7.0.0-1.w7
Complete!
4、检查 php版本:
[root@iZ23d~]# php-v
PHP 7.0.0(cli)(built: Dec 2 2015 20:42:32)( NTS)
Copyright(c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright(c) 1998-2015 Zend Technologies
[root@iZ23d2e6hoqZ~]#
以上显示安装成功!
5、重启 Apache,查看 phpinfo:
[root@iZ23d~]# systemctl restart httpd.service
检查phpinfo:
PHP Version 7.0.0
SystemLinux iZ23d 3.10.0-229.11.1.el7.x86_64#1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64
Build DateDec 2 2015 20:43:38
Server APIApache 2.0 Handler
Virtual Directory Supportdisabled
Configuration File(php.ini) Path/etc
Loaded Configuration File/etc/php.ini
Scan this dir for additional.ini files/etc/php.d
Additional.ini files parsed/etc/php.d/bz2.ini,/etc/php.d/calendar.ini,/etc/php.d/ctype.ini,/etc/php.d/curl.ini,/etc/php.d/exif.ini,/etc/php.d/fileinfo.ini,/etc/php.d/ftp.ini,/etc/php.d/gettext.ini,/etc/php.d/gmp.ini,/etc/php.d/iconv.ini,/etc/php.d/json.ini,/etc/php.d/phar.ini,/etc/php.d/shmop.ini,/etc/php.d/simplexml.ini,/etc/php.d/sockets.ini,/etc/php.d/tokenizer.ini,/etc/php.d/xml.ini,/etc/php.d/zip.ini
PHP API20151012
PHP Extension20151012
Zend Extension320151012
Zend Extension BuildAPI320151012,NTS
PHP Extension BuildAPI20151012,NTS
Debug Buildno
Thread Safetydisabled
Zend Signal Handlingdisabled
Zend Memory Managerenabled
Zend Multibyte Supportdisabled
IPv6 Supportenabled
DTrace Supportenabled
Registered PHP Streamshttps, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip
Registered Stream Socket Transportstcp, udp, unix, udg, ssl, sslv3, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filterszlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*
This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.0.0, Copyright(c) 1998-2015 Zend Technologies
Configuration
apache2handler
Apache VersionApache/2.4.6(CentOS)
Apache API Version20120211
Server Administratorxxxxxx@xxxxxx.com
Hostname:Portxxxx.xxxxx.xxx:0
User/Groupapache(48)/48
Max RequestsPer Child: 0- Keep Alive: on- Max Per Connection: 100
TimeoutsConnection: 60- Keep-Alive: 15
Virtual ServerYes
Server Root/etc/httpd
Loaded Modulescore mod_so http_core mod_access_compat mod_actions mod_alias mod_allowmethods mod_auth_basic mod_auth_digest mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex mod_cache mod_cache_disk mod_data mod_dbd mod_deflate mod_dir mod_dumpio mod_echo mod_env mod_expires mod_ext_filter mod_filter mod_headers mod_include mod_info mod_log_config mod_logio mod_mime_magic mod_mime mod_negotiation mod_remoteip mod_reqtimeout mod_rewrite mod_setenvif mod_slotmem_plain mod_slotmem_shm mod_socache_dbm mod_socache_memcache mod_socache_shmcb mod_status mod_substitute mod_suexec mod_unique_id mod_unixd mod_userdir mod_version mod_vhost_alias mod_dav mod_dav_fs mod_dav_lock mod_lua prefork mod_proxy mod_lbmethod_bybusyness mod_lbmethod_byrequests mod_lbmethod_bytraffic mod_lbmethod_heartbeat mod_proxy_ajp mod_proxy_balancer mod_proxy_connect mod_proxy_express mod_proxy_fcgi mod_proxy_fdpass mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_wstunnel mod_ssl mod_systemd mod_cgi mod_perl mod_php7
以上显示 php7安装成功!