`

linux 系统快速安装lamp

阅读更多

Step 2. 安装php/mysql/httpd
#安装apache 
yum -y install httpd httpd-devel  
#安装mysql 
yum -y install mysql mysql-devel mysql-server mysql-libs 

phpMyAdmin]# yum -y install httpd-man l mod_ssl mod_perl mod_auth_mysql

#安装php 
yum -y install php 
#安装php扩展 
yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo  
yum -y install php-mcrypt php-tidy php-xml php-xmlrpc php-pear   
#其它不常用php扩展, www.linuxidc.com 可不用安装 
yum -y install php-pecl-memcache php-eaccelerator 
#安装phpmyadmin 
yum -y install phpmyadmin  
#安装完成之后,启动 
service httpd start 
service mysqld start 

2、为root账户设置密码
mysql_secure_installation
回车,根据提示输入Y
输入2次密码,回车
根据提示一路输入Y
最后出现:Thanks for using MySQL!

[root@iZ25tti3rxdZ ~]# service mysqld start
Initializing MySQL database:  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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h iZ25tti3rxdZ password 'new-password'

Alternatively you can run:
/usr/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 /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@iZ25tti3rxdZ ~]# 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):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
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] n
 ... skipping.

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] n
 ... skipping.

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] y
 - 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] y
 ... 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!

 
MySql密码设置完成,重新启动 MySQL:
/etc/init.d/mysqld restart #重启
/etc/init.d/mysqld stop #停止
/etc/init.d/mysqld start #启动

 

 

Step 3.配置httpd、mysqld开机自启动
chkconfig mysqld on 
chkconfig httpd on 

Step 4.配置phpmyadmin
修改/usr/share/phpmyadmin/config.inc.php或者 /usr/share/phpMyAdmin/config.inc.php
#将这里abcde文字修改为自己的字符,可任意
$cfg['blowfish_secret'] = 'abcde'; 

常见问题
1. phpmyadmin提示未开启php-mcrypt,这是因为没有安装php-mrcrpt扩展。在官方源没有php-mrcrpt扩展,请安装epel源后再yum install php-mcrypt

2. phpmyadmin无法访问

phpmyadmin默认只能使用http://localhost/phpmyadmin来访问,可以修改/etc/httpd/conf.d/phpmyadmin.conf中对应部分为
<Directory "/usr/share/phpmyadmin"> 
  Order Deny,Allow 
#  Deny from all 
  Allow from All 
</Directory> 
不过强烈不支持这么做的,把phpmyadmin暴露了不安全

注意:
apache解析php,修改httpd.conf文件,添加
Addtype application/x-httpd-php .php .phtml
Addtype application/x-httpd-php-source .phps

myql可以远程登录
设置mysql密码
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;
1.2.3 允许远程登录
mysql -u root -p
Enter Password: <your new password>
mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
完成后就能用mysql-front远程管理mysql了。
设为开机启动
chkconfig mysqld on

 

我执行过程:

[root@huangwei mysql]# mysql_secure_installation
/bin/mysql_secure_installation:行379: find_mysql_client: 未找到命令

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, 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):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
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 MariaDB
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 MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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] Y
 ... 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] Y
 ... Success!

By default, MariaDB 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] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

 

 

 

 

参考:

http://www.jb51.net/article/38601.htm

 

分享到:
评论

相关推荐

    Linux系统web服务器LAMP全套源码包整理

    5. **源码包安装过程**:在Linux系统上,从源码编译安装LAMP组件通常包括以下步骤: - 获取源码:下载Apache、MySQL和PHP的最新源码包。 - 预先安装依赖:根据各组件的编译需求,安装必要的库和工具,如GCC编译器...

    lamp一键安装脚本,xen一键安装linux

    这个一键安装脚本集可以帮助用户快速、简便地在Linux系统中配置LAMP环境,尤其适合那些对Linux系统操作不熟悉或者希望节省时间的用户。Xen是一种开源的虚拟化技术,可以在单一的物理服务器上运行多个独立的操作系统...

    lamp集成安装工具

    LAMP(Linux, Apache, MySQL, PHP)是Web开发领域一个常见的基础架构,用于在Linux系统上构建动态网站和应用。这个“lamp集成安装工具”正是为了简化这一过程,帮助用户快速在Linux环境中配置好LAMP环境。本文将详细...

    Linux下——LAMP环境的搭建

    在Linux操作系统中,LAMP(Linux, Apache, MySQL, PHP)环境是搭建Web服务的标准组合,常用于开发和运行基于PHP的动态网站。本教程将详细介绍如何在RHEL4.2系统上使用RPM包方式搭建LAMP环境。 首先,我们需要确保...

    linux下的LAMP一键安装教程借鉴.pdf

    Linux 下的 LAMP 一键安装教程借鉴 本资源主要介绍了 Linux 下的 LAMP 一键安装教程,...本资源提供了一个详细的 Linux 下的 LAMP 一键安装教程,借鉴 XAMPP 的 Linux 版安装过程,帮助开发者快速搭建 Web 应用程序。

    linux下的LAMP一键安装教程整理.pdf

    本文档提供了 Linux 下的 LAMP 一键安装教程,介绍了 XAMPP 的 Linux 版安装过程。XAMPP 是一个自由开源的跨平台 Web 服务器解决方案,包含 Apache、MySQL、PHP、Perl 等多种组件。通过本教程,用户可以快速安装和...

    CentOS操作系统安装及LAMP搭建教程.docx

    CentOS操作系统安装及LAMP搭建教程 本教程将指导读者完成 CentOS 操作系统的安装和 LAMP 环境的搭建,涵盖从下载 CentOS 操作系统到安装和配置 LAMP 环境的整个过程。 一、CentOS 操作系统安装 1. 下载 CentOS ...

    linux 应用设置安装方法集

    在Linux系统中,安装和配置应用是日常运维和开发工作的重要环节。本资源包"Linux应用设置安装方法集"聚焦于四个关键组件:Linux、Apache、MySQL和PHP,它们共同构成了著名的LAMP(Linux Apache MySQL PHP)服务器栈...

    linux系统安装redis及tomcat配置

    通过本文档,读者可以快速掌握 Linux 系统安装 Redis 及 Tomcat 的知识点。 六、知识点总结 * Redis 的安装 * Redis 的部署 * Redis 的配置 * Redis 的启动 * Tomcat 的安装 * Tomcat 的配置 * Tomcat 的启动 七...

    linux下的LAMP一键安装教程.pdf

    确保下载与你的Linux系统兼容的版本。例如,XAMPP Linux 1.7.4是一个具体的发行版,包含了特定版本的Apache、MySQL、PHP等组件。 2. **安装**:下载完成后,使用Linux终端并以root权限登录,然后解压下载的文件到...

    linux下的LAMP一键安装教程.docx

    Linux下的LAMP(Linux、Apache、MySQL、PHP)是一套常用的...通过以上步骤,你可以在Linux系统上快速搭建一个功能齐全的LAMP环境,开始你的Web开发工作。记住,始终关注XAMPP的更新,以获取最新的安全补丁和功能改进。

    一键安装lamp lnmp脚本

    标题中的“一键安装lamp lnmp脚本”指的是一个自动化脚本,用于快速部署Linux环境下的LAMP(Linux、Apache、MySQL、PHP)或LNMP(Linux、Nginx、MySQL、PHP)服务器栈。这样的脚本通常包含了安装、配置和优化相关...

    一键安装lamp环境。

    LAMP(Linux、Apache、MySQL、PHP)是搭建Web...总之,一键安装LAMP环境是快速部署Web服务器的方法,但深入理解和掌握每个组件的工作原理及配置细节,对系统管理员来说至关重要,这将有助于更好地管理和维护服务器。

    Ubuntu Linux一键搭建Lamp开发环境.zip

    在本教程中,我们将重点关注如何在Ubuntu Linux系统上快速搭建一个LAMP(Linux、Apache、MySQL、PHP)开发环境。LAMP是Web开发的经典组合,广泛用于构建动态网站和网络应用程序。 首先,让我们理解一下“Ubuntu ...

    window环境下安装LAMP的一些包

    在Windows环境下搭建LAMP(Linux、Apache、MySQL、PHP)服务器是常见的开发和测试环境配置。这个压缩包文件提供了一套适用于Windows的工具,包括PHP、Apache和libmysql.dll,帮助用户快速构建本地PHP开发环境。下面...

    快速搭建lamp环境+私有云.rar_lamp_私有云

    本教程将指导你如何在Linux系统上快速搭建LAMP环境,并进一步扩展到私有云的构建。 首先,我们来详细了解一下LAMP各组成部分: 1. Linux:作为基础操作系统,Linux提供了稳定、开源的操作环境,是许多服务器首选的...

    linux上安装mysql+apache+php及wordpress,LAMP

    在Linux系统上搭建LAMP(Linux、Apache、MySQL、PHP)环境是开发Web应用程序的基础步骤。这个过程在本文中详细地记录下来,旨在帮助新手快速理解并完成安装配置。我们将分别探讨如何安装MySQL、Apache、PHP以及...

    阿里云linux一键安装web环境

    1. **Linux系统基础**:阿里云服务器通常预装了各种Linux发行版,如Ubuntu、CentOS、Debian等。Linux是一种多用户、多任务的操作系统,其命令行界面对于服务器管理非常方便。 2. **SSH连接**:首先,用户需要通过...

    详解linux centos yum安装LAMP环境

    本文主要讲解如何在CentOS系统上使用YUM工具快速安装LAMP环境,以CentOS 6.5为例。 1. **YUM安装与源代码编译的区别** YUM(Yellowdog Updater, Modified)是RPM包管理器,它简化了软件包的安装、更新和卸载过程。...

Global site tag (gtag.js) - Google Analytics