Linux和Solaris建Apache虛擬根環境(2)

來源:互聯網
上載者:User

  4.9 這兒有一個小的perl指令碼程式,它將大多數的注釋從已產生的設定檔中刪除,形成一個簡化的檔案。

  4.10 將htdocs分類樹的所有權交給Web分類樹的所有者

  ROOT# chown -R 888:888 /www/apache/htdocs

  5.編譯和安裝MySQL

  MySQL並不是安裝在虛擬根環境化的分類樹上的,事實上,它有可能是安裝在其它系統上的。但在我的例子中,它是和Apache安裝在一個web伺服器上的。

  這個例子包括產生使用者和資料庫所在地,以及產生初始的資料庫

  5.1 產生使用者,他將是MySQL資料庫的所有者。

  例如:在home/mysql/中產生一個使用者777:777

  ROOT# groupadd -g 777 mysqldba

  ROOT# useradd -c "mysql DBA" -d /home/mysql -u 777 -g 777 -m -n mysql

  5.2 解開原碼,並將原碼分類樹給mysql的使用者

  ROOT# groupadd -g 777 mysqldba

  ROOT# useradd -c "mysql DBA" -d /home/mysql -u 777 -g 777 -m -n mysql

  5.3 現在作為mysql使用者,為mysql資料庫建立目錄,並開始安裝和編譯mysql

$ mkdir ~/db ## where the DB will reside
$ cd /usr/local/src/mysql-3.22.27
$ ./configure --localstatedir=/home/mysql/db --prefix=/usr/local/mysql
$ make
$ make install
5.4 產生*MySQL*授權表(只有在安裝*MySQL之前,這才是必須的)
$ ./scripts/mysql_install_db
5.5 安裝和修改資料庫的啟動指令碼,將資料庫的所有者從root變為mysql
<CENTER><ccid_nobr>
<table width="400" border="1" cellspacing="0" cellpadding="2"
bordercolorlight = "black" bordercolordark = "#FFFFFF" align="center">
<tr>
  <td bgcolor="e6e6e6" class="code" style="font-size:9pt">
  <pre><ccid_code> 
ROOT# cd /usr/local/src/mysql-3.22.27/
ROOT# cp support-files/mysql.server /etc/rc.d/init.d/
ROOT# chmod 755 /etc/rc.d/init.d/mysql.server
ROOT# [ edit /etc/rc.d/init.d/mysql.server: ]
mysql_daemon_user=mysql ## so we can run mysqld as this user.
ROOT# chkconfig --add mysql.server ## permanently add server to rc scripts



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.