apache centos 配置 apache官网下载
其实apache centos 配置的问题并不复杂,但是又很多的朋友都不太了解apache官网下载,因此呢,今天小编就来为大家分享apache centos 配置的一些知识,希望可以帮助到大家,下面我们一起来看看这个问题的分析吧!
CentOS 系统上安装 Apache 完成步骤
访问Apache官方站点获取最新源代码压缩包。
替换下载的Apache软件包名称于命令中。
命令安装Apache至“/usr/local/apache2”目录,并启用共享模块、头文件和MIME魔术功能,自定义选项。
执行命令编译并安装Apache。注意:若系统已安装旧版Apache,需先停止旧版本再安装新版本。
执行命令启动Apache。在浏览器访问“your_server_IP/”检查Apache安装是否成功。
步骤简洁明了,希望对在CentOS系统上安装Apache的您有所帮助。
如何在CentOS 7上安装Apache Cassandra
首先要安装好java,并配置好java环境。现在通过创建一个新的存储库文件将Apache Cassandra存储库添加到您的存储库列表中。
nano/etc/yum.repos.d/cassandra.repo
现在将以下内容添加到文件中。
[cassandra]
name=Apache Cassandra
baseurl=
gpgcheck=1
repo_gpgcheck=1
gpgkey=
您现在可以通过运行以下命令安装Apache Cassandra。
yum-y install cassandra
通过运行以下命令重新加载系统守护程序:
systemctl daemon-reload
你现在可以通过键入来启动Cassandra
systemctl start cassandra
要启用Cassandra在启动时自动启动,请运行:
systemctl enable cassandra
您可以通过键入以下命令来验证Cassandra是否正在运行。
nodetool status
如果Cassandra正在运行,您应该看到类似的输出。
[root@ip-172-31-7-136~]# nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns(effective) Host ID Rack
UN 127.0.0.1 136.29 KiB 256 100.0% b3d26649-9e10-4bee-9b3c-8e81c4394b2e rack1
如果不是显示上面的输出,而是得到类似于以下输出的内容,那么您将需要配置cassandra环境配置文件。
nodetool: Failed to connect to'127.0.0.1:7199'- ConnectException:'Connection refused(Connection refused)'.
使用以下命令打开配置文件。
nano/etc/cassandra/default.conf/cassandra-env.sh
现在在配置中找到以下一行。
# JVM_OPTS="$JVM_OPTS-Djava.rmi.server.hostname=<public name>"
取消注释行并将其值形式<public_name>更改为localhost IP地址127.0.0.1。
配置应如下所示。
JVM_OPTS="$JVM_OPTS-Djava.rmi.server.hostname=127.0.0.1"
保存文件并从编辑器退出,通过运行以下命令重新启动Apache Cassandra。
systemctl restart cassandra
运行nodetool命令时应该具有所需的输出。
Cassandra带有一个强大的命令行shell cqlsh来在Cluster上运行查询。查询是用CQL或Cassandra Query语言编写的。要访问CQL shell,请运行以下命令。
cqlsh
您将看到以下输出。
[root@www.linuxidc.com~]# cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1| Cassandra 3.11.0| CQL spec 3.4.4| Native protocol v4]
Use HELP for help.
如何在CentOS 7服务器上利用Apache安装并hpMyAdmin
在CentOS上安装phpMyAdmin,首先需要架设一台Web服务器(如Apache或nginx),安装好MySQL/MariaDB数据库和PHP。根据你的偏好和需求,你可以从LAMP和LEMP中选择一种安装。
另一个要求是允许在你的CentOS上安装EPEL库。在CentOS6或7上安装phpMyAdmin可以通过以下命令实现。在CentOS 7上:$ sudo yum install phpmyadmin。如果需要php-mcrypt扩展,可以使用:$ sudo yum install phpmyadmin php-mcrypt。
在CentOS 7上配置phpMyAdmin,其默认情况下只允许从回环地址(127.0.0.1)访问。为了能远程连接,需要改动它的配置文件。用文本编辑器打开phpMyAdmin的配置文件(路径:/etc/httpd/conf.d/phpMyAdmin.conf),找出并注释掉带有"Require ip XXXX"字样的代码行。会有四处这样的代码行,用"Require all granted"取而代之。重新改动过的配置文件如下所示。$ sudo vi/etc/httpd/conf.d/phpMyAdmin.conf。
AddDefaultCharset UTF-8
# Apache 2.4
#Require ip 127.0.0.1
#Require ip::1
Require all granted
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from::1
# Apache 2.4
#Require ip 127.0.0.1
#Require ip::1
Require all granted
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from::1
最后,重启httpd使改动生效:$ sudo systemctl restart httpd。
在CentOS 6上配置phpMyAdmin,默认情况下是禁止从每个IP地址访问的。为了能远程连接,你需要改动它的配置。用文本编辑器打开phpMyAdmin的配置文件(路径:/etc/httpd/conf.d/phpmyadmin.conf),找出并注释掉"Deny from all"字样的代码行。然后把"Allow from 127.0.0.1"字样的代码行改成"Allow from 0.0.0.0"。重新改动过的配置文件如下所示。$ sudo vi/etc/httpd/conf.d/phpmyadmin.conf。
Order Deny,Allow
# Deny from all
Allow from 0.0.0.0
下一步是将phpMyAdmin的配置文件用blowfish加密工具加密。这一步需要加密cookie里的密码来作为基于cookie的部分认证。用文本编辑器打开如下路径所示的文件并且用blowfish设置一个随机密码,如下所示:$ sudo vi/usr/share/phpmyadmin/config.inc.php。
$cfg['blowfish_secret']='kd5G}d33aXDc50!';/* YOU MUST FILL IN THIS FOR COOKIE AUTH!*/
最后,重启httpd使改动生效:$ sudo service httpd restart(CentOS 6)或$ sudo systemctl restart httpd(CentOS 7)。
测试phpMyAdmin是否设置成功,访问这个页面:。你应该能通过Web界面来记录下任何MySQL用户(比如root)和管理MySQL/MariaDB的数据库/表。
疑难解答:在CentOS上安装phpMyAdmin的过程中遇到的一些问题解决方法。
当你在浏览器里尝试连接phpMyAdmin页面的时候,出现"403 Forbidding"错误:"You don't have permission to access/phpMyAdmin on this server."。这是因为phpMyAdmin默认阻止了IP地址远程连接。要修复这种错误,需要编辑它的配置文件来允许远程连接。具体操作见上述步骤。
当你连接phpMyAdmin页面时,出现"The configuration file now needs a secret passphrase(blowfish_secret)."信息,并且你无法登录。要修复这种错误,需要编辑/usr/share/phpmyadmin/config.inc.php这个文件来添加一个随机的blowfish密码,然后重启httpd,如下所示:$ sudo service httpd restart(CentOS 6)或$ sudo systemctl restart httpd(CentOS 7)。$cfg['blowfish_secret']='kd5G}d33aXDc50!';/* YOU MUST FILL IN THIS FOR COOKIE AUTH!*/
当你连接phpMyAdmin页面时,出现"Cannot load mcrypt extension. Please check your PHP configuration"错误信息。要修复这种错误,需要安装下面这个包,然后重启httpd:$ sudo yum install php-mcrypt。