以下安装apache,mysql,php:
yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql
1.安装php扩展:
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
2.安装apache扩展:
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
3.启动mysql:
/etc/init.d/mysqld start
4.设置mysql的root密码:
mysqladmin -u root password '你的密码'
5.按[ctrl+alt+f7]切换到图形界面.
6.配置apache多站点,找到/etc/httpd/conf/httpd.conf,用文本编辑器打开,找到[#NameVirtualHost *:80],去掉前面的[#]号.
7.找到[DirectoryIndex index.html index.shtml],增加一个[index.php].
8. 在[/etc/httpd/conf.d]文件夹内新建一个[vhosts.conf]文件,内容格式如下(假设我要建立两个站点http: //www.yomeier.com/ / http://www.k204**/),对应的网站文件则应放在[/var/www/yomeier]和 [/var/www/k2046]目录下.:
<VirtualHost *:80>
ServerAdmin xxx@live.com
DocumentRoot /var/www/yomeier
ServerName www.yomeier.com
AddDefaultCharset UTF-8
<Directory "/var/www/yomeier">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin xxx@live.com
DocumentRoot /var/www/k2046
ServerName www.k204**
AddDefaultCharset UTF-8
<Directory "/var/www/k2046">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
9.打开终端.
启动apache:/etc/init.d/httpd start
10.设置apache自启动:
chkconfig --add httpd
chkconfig --level 345 httpd on
11.设置mysql自启动:
chkconfig --add mysqld
chkconfig --level 345 mysqld on
12.修正centos在VirtualBox安装里全屏时分辨率的问题:
用文本编辑器打开[/etc/X11/xorg.conf]
找到:
SubSection "Display"
Modes "1280x800" "800x600" #这里按屏幕需要改就可以了
EndSubSection完成!