Skip to content

init_environment_in_centos6

New Future edited this page Jul 7, 2016 · 2 revisions

#!/bin/bash

#tools
# sudo yum install wget
# sudo yum install net-tools
# sudo yum install vim

#update source

# sudo yum install -y wget
sudo rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
sudo yum makecache
# sudo yum -y upgrade

Apache

sudo yum install httpd -y
sudo systemctl start httpd.service
sudo systemctl enable httpd
sudo firewall-cmd --permanent --add-service=http

MYSQL

sudo yum install -y mysql55w mysql55w-server
sudo systemctl start mysqld
sudo systemctl enable mysqld

php 7

# sudo yum -y upgrade
sudo yum install -y php70w php70w-opcache \
php70w-devel php70w-pdo_mysql  php70w-mcrypt php70w-mbstring

YAF

cd ~
sudo yum install -y gcc
curl https://pecl.php.net/get/yaf-3.0.3.tgz -O yaf.tgz
tar zxvf yaf.tgz
cd yaf-3.0.3/
phpize
./configure
make
sudo make install

#add yaf to php.ini

sudo sh -c "echo $'\nextension=yaf.so\n[yaf]\nyaf.environ=product'>>/etc/php.ini"
sudo sh -c "echo '<?php phpinfo();?>'>/var/www/html/index.php"

#change document root

sudo sh -c "echo $'DocumentRoot /var/www/public/\n
<Directory \"/var/www/public/\">\n
Options FollowSymLinks\n
AllowOverride all\n
Require all granted\n 
</Directory>'>/etc/httpd/conf.d/yyf.conf"
sudo service httpd restart

#adminer mysql mangement online

sudo curl https://www.adminer.org/latest-mysql.php -O /var/www/html/adminer.php
Clone this wiki locally