Amazon ec2 使用几个需要主要的地…

1:
启动apache服务器:
sudo /etc/init.d/httpd start
命令:sudo chkconfig httpd on不行,不知道为什么


2:
用ec2-user登录后,
首先超级用户:
sudo su,因为ec2-user是没有root权限的


赋予 ec2-user 权限:这样可以再winscp下设置文件
chown -R ec2-user:ec2-user /etc/httpd/conf/

3:
提示php没有mysql extension
修改php.ini
extension=mysql.so



安装phpmyadmin

1) First add the repository, then install:

首先避免乱码:

LANG=C

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sudo rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm 
sudo yum install phpmyadmin 

不行的话多试几次

This works fine on a standart 32bits amazon instance

2)once you have installed it, you must make a symbolic link (like a redirect) using 

sudo ln -s /usr/share/phpmyadmin /home/ec2-user/public_html

/home/ec2-user/public_html是改变后的目录,这里指向访问的根目录



 

配置文件现在需要绝密的短语密码(blowfish_secret)。

园子在网上找了多种解决方法,写的都不是非常详细,尝试了几次后终于发现了最简单的一种方法。

  1. 首先,把下载解压的 phpMyAdmin 文件中有一个文件“config.sample.inc.php”,这是phpMyAdmin配置文件的样本文件,我们需要把该文件复制,然后重命名为“config.inc.php”,config.inc.php是phpMyAdmin的配置文件,上传服务器时必须上传该文件。
  2. 然后用 DW 或任意编辑器打开 config.inc.php 搜索下面一行代码:
    $cfg['blowfish_secret'] = ”;
    将后面单引号里面随便填入个字符串即可!
  3. 修改完后,记得重起IIS 或Apache 。

其实,’blowfish_secret’用一个任意字符串作为cookie的加密字符串,如果没有加密钥匙,就会出现提示“配置文件现在需要绝密的短语密码(blowfish_secret)”。


提示没有phpmyadmin的权限

linux查找文件:

cmd:find 查找路径 -name 'name' -print

所以:find / -name phpmyadmin.conf

得到:/etc/httpd/conf.d/phpmyadmin.conf

 

Deny from all

Allow from 127.0.0.1

修改为:

Allow from all


 

Existing configuration file (./config.inc.php) is not readable

安装PHPMYADMIN时出现这个错误

Existing configuration file (./config.inc.php) is not readable

 

给config.inc.php   644   权限就可以了。


 

Installing MySQL on an EC2 Micro Instance

I’ve been doing a fair bit of work with Amazon EC2 instances recently, for my Final Year Project at uni. If you’ve not come across them before, then it’s basically Amazon’s way of making web-scale computing easy to set up and access. And it’s even more interesting when you see that they’re bringing in a free usage tier for the Linux Micro instances from 1st November this year.

When you create a new instance, you can choose an OS. If you choose “Basic Amazon Linux” (like I did) then you’ll get a stripped-down version that doesn’t have some bits you might be used to (like apt-get). I had to install MySQL recently, so here’s how to do that on such a setup:

sudo yum install mysql 
sudo yum install mysql-server 
sudo yum install mysql-devel 
sudo chgrp -R mysql /var/lib/mysql 
chmod -R 770 /var/lib/mysql 
sudo service mysqld start

By this stage, you’ll have MySQL installed and the service started. The next step is to set a password for the root user:

/usr/bin/mysqladmin -u root password yourpasswordhere

If you only want to use MySQL internally, then you’re all done now. But if you want to access MySQL externally then you’ll need to follow a few extra steps.

Firstly, go to the AWS Management Console, and find the Security Group that you assigned to your instance when you first set it up. Add “MySQL” to the group using the dropdown, or manually add port 3306. Save your changes.

Finally, create a MySQL user which is able to connect from any host (identified by a percent sign below) by running the following SQL using mysql from your instance’s command line:

mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 
    -> 'yourpasswordhere'
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'localhost'
    -> WITH GRANT OPTION; 
mysql> CREATE USER 'myuser'@'%' IDENTIFIED BY 'yourpasswordhere'
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'
    -> WITH GRANT OPTION;

And then you’re done, ready to connect from anywhere with that username and password.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值