今天做的實驗是綜合項目實驗,整合系統,挺簡單的。
首先準備一台虛拟機,把環境都配置好,網卡,iptables,selinux,yum元,主機名,ip等等。
安裝軟體:yum install -y openssh-client httpd php php-mysql php-gd mysql mysql-server
接下來寫hosts檔案,在裡面寫好解析,ip隻有一個,192.168.122.101 對應的域名有多個
192.168.122.101 www.ooxx.com
192.168.122.101 bbs.ooxx.com
192.168.122.101 shop.ooxx.com
192.168.122.101 disk.ooxx.com
192.168.122.101 weibo.ooxx.com
192.168.122.101 ucenter.ooxx.com
192.168.122.101 mysql.ooxx.com
然後修改httpd的配置檔案,打開監聽的80端口,複制最後一段到html目錄下,重新命名多個,分别為上面域名的簡稱,修改相對應的ServerAdmin DocumentRoot ServerName ErrorLog logs CustomLogs。
接着從挂載下來的伺服器上找到所需要的壓縮包,scp到root目錄下,mkdir 相對應的目錄,把壓縮包unzip到所建立的目錄内,再cp -a 目錄下所有内容到var/www/html/www/xx 下,記得要把所有者和所屬組改為apache, chown apache.apache var/www/html/www/xx -R
然後 /etc/init.d/httpd reload
接着打開浏覽器,輸入相對應的域名,就可以進行安裝啦。
接下來需要對mysql進行授權的操作。
首先 /etc/init.d/mysqld start
接着登陸mysql
先建立資料庫, create databases www
授權:grant all on www to www-user@“%” identity by “uplooking”;
grant all on www to www-user@“localhost” identity by “uplooking”;
重新整理授權:flush ipveleges;
儲存退出:quit
然後就可以在相應的網頁上進行操作了,相同動作,重複7遍就可以了。