Linux下Apache PHP Mysql預設安裝路徑,apachemysql

來源:互聯網
上載者:User

Linux下Apache PHP Mysql預設安裝路徑,apachemysql

Apache
如果採用RPM包安裝,安裝路徑應在 /etc/httpd目錄下
Apache設定檔: /etc/httpd/conf/httpd.conf
Apache模組路徑: /usr/sbin/apachectl
web目錄: /var/www/html


如果採用原始碼安裝,一般預設安裝在 /usr/local/apache2目錄下

 


PHP
如果採用RPM包安裝,安裝路徑應在 /etc/目錄下
php的設定檔: /etc/php.ini


如果採用原始碼安裝,一般預設安裝在 /usr/local/lib目錄下
php設定檔: /usr/local/lib/php.ini 或 /usr/local/php/etc/php.ini  

 


Mysql
如果採用RPM包安裝,安裝路徑應在 /usr/share/mysql目錄下
mysqldump檔案位置: /usr/bin/mysqldump
mysql設定檔: /etc/my.cnf 或 /usr/share/mysql/my.cnf
mysql資料目錄: /var/lib/mysql目錄下


如果採用原始碼安裝,一般預設安裝在 /usr/local/mysql目錄下



Linux下編寫自動安裝mysql apache php指令碼

1.1 編譯安裝

# groupadd mysql
# useradd -g mysql -d /usr/local/lib/mysql -s /sbin/nologin mysql

# tar zxvf mysql-x.x.x
# cd mysql-x.x.x
# ./configure --prefix=/usr/local/lib/mysql --localstatedir=/usr/local/lib/mysql/data --with-charset=utf8 --with-extra-charsets=all
# make
# make install

# cp support-files/my-medium.cnf /etc/my.cnf

# cd /usr/local/lib/mysql
# mkdir data
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .

# echo "/usr/local/lib/mysql/bin/mysqld_safe &" >> /etc/rc.local
# /usr/local/lib/mysql/bin/mysqld_safe --user=mysql &

1.2 進入mysql的DBMS

# /usr/local/lib/mysql/bin/mysql -u root -p
enter password: <Enter>

*註:預設mysql的root使用者口令為空白

1.3 mysql資料在頁面顯示為中文亂碼的問題

--with-extra-charsets=all是解決中文亂碼的關鍵參數,它的作用是安裝額外的字元集,其中即包括gbk等中文字元集。在建立資料庫時手工指定字元集為gbk,這樣就可以保證同樣使用gbk字元集的HTML頁面正常地顯示中文了:
create database <db_name> default character set gbk collate gbk_chinese_ci;

2. 安裝Apache
===============

2.1 編譯安裝

# tar zxvf httpd-x.x.x.tar.gz
# cd httpd-x.x.x
# ./configure --prefix=/usr/local/lib/apache --enable-so --enable-mods-shared=all --enable-rewrite=shared --enable-speling=shared
# make
# make install

2.2 apache啟動停止命令

# /usr/local/lib/apache/bin/apachectl start
# /usr/local/li......餘下全文>>
 
CentOS下mysql、Apache的預設路徑在什地方?

安裝位置在/var下面
設定檔在/etc下面,比如mysql,就是/etc/mysql/
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.