centos 安裝virtualbox

kidking2010發表於2012-02-22
引自
特別值得一提的是CentOS有很多值得學習的地方,這裡我們主要介紹VirtualBox安裝中配置,包括介紹VirtualBox安裝等方面。CentOS社群的Linux發行版本被稱為CentOS Linux,由於使用了由RHEL的原始碼重新編譯生成新的發行版本,CentOS Linux具有與RHEL產品非常好的相容性,並且與生俱來地擁有RHEL的諸多優秀特性。
 
最近需要配置一個php的環境,當然windows也可以,不過還是選擇安裝一個CentOS,經過很長一段時間的摸索,終於配置完成了.VirtualBox安裝中配置CentOS 5.3+Apache+MySql5+php5 
 
1.到下載最新版的virtualbox[直接下載=>].
2.到下載iso檔案[直接下載=>].
3.VirtualBox安裝.
4.建立一個CentOS的虛擬系統,並VirtualBox安裝作業系統,按提示操作即可.
5.進入系統後,選擇系統視窗的[裝置->安裝增強包],載入VirtualBox安裝的增強包iso.
6.按[ctrl+alt+f1]進入命令列介面,以root身份登入.
7.執行以下命令安裝增強包,即可成功安裝增強包.:
yum install kernel-devel
yum install gcc
ln -s /usr/src/kernels/2.6.18-92.1.18.el5-i686 /usr/src/linux
sh VBoxLinuxAdditions-x86.run
8.以下安裝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
9.安裝php擴充套件:
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
10.安裝apache擴充套件:
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
11.啟動mysql:
/etc/init.d/mysqld start
12.設定mysql的root密碼:
mysqladmin -u root password '你的密碼'
13.按[ctrl+alt+f7]切換到圖形介面.
14.配置apache多站點,找到/etc/httpd/conf/httpd.conf,用文字編輯器開啟,找到[#NameVirtualHost *:80],去掉前面的[#]號.
15.找到[DirectoryIndex index.html index.shtml],增加一個[index.php].
16.在[/etc/httpd/conf.d]資料夾內新建一個[vhosts.conf]檔案,內容格式如下(假設我要建立兩個站點**/),對應的網站檔案則應放在[/var/www/yomeier]和[/var/www/k2046]目錄下.:
ServerAdmin xxx@live.com
DocumentRoot /var/www/yomeier
ServerName 
AddDefaultCharset UTF-8
Options All
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin xxx@live.com
DocumentRoot /var/www/k2046
ServerName **
AddDefaultCharset UTF-8
Options All
AllowOverride All
Order allow,deny
Allow from all
17.開啟終端.
啟動apache:/etc/init.d/httpd start
18.設定apache自啟動:
chkconfig --add httpd
chkconfig --level 345 httpd on
19.設定mysql自啟動:
chkconfig --add mysqld
chkconfig --level 345 mysqld on
20.修正在VirtualBox安裝裡全屏時解析度的問題:
用文字編輯器開啟[/etc/X11/xorg.conf]
找到:
SubSection "Display"
Modes "1280x800" "800x600" #這裡按螢幕需要改就可以了
EndSubSection完成!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23141985/viewspace-716921/,如需轉載,請註明出處,否則將追究法律責任。

相關文章