设为首页 收藏本站
查看: 909|回复: 0

[经验分享] RHEL5系统 apache

[复制链接]

尚未签到

发表于 2018-11-27 12:18:36 | 显示全部楼层 |阅读模式
【数据资料来自互联网,个人收集总结http://snailwarrior.blog.51cto.com/editor/icons/etc_20.gif

1。安装apache-2.2.11
./configure
make
make install

然后在 ~/.bash_profile 文件中添加
PATH=$PATHHOME/bin:/usr/local/apache2/bin
这样为了方便启用、关闭apache


2。安装mysql(mysql-5.1.30-linux-i686-icc-glibc23.tar.gz)
这里采用的是mysql的二进制版本(32位),并为Intel构架优化过的
参考:http://dev.mysql.com/doc/refman/5.1/en/installing-binary.html

【备注】
刚开始这个版本在 rhel5 上运行 scripts/mysql_install_db --user=mysql 失败
改用版本 mysql-5.0.67-linux-i686-icc-glibc23.tar.gz 安装正常,后来发现在
/var/lib/mysql 目录下有以前5.0版本的数据,可能由于兼容性导致5.1版本安装不正常,
于是我将原来的数据删除即可正常安装 5.1 版本。


shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
--------------------------------------------------------------------------------

[root@miix mysql]# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h miix.hoho.com password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/
--------------------------------------------------------------------------------

安装完毕后根据以上的提示,别忘了设置mysql root用户密码,我另外新建一个用户 zhaozh
mysql> grant all on *.* to zhaozh@localhost identified by '××××××'

3。安装php-5.2.8
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli --with-gd --with-jpeg-dir --with-png-dir
make
make install
cp php.ini-dist /usr/local/lib/php.ini
php安装完后,在 /usr/local/apache2/modules 添加了动态连接库 libphp5.so
如果在启动或者重启apache时候,出现以下信息:
[root@miix htdocs]# apachectl -k restart
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
这是由于selinux引起的,所以需要这样一下:
chcon -t textrel_shlib_t libphp5.so
php安装完后,在 /usr/local/apache2/conf/httpd.conf 添加了一行:
LoadModule php5_module        modules/libphp5.so
本人不想采用这种方式,于是将上述一行注释掉,然后在 httpd.conf 文件末尾添加:
Include conf/conf.d/*.conf
接着建立目录 /usr/local/apache2/conf/conf.d
添加 php.conf 文件,内容如下:
--------------------------------------------------------------------------------
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
--------------------------------------------------------------------------------
重启apache,在 /usr/local/apache2/htdocs 目录下建立一个 test.php 文件,如下

在浏览器输入 http://ip/test.php ,如果能正常显示出php信息则说明apache+php OK了。

------------------------------------------------------------------------------------------
赵小蜗牛
QQ: 755721501
E-mail: snailwarrior@qq.com
在不断奉献中谋求生存发展、打造自己的优秀品质,用人性最本质最动人的一面“营销”自己!





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-640309-1-1.html 上篇帖子: CentOS5.5+Apache2+openssl0.9.8o实现https验证 下篇帖子: Apache三种多路处理模块(prework 、worker、event模式)总结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表