为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

centos中web服务器搭建

2012-12-25 10页 doc 980KB 44阅读

用户头像

is_135418

暂无简介

举报
centos中web服务器搭建安装mysql …………………………… 完成mysql的安装。 然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动。 …………………………………………………………….. 为mysql root账户设置密码: Mysql_secure_installation [root@localhost lx]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED ...
centos中web服务器搭建
安装mysql …………………………… 完成mysql的安装。 然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动。 …………………………………………………………….. 为mysql root账户设置密码: Mysql_secure_installation [root@localhost lx]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! 创建成功。 2.安装apache Apache2的是作为一个CentOS的软件包,因此我们可以直接用下面命令安装它: …………………… 安装成功。 现在配置系统在引导时启动apache,第二步 启动apache 查看本地IP 现在,在浏览器中输入本地IP地址,可以看到apache2的测试页,如下图: Apache的默认文档根目录是在CentOS上的/var/www/html 目录 ,配置文件是/etc/httpd/conf/httpd.conf。配置存储在的/etc/httpd/conf.d/目录。 3、安装php 用下列命令安装php:yum install php ………………………………………… 安装完需要重新启动:/etc/init.d/httpd restart [root@localhost lx]# chkconfig httpd on 添加apache开机自动启动 4.我们可以安装php和apache的php模块如下: 默认网站的文件根目录是在/srv/www/html中。现在我们将在该目录中创建一个小型PHP文件(info.php的)在浏览器中调用它。该文件将显示很多关于我们的PHP安装,如安装的PHP版本和有用的一些细节。 输入命令:vi /var/www/html/info.php 进入后输入下图内容: 现在,用浏览器访问:http://192.168.222.134/info.php 正如你所看到的,PHP的工作,它通过Apache 2.0的处理程序,在服务器API线。如果你继续向下滚动,你会看到所有在PHP5中已经启用的模块。MySQL是没有列出,这意味着我们没有在PHP支持MySQL。 5.Php获得mysql的支持 让PHP在MySQL中获得支持,我们可以安装的php-mysql软件包。安装一些其他的PHP5模块,以及您可能需要的应用程序 yum search php ………………………. 还需要安装所需要的: yum install php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc …………………………………. 现在重新启动apache:/etc/init/httpd restart 现在,重载http://192.168.222.134/info.php在您的浏览器,并再次向下滚动到模块部分。现在,你应该找到许多新的模块,包括MySQL模块: 6.安装phpmyadmin phpMyAdmin是一个网络接口,通过它可以管理你的MySQL数据库。 首先,我们使我们的CentOS系统的RPMForge软件库phpMyAdmin,不是官方的CentOS 6.0库,导入rpmforge的GPG密钥: rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt i386 系统安装命令: yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm ……………………………………………………… 安装phpmyadmin:yum install phpmyadmin ……………………………….. 现在我们可以设置phpMyAdmin了,我们可以改变Apache的配置来让phpMyAdmin不仅仅只能从localhost登录。 输入命令:vi /etc/httpd/conf.d/phpmyadmin.conf 里面输入以下内容: 下一步,我们从HTTP改变的phpMyAdmin的cookie来身份验证: vi /usr/share/phpmyadmin/config.inc.php 将里面cookie改为http,即修改身份验证 重启apache 输入命令:/etc/init.d/httpd restart 然后在地址栏输入http://192.168.222.134/phpMyAdmin/:你就可以访问phpMyAdmin了。 查看apache的所有配置文件存放的目录 这是网页文件存放目录,一般在html内
/
本文档为【centos中web服务器搭建】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索