CentOS上安装配置apache+php+mysql

yum install ntp httpd mysql-server php php-mysql php-mbstring rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel phpMyAdmin pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel postfixphp

yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-develmysql

为MySQL root账户设置密码:sql

  mysql_secure_installation数据库

  会出现下面的一系列提示:网络

  root@server1 ~]# mysql_secure_installationcurl

  NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLpost

  SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!ui

  In order to log into MySQL to secure it, well need the currenturl

  password for the root user. If youve just installed MySQL, andspa

  you havent 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] ENTER

  New password: yourrootsqlpassword

  Re-enter new password: yourrootsqlpassword

  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] ENTER

  ... 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] ENTER

  ... 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] ENTER

  - 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] ENTER

  ... Success!

  Cleaning up...

  All done! If youve completed all of the above steps, your MySQL

  installation should now be secure.

  Thanks for using MySQL!

  [root@server1 ~]#

安装phpMyAdmin

  phpMyAdmin是一个网络接口,经过它能够管理你的MySQL数据库。

  首先,咱们使CentOS系统RPMForge软件库的phpMyAdmin,而不是官方的CentOS 6.2库:

  因此须要导入RPMForge的GPG密钥:

  rpm import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

  x86_64系统:

  yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

  在i386系统:

  yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

  安装phpmyadmin

  yum install phpmyadmin

安装setuptool吧,能够节省不少系统管理的时间。

#安装setuptool
yum install setuptool
#能够发现执行setup后不全,再安装一个用于系统服务管理
yum install ntsysv
#再安装个防火墙,以及setup中配套的防火墙设置、网络设置
yum install iptables
#安装setup中配套的防火墙设置
yum install system-config-securitylevel-tui
#安装setup中配套的网络设置
yum install system-config-network-tui

相关文章
相关标签/搜索