Amazon EC2 RHEL6.5 X64安装Apache MySQL5.5 PHP

没啥好写的 把最近做的都丢上来吧

iptables设置(开启80 3306端口)

iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
service iptables save
service iptables restart

安装EPEL源和MySQL5.5的源

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

设置乱七八糟

echo “HOSTNAME=nby.me” >> /etc/sysconfig/network
hostname “nby.me”
ln -sf /usr/share/zoneinfo/Hongkong /etc/localtime
echo “ZONE=”Asia/Hong_Kong”” > “/etc/sysconfig/clock”

安装apache

yum install httpd -y

备份一下设定

cp /etc/httpd/conf/httpd.conf ~/httpd.conf.backup

修改/etc/httpd/conf.d/vhost.conf

NameVirtualHost *:80

ServerAdmin [email protected]
ServerName www.acger.us
ServerAlias www
DocumentRoot /home/www/

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

ErrorLog /home/www/logs/error.log
CustomLog /home/www/logs/access.log combined

ServerSignature Off

小细节

mkdir -p /home/www/
mkdir /home/www/logs

开机启动

/sbin/chkconfig –levels 235 httpd on

启动apache

/etc/init.d/httpd start

安装MySQL5.5

yum –enablerepo=remi,remi-test install mysql mysql-server mysql-devel -y
service mysqld start
chkconfig –levels 235 mysqld on

安装PHP

yum install php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt httpd-manual mod_ssl mod_perl mod_auth_mysql -y

重启服务

fuser -k -n tcp 80
/etc/init.d/httpd reload
/etc/init.d/httpd restart

设置MySQL

mysql_secure_installation

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *