已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
redHatLinux环境安装apache、mysql、php、Discuz解决SSH乱码命令: export LANG=zh_CN.gb2312注意:文中黄色背景文字为需要注意的内容或者代表整段为一条命令。1、 如果是LINUX服务器则跳过此步骤;如果是VM则需要设置网络,如下:说明:05为本机IP,5为VM的IP,根据具体情况设置。2、 linux安装rootlocalhost # yum install gccrootlocalhost # yum -y install gcc-c+rootlocalhost # yum install ncurses-develrootlocalhost # yum install bisonrootlocalhost # yum install ncurses-devel libxml2-devel bzip2-devel libcurl-devel curl-devel libjpeg-devel libpng-devel freetype-devel net-snmp-develrootlocalhost # yum -y install gcc gcc-c+ make automake autoconf kernel-devel ncurses-devel libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel pcre-devel libtool-libs freetype-devel gd zlib-devel file bison patch mlocate flex diffutils readline-devel glibc-devel glib2-devel bzip2-devel gettext-devel libcap-devel libmcrypt-devel3、 apache安装下载apr-1.4.6.tar.gz放到/u02/item/soft 下下载地址:/apache/apr/rootlocalhost #cd /u02/item/softrootlocalhost #tar -zxvf apr-1.4.6.tar.gz rootlocalhost #cd apr-1.4.6rootlocalhost apr-1.4.6#./configure -prefix=/u01/item/apr-1.4.6rootlocalhost apr-1.4.6#make /编译 rootlocalhost apr-1.4.6#make install/安装 下载apr-util-1.4.1.tar.gz 放到/u02/item/soft下下载地址:/apache/apr/rootlocalhost #cd /u02/item/softrootlocalhost #tar -zxvf apr-util-1.4.1.tar.gz rootlocalhost #cd apr-util-1.4.1rootlocalhost apr-util-1.4.1# ./configure -prefix=/u01/item/apr-util-1.4.1 -with-apr=/u01/item/apr-1.4.6rootlocalhost apr-util-1.4.1#make /编译rootlocalhost apr-util-1.4.1#make install/安装 下载pcre-8.31.tar.gz放到/u02/item/soft下下载地址:/projects/pcre/files/pcre/8.31/rootlocalhost #cd /u02/item/softrootlocalhost #tar -zxvf pcre-8.31.tar.gz rootlocalhost #cd pcre-8.31rootlocalhost pcre-8.31#./configure -prefix=/u01/item/pcre-8.31rootlocalhost pcre-8.31#make /编译 rootlocalhost pcre-8.31#make install/安装下载httpd-2.4.3.tar.bz2 把httpd-2.4.3.tar.bz2放到/u02/item/soft 下下载地址:/apache/httpd/httpd-2.4.3.tar.bz2 rootlocalhost #cd /u02/item/softrootlocalhost soft#tar jxvf httpd-2.4.3.tar.bz2/解压apache的压缩包rootlocalhost soft#cd httpd-2.4.3/定位到httpd-2.4.3 文件夹下rootlocalhost httpd-2.4.3#./configure -help | more/查看安装apache配置参数rootlocalhost httpd-2.4.3# ./configure -prefix=/u01/item/apache -enable-so -with-apr=/u01/item/apr-1.4.6 -with-apr-util=/u01/item/apr-util-1.4.1 -with-pcre=/u01/item/pcre-8.31/ 配置apache路径rootlocalhost httpd-2.4.3#make /编译apacherootlocalhost httpd-2.4.3#make install/安装apacherootlocalhost local#cp /u01/item/apache/bin/apachectl /etc/rc.d/init.d/httpd /拷贝apache启动脚本rootlocalhost local#vi /etc/rc.d/init.d/ httpd/ 这里是编辑apache启动脚本 /在开头的 #!/bin/sh 下面加上 #chkconfig: 345 85 15如果安装linux系统时为默认安装apache服务,则需要执行以下三条命令,否则直接执行“停止apache服务”命令rootlocalhost local#cd etc/rc.d/init.d/rootlocalhost local#chmod 777 httpdrootlocalhost local#chkconfig -add httpdrootlocalhost local#service apache stop/停止apache服务rootlocalhost local#netstat -an | grep :80/查看linux的80端口是否关闭rootlocalhost local#ps -aux | grep httpd/查看是否存在httpd服务rootlocalhost local#service apache start /启动apache服务/此时,打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你,linux下安装apache已经成功了。(默认显示“It works.”),此页面位置:/u01/item/apache/htdocs/index.html4、 安装Mysql5下载cmake-2.8.9.tar.gz放到/u02/item/soft 下下载地址:/cmake/resources/software.htmlrootlocalhost #cd /u02/item/softrootlocalhost #tar -zxvf cmake-2.8.9.tar.gz rootlocalhost #cd cmake-2.8.9rootlocalhost cmake-2.8.9#./configure -prefix=/u01/item/cmake-2.8.9 (若无反应,则去掉参数)rootlocalhost cmake-2.8.9#make /编译 rootlocalhost cmake-2.8.9#make install/安装 rootlocalhost cmake-2.8.9# export PATH=/ u01/item/cmake-2.8.9/bin:$PATH /增加临时环境变量,只对当前session有效,重启后需再次输入此命令,否则会报cmake:command not found下载mysql-5.5.27.tar.gz 把mysql-5.5.27.tar.gz放到/u02/item/soft 下下载地址:/downloads/mysql/#downloads,选择“Source Code”。下载链接:/downloads/mirror.php?id=408971 rootlocalhost # groupadd mysqlrootlocalhost # useradd -g mysql mysqlrootlocalhost soft# tar zxvf mysql-5.5.27.tar.gzrootlocalhost soft# cd mysql-5.5.27rootlocalhost mysql-5.5.27# cmake -DCMAKE_INSTALL_PREFIX=/u01/item/mysql -DMYSQL_UNIX_ADDR=/u01/item/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/u01/item/mysql/data -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306rootlocalhost mysql-5.5.27# makerootlocalhost mysql-5.5.27# make installrootlocalhost # cp /u01/item/mysql/support-files/f /etc/f /开机启动rootlocalhost # cp /u01/item/mysql/support-files/mysql.server /etc/init.d/mysql / 可用service命令重启rootlocalhost # chmod 777 /etc/init.d/mysql / 权限设定为777rootlocalhost # chkconfig -add mysql / 增加 mysql 为系统服务rootlocalhost # chkconfig -level 35 mysql on / 增加 mysql 自动启动级别rootlocalhost # chown mysql:mysql /u01/item/mysql -R / 权限设定rootlocalhost # cd /u01/item/mysqlrootlocalhost mysql# ./scripts/mysql_install_db -user=mysql / 初始化数据库rootlocalhost mysql# /etc/init.d/mysql start /第一种方式启动数据库rootlocalhost mysql# bin/mysqld_safe -user=mysql & /第二种方式启动数据库rootlocalhost # service mysql start /第三种方式启动数据库rootlocalhost mysql# /etc/init.d/mysql stop /第一种方式关闭数据库rootlocalhost mysql# bin/mysqladmin -u root shutdown /第二种方式关闭数据库rootlocalhost # service mysql stop /第三种方式关闭数据库rootlocalhost mysql# bin/mysql -uroot /应用mysql/ 由export LANG=zh_CN.gb2312语句可能引发错误,重新开启SSH即可解决。/此时可以输入show databases;来查看数据库,如果成功则数据库已成功开启rootlocalhost mysql# bin/mysqladmin -u root password 123456 /修改root密码,此步骤不是必须的如果遇到外部数据库浏览器被禁止访问数据库的情况可以尝试如下命令:rootlocalhost mysql#cd /u01/item/mysql/binrootlocalhost bin#./mysqld_safe /或 mysqld_safe -skip-grant-tables& /客户端工具链接,修改允许%访问5、 安装PHP下载php-5.4.6.tar.gz,把php-5.4.6.tar.gz放到/u02/item/soft 下下载地址:/get/php-5.4.6.tar.gz/from/a/mirror有些系统不能使用开始时提到的yum命令安装,则此处可能需要先安装libmcrypt,此处采用wget方式安装:rootlocalhost php-5.4.6 wgetftp:/mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gzrootlocalhost php-5.4.6 tar -zxvf libmcrypt-2.5.7.tar.gzrootlocalhost php-5.4.6 cd libmcrypt-2.5.7rootlocalhost php-5.4.6 mkdir -p /usr/local/libmcrytprootlocalhost php-5.4.6./configure prefix=/usr/local/libmcrytp/rootlocalhost php-5.4.6 makerootlocalhost php-5.4.6 make installrootlocalhost # tar -zxvf php-5.4.6.tar.gzrootlocalhost # cd php-5.4.6rootlocalhost php-5.4.6# ./configure -prefix=/u01/item/php-5.4.6 -with-config-file-path=/u01/item/php-5.4.6/etc -with-apxs2=/u01/item/apache/bin/apxs -with-mysql=/u01/item/mysql -with-mysqli=/u01/item/mysql/bin/mysql_config -with-mysql-sock=/u01/item/mysql/mysql.sock -with-gd -with-iconv -with-freetype -with-jpeg -with-png -with-zlib -with-libxml -enable-xml -enable-discard-path -enable-magic-quotes -enable-safe-mode -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-curlwrappers -enable-mbregex -enable-fastcgi -enable-force-cgi-redirect -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear -with-gettext -with-mime-magic -enable-suhosin -enable-session -with-mcrypt rootlocalhost php-5.4.6# makerootlocalhost php-5.4.6# make installrootlocalhost php-5.4.6# mkdir /u01/item/php-5.4.6/etcrootlocalhost php-5.4.6# cp php.ini-production /u01/item/php-5.4.6/etc/php.ini开启apache模块,让apache支持php在apache主配置文件内添加以下内容:#vim /u01/item/apache/conf/httpd.conf.LoadModule php5_module modules/libphp5.so /已有的AddType application/x-httpd-php .php /后添加的. DirectoryIndex index.ph
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- (2026版)医院医学腐败监督管理制度
- 2026年宁波市中医院医护人员招聘笔试备考题库及答案详解
- 2026年枣庄市立中医院医护人员招聘考试参考题库及答案详解
- 2026年上海中医药大学附属曙光医院医护人员招聘笔试参考题库及答案详解
- 2026年湖北省口腔医院医护人员招聘笔试参考题库及答案详解
- 2026年招商银行(南通分行)人员招聘考试参考题库及答案详解
- 2025年中国人民解放军第910医院医护人员招聘考试题库附答案详解
- 2026年中国中医科学院西苑医院医护人员招聘笔试备考试题及答案详解
- 2026年石河子大学医学院第一附属医院医护人员招聘笔试备考试题及答案详解
- 2026年青海大学附属医院医护人员招聘考试备考试题及答案详解
- 动物外科课件《四肢疾病》
- 储备粮粮食质量档案制度
- (2025)加速康复妇科围手术期护理中国专家共识课件
- (2025年)伤口造口失禁专科护士护理理论考核试题及答案
- 硫酸卸货安全协议书
- 移动式脚手架培训课件
- 2026年一级建造师一建机电案例分析考前重点知识必背十页纸
- 建设项目竣工验收汇报
- 医保政策及知识培训课件
- 2025年北京市公务员行测真题附答案详解考试直接用
- 物业保洁落叶清扫方案(3篇)
评论
0/150
提交评论