赞
踩
CentOs装好后,先配置网络,进入 /etc/sysconfig/network-scripts/ifcfg-eth0,把onboot改为on,重启网络service network restart。
更换Yum源
- mv CentOS-Base.repo CentOS-Base.repo.bak
- wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
- yum makecache
- 一定得把以前的 CentOS-Base.repo给删除了,不然在Yum操作的时候就会出现Repository base is listed more than once in the configuration提示信息
- yum install httpd httpd-devel
- 安装完成后,用/etc/init.d/httpd start 启动apache
- 设为开机启动:chkconfig httpd on
- wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
- rpm -ivh mysql57-community-release-el7-7.noarch.rpm
- vim /etc/yum.repos.d/mysql-community.repo
- 把MySQL 5.5的enable改为1,其他版本的改为0
- yum install mysql mysql-server mysql-devel
- /etc/init.d/mysqld start
- 装好后,会出现Access denied for user 'root'@'localhost' (using password: YES),解决方法如下
- /etc/init.d/mysqld stop
- mysqld_safe –skip-grant-tables &
- mysql -uroot -p
- use mysql;UPDATE user SET Password=PASSWORD(123456) WHERE USER='root';flush privileges;quit;
- /etc/init.d/mysqld start
- rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
- yum install php54w php54w-bcmath php54w-cli php54w-common php54w-devel php54w-fpm php54w-gd php54w-imap php54w-ldap php54w-mbstring php54w-mcrypt php54w-mysql php54w-odbc php54w-pdo php54w-pear php54w-pecl-igbinary php54w-xml php54w-xmlrpc php54w-opcache php54w-intl php54w-pecl-memcache
重启apache,/etc/init.d/httpd restart,搞定。
【update】下面是简单虚拟主机配置
- #这里要关闭selinux,不然有时会报权限问题
- vi /etc/sysconfig/selinux
- SELINUX=disabled
- reboot
-
- #也可以临时关闭,但重启之后还是会变成原来的状态
- setenforce 0
-
- Listen 3029
- <VirtualHost *:3029>
- DocumentRoot "/var/www/html/sugar"
- ServerName localhost
- ErrorLog "/var/log/sugar_error.log"
- CustomLog "/var/log/sugar_access.log" common
- <Directory /var/www/html/sugar>
- Options Indexes FollowSymLinks MultiViews
- AllowOverride All
- Order deny,allow
- allow from all
- </Directory>
- </VirtualHost>
-
- Listen 3030
- <VirtualHost *:3030>
- DocumentRoot "/var/www/html/test"
- ServerName localhost
- </VirtualHost>
-
- #如果重启Apache后,没有进入想要的界面,在错误日志里显示 Directory index forbidden by Options directive
-
- rm -f /etc/httpd/conf.d/welcome.conf
- rm -f /var/www/error/noindex.html
- service httpd restart
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。